1

I have a question regarding the structure of a project in TeXnicCenter. I am currently writing my thesis and created a project with a main document main.tex. Each chapter is a tex subfile that I link to the main document using the import package. However, the outline does not contain all the chapters and sections but only the ones in the main document. (In the following example, I would only have "Chapter 1"). I tried creating the chapter1.tex as a project and as a single file but I did not manage to change this. Do you have an idea on how to proceed to be able to see the full structure of the document? How can I link properly the subfiles to the main file?

Here are the two files for my example with a main file and a subfile.

main.tex:

\documentclass{book}
\usepackage{import}
\begin{document}
\chapter{Chapter 1}
\import{sections/}{chapter1.tex}
\end{document}

chapter1.tex

\section{section1}

Image of the example

2 Answers 2

1

I have the same problem. The way I found was to trick TeXnicCenter by giving input commands that are not executed but are read by TeXnicCenter to find files composing the project. In your example I would try:

\documentclass{book}
\usepackage{import}
\begin{document}
\chapter{Chapter 1}
\import{sections/}{chapter1.tex}
\iffalse
  \input{sections/chapter1}
\fi
\end{document}

HTH

0
0

I found the answer of @JoseGaspar helpful but will add a few more lines as I had the same problem without using \import.

It looks like TexnicCenter parses the parameters of \input statements without interpreting the statement within the context. Sticking with your example this means, if you set an input path like, e.g.,

 \makeatletter
 \def\input@path{{section/}}
 \makeatother

for an input like

\input{chapter1.tex}

TexnicCenter would disregard the input path and look for a file named chapter1.tex in the directory of the main file to build the outline. Furthermore, I assume TexnicCenter doesn't even consider import-statements.

As I am a bit structure-savy, this problem hit me when I tried to use nested inputs and a directory structure with a depth of 2 (e.g., chapters/chapter1/section1.tex). Input paths would have been nice to not always repeat the common chapters part in all input statements. Turns out they are not an option if you want to use the outline in TexnicCenter.

Disclaimer: These are just speculations as I don't know the code of TexnixCenter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .