all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs 23.3 + Synctex + Skim: some question/overview
@ 2011-10-25  9:29 Marius Hofert
  2011-10-27  7:00 ` Marius Hofert
  0 siblings, 1 reply; 2+ messages in thread
From: Marius Hofert @ 2011-10-25  9:29 UTC (permalink / raw)
  To: Emacs help

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...)

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")))
)

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...

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

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? 

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.

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Emacs 23.3 + Synctex + Skim: some question/overview
  2011-10-25  9:29 Emacs 23.3 + Synctex + Skim: some question/overview Marius Hofert
@ 2011-10-27  7:00 ` Marius Hofert
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Hofert @ 2011-10-27  7:00 UTC (permalink / raw)
  To: Emacs help

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






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-27  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-25  9:29 Emacs 23.3 + Synctex + Skim: some question/overview Marius Hofert
2011-10-27  7:00 ` Marius Hofert

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.