189

I stumbled upon these SyncTeX files in my directories and wanted to know what they are for. I searched this site and the internet and I think I have some vague understanding of what it is but I'm still not very satisfied with my actual knowledge. I've found many questions about configuring SyncTeX but none about what it is and what it does.

So, could someone explain what is SyncTeX and what does it do exactly and/or point to some general purpose documentation?

4
167

SyncTeX is a utility written by Jérôme Laurens which enables synchronization between your source document and the PDF output. If your editor/viewer supports it, then you can click in your source and jump to the equivalent place in the PDF or click in the PDF and it will jump to the appropriate place in your source document.

In TeXShop, for example, Command-click does the navigation. Other editor/viewer pairs may implement the exact commands slightly differently.

The files that it creates store all of the synchronization data that make this magic possible. Gzipped versions of these files are created if you pass the --synctex=1 option to e.g. the pdflatex command (and other engines similarly); non-zipped versions can be created with --synctex=-1, although for a large document these files can be quite large, so the zipped ones are generally to be preferred. See

Usually this is part of the default setting for the compilation command within most TeX-aware editors.

7
  • Also note that the only engine (I'm aware of) which doesn't support synctexing is (plain) tex. – karlkoeller Jun 10 '13 at 16:14
  • 1
    @franz It all depends on whether the previewer and the editor can communicate with SyncTeX. For instance I use Aquamacs and Skim; the communication between the two applications is flawless. – egreg Jun 10 '13 at 20:30
  • 2
    @egreg I think I understand now. BTW before asking the question I had a vague idea but it was completely wrong :D – franz Jun 10 '13 at 20:35
  • 1
    I don't use SyncTeX but a coauthor of mine does. Based on what you've written above, @Alan Munn, am I correct in thinking that *.synctex.gz are generated files that I can safely remove from version control? – Psychonaut Jun 29 '16 at 11:41
  • 2
    @Psychonaut Yes, I would see no problem with that. (I'm not sure why you wouldn't use it, though. It's very helpful.) – Alan Munn Jun 29 '16 at 12:30
6

Regarding synctex and plain tex -- in TeX Live, my goal is for "tex" to be TeX, i.e., to let DEK still invoke "tex" and get his program.

To get an extended non-ini engine, plain TeX macros, DVI output by default, "etex" is available. This is actually pdftex with the DVI default, not the pure e-TeX, because some of the non-PDF features in pdftex have come to be commonly used and useful. Breitenlohner said ok to that ...

1
  • 8
    While this is probably valuable information it doesn't seem to answer the question at hand, thereby making this information hard to find. Consider asking a dedicated question where you can post this answer. (Answering your own questions is allowed and encouraged.) – das-g Dec 4 '18 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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