I am using TeXStudio. So I use Ctrl F5 to build and view my pdf file. However, when I right click on pdf it does not take to the correct line/paragraph on the tex file.

I found that no synctex file is getting generated. May be it is due to that. Can you please tell how can I fix this issue?

  • 1
    Please show an example code that reproduces the issue. And which version of TXS are you on?
    – Troy
    Commented Sep 6, 2018 at 13:58
  • Hi Troy, I am using version 2.12.10 and a pre-defined template, which can be found here.people.cs.kuleuven.be/~wannes.meert/adsphd
    – Rouge
    Commented Sep 7, 2018 at 10:01

1 Answer 1


Those files include just compiled PDF and source TeX as you guessed you need a valid .synctex file between them. You are expected to generate them as you go along (changing the PDF output) you need to check A) you have included perhaps via a distro (TeXlive or MiKTex) the core Tex components for pdfLaTeX and Synctex B) any given error and an indication of which commands lead to those errors

perhaps take a look at Syncing feature between editor and pdf viewer not working

OK so you tried those First to ensure it is an issue with synctex generation download the following test file https://github.com/GitHubRulesOK/MyNotes/raw/master/AppNotes/SumatraPDF/LATeX%20and%20Reverse-Search.zip

unzip the contents to a simple named folder like c:\testfiles, open the .tex and confirm you see the related pdf in viewer then in the editor use Ctrl left mouse and in pdf try right-click jump to. IT SHOULD work, if so it confirms with your files the system is either not building a valid .synctex or there is interference along the way

a common source of generation not running is the command may be missing a good path or need a "drive:\quoted path\pdfLaTeX.exe" -blah blah %.tex for some clues see Error: TexStudio "Could not start command"

Later Edit

On looking closer I think the complexity of the source documents build may be the root of this behaviour, the readme is not intuitive ! Documentation implies a custom building with F7 rather than F5 To see this is to go down the folder structure to Page 25 section 2.2\whatever\chapter\manual\manual.tex and note there are comments about modifying templates and MiKTeX commands (which you would need to emulate in TeXLive) in order to work well with TeXstudio ! Without making any changes I was (ignoring a few errors) able to navigate fairly well down from the main thesis.tex and jump back and forwards via the 38 page template but in this raw state it does feel very limited.

So rather than diving in the deep end (using this highly customised thesis) I would use any other example files for testing synctex behaviour down nested documents. For this suite of template documents at this level synctex is probably not best suited for easy navigation however it does in(re)verse open the relevant chapter for adjusting the contents.

For example

When I start with a fresh copy of the folder and open thesis.tex I can click on view icon or go Tools>Commands> view PDF and see the cover of the prebuilt thesis.pdf in the viewer If I run f5 and wait long enough the red box next to green arrow will turn grey indicating the run completed (and thus built .synctex.gz) if I right click click anywhere in the cover the editor window will briefly highlight \makefrontcoverXII in yellow then it will fade to in my case a pinkish hue with the cursor at the start of that line. In the PDF if I scroll down to page 25 and right click on 2.2 settings for TeXstudio and click go to source then the editor will open manual.tex and jump to \textit(build and view). I would normally expect it to jump to the correct location higher up within manual.tex HOWEVER with this thesis in that initial state that's as good as I may expect due to the complexity of all the "includes"

If you comment out the very first line \document class... by adding an initial % such that it reads %\docum… the next compilation is only 4 pages 3 blank and a final bibliography if you click that only/final entry it cleanly goes to the.bbl file exactly where you would expect. In summary I think that as you add more content and remove the guidance sections the syncing will improve. the thesis is hosted on GitHub and has its own "issues" section where you can raise questions specific to this template.

The remaining part of your question as to why it does not go exactly where expected is an issue that only over time, bug fixing of synctex line miscalculations (based on unconventional sources) can only play catch up.

  • Hi KJO, I checked in the setting of my texstudio (Im using texlive alone with it) Option ---> Configure Texstudio ---> Commands ---> pdflatex.exe -synctex=1 -interaction=nonstopmode %.tex. I do not get any errors but my syncing doesn't work and still no .synctex file is generated.
    – Rouge
    Commented Sep 10, 2018 at 8:25
  • Hi @KJO, I checked with the test file. It is working perfectly. However, it is still not working with my file. Can you please suggest what shall I do now?
    – Rouge
    Commented Sep 17, 2018 at 13:55
  • The point of the test was to check you see that on its own your setup is correctly responding to a valid .synctex file that was built between a.tex and its corresponding .pdf . so your issue seem to be down to configuration. You need to review your settings as discussed in the comments part of my first "not working" link are you sure your build command includes -synctex=1 which SHOULD build a yourfile.syctex.gz file see if you can find that file alongside your input.tex or output.pdf there is a possibility it is being built in another folder so try a system file search for all .syctex.gz files
    – user170109
    Commented Sep 17, 2018 at 14:24
  • It helps others to understand your installation sequence. Which OS and bits. Are all components default installs, and in which order did you install.
    – user170109
    Commented Sep 17, 2018 at 17:36
  • Thank you so much @KJO. I really appreciate that you directed me again to the not working link. The synctex.gz file was already there in folder and also the build command included -synctex=1. What made a difference is that now I deleted the existing synctex.gz file and then build my pdf again. Now it works ! Thanks again !!
    – Rouge
    Commented Sep 18, 2018 at 15:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .