a-mueh · GitHub

Environment

  • TeXstudio: 4.6.3
  • Qt: 6.5.2
  • OS: Windows 10
  • TeX distribution: miktex

Description

Hello,

I do have to problem by navigating between my sub files, because of "wrong" root document identification

I do have a root document (Grandmaster.tex) that inclues some subfiles that are located in a subdirectory

  • tex\Grandmaster.tex
  • tex\GM\Intro.tex
  • tex\GM\revision.tex

When I open the root document the \subfile command generates a valid tree view. Additionally I am also able to navigate to each sub file without problems.
But when I am in a sub file and try to directly navigate to an other sub file, a message box is shown that the subfile.tex does not exist and if I like to create it. If I confirm this message box, a new tex file will be created in an additional sub directory

  • tex\GM\GM\revision.tex

because the program is thinking that intro.tex is the root document.

At the moment I could only solve this navigation issue by two options

  1. adding magic command %!TeX root = PC_HW086_PTP_Grandmaster to each sub document
    This cannot be done, because I am using the same sub documents in several root documents
  2. explicit configure Grandmaster.tex as root document via Options > root Document
    This cannot be done, because than I am unable to build the sub file on its own without the need of compiling the complete root document

But none of those two is a valid option for me.
Does there exists an alternative, or have I configured my tex files wrongly?

Below some pics to make my "problem" more understandable

The initial statement that the root documentation identification is "wrong" is a little bit rough. I can understand the behavior how it is working, it sadly just does not take in account, that I am using the tree view of root document to navigate, and therefore it sadly thinks that the sub file is a root file. Additionally I think, that it must be somehow related to my document structure/commands that I might use wrongly......

Br,
Andreas

Open root document
subfile_navigation_01
Navigate to 1. subfile is working because I am starting from root document
subfile_navigation_02
Clicking on second sub document in the tree view brings the message box
subfile_navigation_03
If I am confirming this message box, a new file will be created in an additional sub directory
subfile_navigation_04

Document structure and files for reproduction
Grandmaster_tex.zip

Read the original on github.com ↗