0

Including the menukeys package breaks SyncTeX's inverse search for content included by \input.

MWE:

mwe.tex:

\documentclass{article}

\usepackage{menukeys}

\begin{document}

Hello World.

\input{input.tex}

\end{document}

input.tex:

Bonjour Le Monde.

Double-clicking the Hello World on the PDF takes me to mwe.tex, but double-clicking Bonjour Le Monde results in a message "No synchronization info at this position". I expected it to take me to input.tex.

System:

  • OS: Windows 10
  • LaTeX compiler: TeXworks 0.6.6, using pdfLaTeX.
  • PDF Viewer: SumatraPDF 3.3.3 64-bit.
  • TeX Editor: Notepad++ 8.1.9.2 32-bit

(I prefer to use TeXworks for compiling the TeX only. I'm not bothered about forward search.)

I'm aware that several people have raised similar issues with SyncTeX and \input files, such as Synctex fails for input files. Related to fancyhdr + graphicx?. However, the most recent post says it's resolved. A \clearpage fixes the issue but this doesn't always result in a pleasing document.

Is there more up-to-date information on resolving this? Should I consider raising an issue, and if so, where? SyncTeX?

Thanks!

6
  • Can you please include a \listfiles in your preamble and post the resulting log? I'll try to investigate.
    – Skillmon
    Dec 17, 2021 at 9:34
  • @Skillmon the problem is from tikz, more exactly it breaks as soon as one add one \pgfdeclarehorizontalshading from pgflibraryfadings.code.tex, but I don't have the time now to look more, so if you find something ... Dec 17, 2021 at 9:45
  • @UlrikeFischer at least in TeXstudio everything works fine with SyncTeX. Since I'm not on Windows I can't test SumatraPDF. Still curious that it works flawlessly in both directions in TeXstudio and TeXworks on Linux.
    – Skillmon
    Dec 17, 2021 at 10:42
  • @Skillmon, do you still want the \listfiles log? Also, I tried the Windows version of TeXstudio 4.1.2. Its PDF viewer does the inverse search correctly, but SumatraPDF still returns "No synchronisation info...". Do you or @UlrikeFischer think it's worth me posting a bug report with Sumatra?
    – Scallions
    Dec 21, 2021 at 2:17
  • No, the \listfiles was a stab in the dark (or to put it more precisely: menukeys had a major change about a year ago and I just wanted to make sure that you don't use an old version). With @UlrikeFischer's precise analysis that's no longer necessary. And yes, I'd report this to the Sumatra maintainers.
    – Skillmon
    Dec 21, 2021 at 7:35

1 Answer 1

3

It breaks for me as soon as I add an immediate xform (something that the fadings libary of pgf does too):

\documentclass{article}

\setbox0\hbox{A}
\immediate\pdfxform0
\begin{document}

Hello World.

\input{input1.tex}

\end{document}

This gives a synctex file with beside other this here

Output:pdf
Magnification:1000
Unit:1
X Offset:0
Y Offset:0
Content:
x0,0:491521,447828 %<------ from the xform
!1346

Imho the marked part confuses sumatra.

I added an issue here https://github.com/jlaurens/synctex/issues/44

I have some doubts pgf really has to use \immediate\pdfxform resources, imho simply \pdfxform resources should work too. So another solution could be to ask pgf to change that in the relevant driver files.

1
  • What you marked does not conform to synctex specs (see man 5 synctex). These specs can change if this is an absolute requirement and that would imply a change to the synctex library as well. Mar 29, 2022 at 21:48

You must log in to answer this question.

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