jlaurens / synctex

Synchronization for TeX
MIT License
57 stars 19 forks source link

Synctex only consider matches in the latest tag #45

Open user202729 opened 2 years ago

user202729 commented 2 years ago

Consider for example:

\documentclass{article}
\begin{document}

\ExplSyntaxOn
\input{d.tex}
\file_get:nnN {d.tex} {} \__a
\ExplSyntaxOff

\end{document}

where d.tex contains

content

then the content text is typeset in the first \input, however in the synctex file there's

Input:7:/tmp/./d.tex
Input:8:/tmp/./d.tex

and when the synctex command is executed

[tmp]$ synctex view -i 1:1:d.tex -o .vimtex_build_dir/c.pdf
This is SyncTeX command line utility, version 1.5

it does not result any result (only return result associated with the tag 8)


Remark:

%! TEX program = lualatex
\documentclass{article}
\begin{document}

\ExplSyntaxOn
\input{d.tex}
\immediate\openin 0 {d.tex}
\immediate\read 0 to \__a
\immediate\closein 0
\__a
\ExplSyntaxOff

\end{document}
\directlua{tex.set_synctex_no_files(1)}
\file_get:nnN {d.tex} {} \__a
\directlua{tex.set_synctex_no_files(0)}