From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [RFC] [export] synctex support for ox-latex Date: Wed, 30 Oct 2013 14:14:14 +0100 Message-ID: <8761sej3yx.fsf@pank.iue.private> References: <87fvrl1cqp.fsf@gmail.com> <87iowg72mu.fsf@gmx.us> <87zjprbbhl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbVbR-0004Vo-Cg for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 09:14:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbVbJ-0005cs-GM for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 09:14:29 -0400 Received: from mout.gmx.net ([212.227.17.20]:50506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbVbJ-0005cO-4s for emacs-orgmode@gnu.org; Wed, 30 Oct 2013 09:14:21 -0400 Received: from pank.iue.private ([192.167.90.142]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LpKY5-1W7HeZ3Twj-00f73V for ; Wed, 30 Oct 2013 14:14:18 +0100 In-Reply-To: <87zjprbbhl.fsf@gmail.com> (Aaron Ecay's message of "Wed, 30 Oct 2013 00:59:02 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Aaron, Aaron Ecay 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=E2=80=99ve 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 =E2=80= =93 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.=20=20 >>=20 >> 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=20 '("pdflatex -synctex=3D1 -interaction nonstopmode -output-directory %= o %f")) (ox-synctex-activate) (org-latex-export-to-pdf) #+END_SRC * test results in=20 : ad-Advice-org-export-as: Invalid function: ((symbol-function (quote org-n= o-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=20 > '("pdflatex -synctex=3D1 -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=E2=80=99t 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. =E2=80=93Rasmus --=20 El Rey ha muerto. =C2=A1Larga vida al Rey!