all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Hofert <marius.hofert@math.ethz.ch>
To: Emacs help <help-gnu-emacs@gnu.org>
Subject: Re: Emacs 23.3 + Synctex + Skim: some question/overview
Date: Thu, 27 Oct 2011 09:00:47 +0200	[thread overview]
Message-ID: <68F7F494-A311-4956-952D-6940DAEBF0C5@math.ethz.ch> (raw)
In-Reply-To: <58F966CE-51BE-45E2-96A8-D48358CF0EC2@math.ethz.ch>

Okay, it took quite some time, but I finally figured it out... (comments below)

On 2011-10-25, at 11:29 , Marius Hofert wrote:

> Hi,
> 
> I'm a bit lost concerning setting up GNU Emacs 23.3 + Synctex with Skim on Mac OS X 10.7.2. I found different approaches online but they don't seem to work nicely.
> 
> So here is the part of my .emacs:
> 
> (setq TeX-PDF-mode t); use pdflatex by default
> '(LaTeX-command "latex -synctex=1"); use synctex [sometimes it's given with two hypens instead of one (?)]
> (server-start); start emacs in server mode so that skim can talk to it
> 
> Problems/Questions:
> 1) Now skim more or less works, but CMD + Shift + click in the .pdf does not bring me close to the corresponding point in .tex (I end up roughly one page away...)

this was due to a messed-up .pdf I used when testing. In a normal .pdf you should end up in the same paragraph.

> 
> 2) I also tried the following two alternatives which I found online, but they did not change anything.
> ;; alternative 1:
> '(TeX-output-view-style '(("^pdf$" "." "skim %s.pdf")))
> ;; alternative 2:
> http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=TeX_and_PDF_Synchronization
> (add-hook 'TeX-mode-hook
>    (lambda ()
>        (add-to-list 'TeX-output-view-style
>            '("^pdf$" "."
>              "/Applications/Skim.app/Contents/SharedSupport/displayline %n %o %b")))
> )

the problem here was that I totally forgot that I use latexmk via the terminal. latexmk of course does not know anything about the current line...
Going through setting  up C-c C-c to use latexmk, setting up Skim as default pdf viewer (in .emacs) and displaying the current line in highlighted form was not trivial (to me), but I finally figured it out. You can find my solution here:
http://stackoverflow.com/questions/7899845/emacs-synctex-skim-how-to-correctly-set-up-syncronization-none-of-the-exi

> 
> 3) For forward search, how can I click in Emacs so that the pdf jumps to the corresponding point? CMD + Shift + click (of course) did not work. I couldn't find any solution to this problem, except that this is not needed since skim can display a yellow line and one will then see where the cursor is. But what if skim shows a different page of the .pdf? I don't see the yellow bar on page 20 when I'm on page 10, for example...

You can simply use C-c C-v (View) to show the current line in the .pdf in highlighted form.

> 
> 4) Yellow line: How do I get the yellow line showing the point in the .pdf?

see the above link.

> 
> 5) correlate-method: I also found:
> (setq TeX-source-correlate-method 'synctex)
> (add-hook 'LaTeX-mode-hook 'TeX-source-correlate-mode)
> Is this required for synctex to work properly?

This I had from http://tex.stackexchange.com/questions/11613/launching-an-external-pdf-viewer-from-emacs-auctex-on-a-mac-osx-fails/11799#11799
Although these settings worked, I don't like using code I don't understand. The solution I pointed out above was more intuitive to me and did the same thing. By the way, it also works with multi-file documents (master...)

> 
> 
> I know that all the features (jumping back/forth to the *correct* position, yellow line) worked in Aquamacs, but I just can't get it to work for GNU Emacs.

solved :-)

Cheers,

Marius

> 
> Sorry for all the questions in one thread, but I guess it might be useful as an overview [hopefully many contribute] for future reference.
> 
> Cheers,
> 
> Marius






      reply	other threads:[~2011-10-27  7:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25  9:29 Emacs 23.3 + Synctex + Skim: some question/overview Marius Hofert
2011-10-27  7:00 ` Marius Hofert [this message]

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

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

  git send-email \
    --in-reply-to=68F7F494-A311-4956-952D-6940DAEBF0C5@math.ethz.ch \
    --to=marius.hofert@math.ethz.ch \
    --cc=help-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.