The most recent MiKTeX update 21.6 resolves an issue involving the aux directory that seems to have changed the behavior of -aux-directory=<filename> to place the .synctex.gz files in the auxiliary folder rather than in the output directory (in this case the same location as the TeX file and PDF output since no -output-directory is specified) as it did before the update. This is confusing because in the linked issue, it's explained that SyncTeX files are indeed output files, not auxiliary files.

It would not be a concern except that TeXstudio needs the synctex.gz file in the same location as the TeX and PDF files for "go to source/pdf" to work (explained here). The command I'm running in TeXstudio 3.1.2 is

pdflatex.exe -synctex=1 -interaction=nonstopmode -aux-directory=C:\Users\matthew\math\auxtexfiles %.tex

on Windows 10. Is there a workaround to either tell TeXstudio to look in the auxiliary folder for the SyncTeX files or tell MiKTeX to place SyncTeX files with the TeX and PDF files as it did before the update?

  • According t the issue you linked synctex.gz shouldn't be moved to the aux-directory. If it is indeed moved to the aux-directory then you are experiencing the error the poster of the issue has noted. Have you tried specifying the output folder-option?
    – nhck
    Jun 12 at 17:45
  • If I specify the output folder then every time I compile in TeXstudio, the output will go to that folder. I would like the synctex files to go to the same folder as the original tex file, which will be different depending on the location of the tex file.
    – mbert
    Jun 12 at 18:15
  • 1
    There is now a GitHub issue: github.com/MiKTeX/miktex/issues/846 Jun 13 at 10:05

The solution I found to work with TeXstudio on Windows 10 consists of editing the PdfLaTeX command within settings of TeXstudio so that it resembles the following:

pdflatex.exe -synctex=1 -interaction=nonstopmode -aux-directory=build -output-directory=./ %.tex

where build is my directory for auxiliary files and ./ specifies the current root directory where output files should be placed, e.g. .pdf,.synctex.gz, etc.

  • Thanks, this seems to work! I still think it is a bug since I don't believe MikTeX intends to require an output directory specified for this behavior, though this is only a guess.
    – mbert
    Jun 20 at 21:31

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.