Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Normally I write my LaTeX with Emacs/AUCTeX viewing in xdvi, which has the very nice "source specials" feature that I can hit a key command in Emacs to jump to the current location in the output dvi file in xdvi, and likewise I can click on a location in xdvi and have Emacs jump to that location in the source file. But sometimes, notably when using TikZ, I need to compile with pdflatex. Is there any source-specials-like feature for PDF files which works with AUCTeX? I'd be willing to switch to any PDF viewer that will run in Linux.

share|improve this question
2  
This is essentially a duplicate of tex.stackexchange.com/questions/705/… The answer is to use synctex, and as for viewers, Okular and future versions of evince apparently work. –  ShreevatsaR Aug 13 '10 at 6:53
    
Mike, please take a look at the question that ShreevatsaR linked to. If that does answer your question, this one will (probably) be closed as a duplicate to keep all answers in one place. If it doesn't answer your question, please explain why here so that people know what aspect of your question to focus on. Thanks (and welcome to the site!). –  Loop Space Aug 13 '10 at 7:33
1  
Probably it's not exactly a duplicate, because here the question is how to go from the source to the output and vice versa. Question 705 asks only for the forwardPDF function. –  Alessandro Cuttin Aug 13 '10 at 9:25
1  
@Alessandro C: Perhaps, but it's hard to imagine someone just wanting to go one way so maybe the two questions can be merged into a single question about going there and back again? –  Loop Space Aug 13 '10 at 10:04
    
I haven't had a chance to try any of these answers yet, but there is no chance that I would have read that other question and guessed that it had anything to do with what I wanted to know. I don't know what "srcltx" or "ForwardDVI" refer to. –  Mike Shulman Sep 18 '10 at 7:09
add comment

2 Answers

Recent versions of AUCTeX's source specials handles synctex. So make sure you have the latest release 11.86.

You also need a recent version of pdftex that supports synctex. The one in TeX Live 2009 is fine.

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009)

For backward search, you need to configure your pdf viewer to support emacs. Usually the pdf viewer would have an entry in the FAQ or Wiki teaching how to set this up and usually pretty simple.

For forward search, I am not sure if 'C-c C-v' does this automatically.

But backward search is usually more important.

share|improve this answer
add comment

A solution for the reverse search (from PDF to the source code): I currently use pdfsync; here's an excerpt from the readme file:

pdfsync.sty allows one to synchronize between LaTeX source and pdf output. When used with a text editor and a PDF viewer that both support pdfsync, you can navigate from the source to the output and vice versa. This is some kind of srcltx ported from dvi to pdf.

All you need to do is to include it in your preamble with

\usepackage{pdfsync}

If you use the hyperref package or another similar package that manipulates the references, take care of load pdfsync as the last one.

Caveat: it is a little buggy (but, to me, it works quite well)

You should not use pdfsync on final documents because it can change the layout rather significantly

The accuracy of pdf synchronization depends on the application used for that purpose.

In case of conflicts or malfunctioning, read the documentatation.

share|improve this answer
3  
pdfsync is deprecated in favour of synctex. as you say, pdfsync can be a bit buggy, and it can change the linebreaking of your document simply by including it. Most editors and viewers that support pdfsync will also support synctex. –  Lev Bishop Aug 13 '10 at 12:59
    
I had actually switched in favour of synctex :) However, I'm not able (at the moment) to make it work from Kile to Okular. –  Alessandro Cuttin Oct 16 '10 at 7:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.