TeXstudio lists sections, subsections etc. and files in the "Structure" window, which is great. However, if files are included into a document via input{file}, the section-tree get is flattened at this point. I am not sure if this is intended, but I would prefer a behavior, where files are inserted into the current subtree instead of always inserting them in the top level. I include tikz-images and tables that are defined in extra files with input{file} at various tree levels. With the current behavior the structure tree looses all structure in my bigger tex projects.
If this behavior is intended, I would appreciate a configuration option to switch between the current and my preferred behavior.
Save the following code into a file, create another_file.tex, and see the difference that occurs if you comment in the input-lines.
\documentclass[]{article}
\begin{document}
\section{Section 1}
%\input{another_file}
\subsection{Subsection 1.1}
%\input{another_file}
\subsubsection{Subsubsection 1.1.1}
\subsection{Subsection 1.2}
\section{Section 2}
\subsection{Subsection 2.1}
\end{document}
I would prefer a behavior that indents the first occurence of "another_file" below "Section 1" and the second occurence below "Subsection 1.1" and that allows to collapse the "Section 1" and "Section 1.1" subtree.
PS: Thank you so much for developing TeXstudio. It is a really great tool!
activate advanced options:
options/advanced editor/keep indentation of includes in structure tree
I just stumbled across this issue, because I wanted to create a similar one. Is there a specific reason why this setting is not activated by default? It feels like this would make more sense.
basically because you can put whatever you want into included files, even \section.
So, there is no guarantee that indented presentation is close to what the user needs.
Most helpful comment
activate advanced options:
options/advanced editor/keep indentation of includes in structure tree