emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] [export] synctex support for ox-latex


From: Rasmus
Subject: Re: [O] [RFC] [export] synctex support for ox-latex
Date: Wed, 30 Oct 2013 14:14:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Aaron,

Aaron Ecay <address@hidden> writes:

>> It doesn't work for me however.  Or perhaps I just don't get it.  I am
>> expecting it to work similarly to AUCTeX-synctex and other non-Emacs
>> editors supporting synctex.  E.g. a red box usually pops up,
>> highlighting the correct line and I'm able to jump back from the pdf
>> to the source.  Neither works.
>
> Indeed, the jump from emacs -> pdf is not implemented.  I’ve got some
> complicated dbus voodoo (attached to this email, in case it is useful
> for you or others) in my init.el to get that working with AucTeX – I am
> also using evince as the viewer).  So I will have to investigate how to
> add that feature.

For me it works out of the box.

The relevant bits to get Synctex in AUCTeX working for me are:

   (setq TeX-source-correlate-mode t
         TeX-source-correlate-method 'synctex)

using AUCTeX-git from May 27 this year.

> The jump from pdf viewer -> org should be working though, assuming it
> does for you in auctex.  (I also have some dbus arcana for that portion
> in my init.el file; I assume you do too).

No dbus stuff in my Emacs.  The only dbus thing I do is when I start
my window manager in xinitrc:

   exec dbus-launch --exit-with-session i3

Further, I run the following standard  Archlinux xinit stuff:

# launches a session dbus instance
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && type dbus-launch >/dev/null; then
  eval $(dbus-launch --sh-syntax --exit-with-session)
fi

That's it.

> Ideally, I think ox-synctex should eventually include the configurations
> for as many pdf viewers as possible, so that users do not need to
> configure this themselves.  (Ideally x 2, some external library would
> already provide this...)

I think AUCTeX is the reference here.  It works as well as TeXWorks
wrt. Synctex now.

>> I tested it with emacs -q.  
>> 
>> Note, there should probably be some require statement in the top of
>> your file.  ox-latex would work, but you might only need org-element.
>
> This is right; I added both just to be safe (and dired, which was also
> needed since I borrow a defcustom from there).

Something is still missing.  When running the following test from
emacs -q I get the
included error

#+BEGIN_SRC emacs-lisp
(load "~/.emacs.d/lisp/ox-synctex.el")
(setq org-latex-pdf-process 
      '("pdflatex -synctex=1 -interaction nonstopmode -output-directory %o %f"))
(ox-synctex-activate)
(org-latex-export-to-pdf)
#+END_SRC
* test
results in 
: ad-Advice-org-export-as: Invalid function: ((symbol-function (quote 
org-no-properties)) (lambda (s &optional _restricted) s))

It works with my normal Emacs.

> One thing I forgot to mention in my last email is that you need to
> customize your org-latex-pdf-process to make the latex compiler generate
> a synctex file.  (This is a command line switch, but it differs across
> (pdf/xe/lua)tex.)  So this could be why it does not work for you in
> emacs -q.  The following bit of code suffices, after M-x load-library
> ox-latex:
>
> (setq org-latex-pdf-process 
>       '("pdflatex -synctex=1 -interaction nonstopmode -output-directory %o 
> %f"))
>
> I attach another version of the patch, with the missing requires as well
> as some more logging code.  If it doesn’t work for you, could you
> perhaps send me the lines in *Messages* generated by the export?

I think I also added it yesterday when I tested it.

ox-synctex: active during latex compile
Processing LaTeX file ./test.tex...
Process completed.
ox-synctex: no concordance, not patching.
ox-synctex: done, hoorah!
Running evince /home/rasmus/download/tmp/test.pdf...done

I'm still not able to go to the source from Evince.

Perhaps I'll have time to do proper debugging over the weekend, but no
promises.

–Rasmus


-- 
El Rey ha muerto. ¡Larga vida al Rey!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]