jlaurens / synctex

Synchronization for TeX
MIT License
57 stars 19 forks source link

Wrong line when syncing from within \textbf{} #20

Open timhoffm opened 6 years ago

timhoffm commented 6 years ago

Minimal example:

\documentclass{article}
\begin{document}
\textbf{First Line\\
Second Line}
\end{document}

When syncing "First Line" from PDF to source, synctex returns line number 4, which is the line of "Second Line".

The correct line 3 is returned, if I don't use \textbf but still the braces.

\documentclass{article}
\begin{document}
{First Line\\
Second Line}
\end{document}

Here is the diff of the two synctex files (left with \textbf, right without):

grafik

jlaurens commented 6 years ago

Very good example, thanks for pointing this out. This is showing that the synctex file does not contain enough information to synchronize properly. Sometimes 3 should return, sometimes 4. Once TeX can record the line AND the column, then it will be "easy" to solve this problem.