emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC] [export] synctex support for ox-latex
Date: Wed, 30 Oct 2013 14:14:14 +0100	[thread overview]
Message-ID: <8761sej3yx.fsf@pank.iue.private> (raw)
In-Reply-To: <87zjprbbhl.fsf@gmail.com> (Aaron Ecay's message of "Wed, 30 Oct 2013 00:59:02 -0400")

Hi Aaron,

Aaron Ecay <aaronecay@gmail.com> 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	other threads:[~2013-10-30 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 18:17 [RFC] [export] synctex support for ox-latex Aaron Ecay
2013-10-29 11:11 ` Rasmus
2013-10-30  4:59   ` Aaron Ecay
2013-10-30 13:14     ` Rasmus [this message]
2013-11-05 10:54 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761sej3yx.fsf@pank.iue.private \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).