How can I override or “fake” a synctex position?
Let's say we have a file foo.tex
, where we define a command:
%% foo.tex
\newcommand{\foo}{Very much content here}
and a file bar.tex, where the command is used:
%% bar.tex
\foo
In this case synctex would jump to bar.tex
, but I want it to jump to foo.tex.
Is there any possibility to create a command \setSynctexPosition
that means something like “synctex, please synchronize me with the file foo.tex”, like this:
%% foo.tex
\newcommand{\foo}{%
\setSynctexPosition{foo.tex}{line 3}%
Very much content here%
}
Can this be done at all, for example by appending some text to the .synctex
file with, e.g., \immediate\write18{echo '<some synctex commands>' >> \jobname.synctex}
?
\write
streams and, as far as I know, there is no way for interacting with it from the user's level, because it works at the level where lists are transformed into boxes.