Skip to content

Add option for additional search path for synctex file - #4736

Closed
felsenhower wants to merge 2 commits into
texstudio-org:masterfrom
felsenhower:master
Closed

felsenhower wants to merge 2 commits into
texstudio-org:masterfrom
felsenhower:master

Conversation

@felsenhower

Copy link
Copy Markdown
Contributor

This adds the option to specify an additional search path for the SyncTeX file (see Options -> Configure TeXstudio -> Build -> Additional Search Paths), similar to the existing option for the PDF File search path.

This is very convenient for users who compile to a build directory and simplifies existing workarounds.

Possibly related: #672

@sunderme

sunderme commented Nov 8, 2026

Copy link
Copy Markdown
Member

I am a bit confused.
Using just the pdf searchpath works fine on linux.
latexmk: latexmk -pdf -output-directory=build -silent -synctex=1 %
pdf search path: ./build

Forward/reverse sync work.

@sunderme

sunderme commented Nov 8, 2026

Copy link
Copy Markdown
Member

I am also not seeing the point to have a new search path when the build directories get pdf and synctex files.

@felsenhower

Copy link
Copy Markdown
Contributor Author

I am a bit confused. Using just the pdf searchpath works fine on linux. latexmk: latexmk -pdf -output-directory=build -silent -synctex=1 % pdf search path: ./build

Forward/reverse sync work.

Hi, I'm using the following command for latexmk: latexmk -shell-escape -xelatex -pdf -outdir=.latexmk -out2dir=. -silent -synctex=1 % and txs:///latexmk as the default compiler. My ~/.latexmkrc is this:

@out2_exts = ('pdf');

This setup allows me to have a build directory and only the final PDF in the project root alongside the source, not the synctex.

With this setup, the Synctex data can not be found in the build directory. With the patch, it works.

@sunderme

Copy link
Copy Markdown
Member

okay, so I will not pull this change.
It is a very specific case that you solved by adding yet another option which nobody else needs.

My proposal is to use the pdf search path as fallback.

@felsenhower

Copy link
Copy Markdown
Contributor Author

Hi, I understand that you're against adding a new configuration option (although I must say that I know a lot of people personally who would welcome it if this general "workflow" would work!)

I implemented a new fix here: d07957a

This makes TeXstudio look for the SyncTeX file in the additional search path that we configured for PDF files even if it has already found a PDF file in the project root. This also completely fixes my issue, without an additional config option.

Would this be merged if I created a new PR for it?

@sunderme

Copy link
Copy Markdown
Member

yes, the new approach looks fine

@felsenhower

Copy link
Copy Markdown
Contributor Author

Alright, thanks for the feedback!

Closing this in favour of #4742.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants