Open JAEarly opened 2 years ago
Seems to be a synctex limitation. Tests show an input file will be recorded by synctex only if its file extension is in a specific list. For example, \input{temp.tmp}
is not recorded, but \input{temp.tex}
is. Here the "recoded by synctex" means you can find a line Input:<num>:<full path>
at the beginning of unzipped .synctex.gz
file.
Relation to comment
package: with \includecomment{excludedpart}
every excludedpart
env will first write its content to file comment.cut
, then input it back. Since file extension cut
is ignored by synctex and the contents of comment.cut
might be overwritten by following excludedpart
usages, inverse searching won't work for the output of \includecomment
environments.
Tests show an input file will be recorded by synctex only if its file extension is in a specific list. For example,
\input{temp.tmp}
is not recorded, but\input{temp.tex}
is.
I was wrong. Every input file is recorded.
Using a simplified example
\documentclass[]{article}
\begin{document}
text
\clearpage
\input{temp.tmp}
\end{document}
where temp.tmp
contains
% this is `temp.tmp`
second page \newpage
third page
texstudio fails to do inverse searching on the second and third pages, while overleaf works well.
I use the comment package to selectively remove parts of work (e.g., long appendices) to produce smaller documents or save compile time. This is enabled through the
\includecomment{<partname>}
and\excludecomment{<partname>}
functions, which either include or exclude the content enclosed between\begin{<partname>}
and\exclude{<partname>}
. When using\includecomment{<partname>}
, the "Go to Source" function is broken, as it does not move the cursor in the editor.Environment
Expected behavior
When using "Go to Source" on content that is enclosed between
\begin{<partname>}
and\exclude{<partname>}
while using\includecomment{<partname>}
should work as normal, i.e., the editor should jump to the relevant part of the Latex source.Actual behavior
The cursor in the editor does not move at all for any content enclosed between
\begin{<partname>}
and\exclude{<partname>}
. It works fine for any content outside of that area (i.e., it works as normal), just not for content in that area, even though the content is rendered exactly as it would be normally.How to reproduce
Below is a minimal reproducible example. "Go to Source" works fine for page one, but does not work at all for page two or three.