jlaurens/synctex

Synctex only consider matches in the latest tag

Opened this issue · 0 comments

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:

  • expl3's file_get is implemented with \input. If \read is used, there's no problem.
%! 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}
  • in Lua, there's a workaround
\directlua{tex.set_synctex_no_files(1)}
\file_get:nnN {d.tex} {} \__a
\directlua{tex.set_synctex_no_files(0)}