[Tex/LaTex] TexMaker – “File not found” when selecting section in structure view


I'm currently having a problem using TexMaker.

When I'm selecting a section of the document in the structure view, TexMaker jumps to this specific section within the tex document but also displays the error "File not found" and closes the pdf preview in the internal viewer.

This seems to be due to the fact that I'm using a subdirectory for the output files – but I don't seem to be able to find an option fixing this problem.

Any help would be greatly appreciated!

Best Answer

I just had this same problem. I was able to solve it by going to my "main.tex" and selecting "Options->Define Current Document as 'Master Document'".

It seems the error was caused because when I selected a chapter/section in the "Structure" pane, or right-clicked and selected "Jump to pdf", it was looking for "current_file.pdf", which didn't exist, instead of "main.pdf".

It's possible that this won't actually serve as a fix for you, but hopefully leaving this as an answer will be useful to someone.

(I don't know if this will work with the "Use a 'build' subdirectory" option, though I imagine it should. I wanted to use that myself, but that feature I found, while perhaps not literally buggy, is too messy to make it worth it: having to manually first create the directory for every project, having to manually edit the command-line options for all pdfLaTeX, XeLaTeX, LuaLaTeX, LaTeXMK, etc.. None of these are big deals, but then again, neither was having a "build" subdirectory, so I just decided to not waste my time.)