From the screen shot, it appears as if the warning is displayed when you have a subfile open, not when compiling the main file. So, looking at this file alone, which is itself not compilable, there is a \subsection
without a parent \section
. As I mentioned in the comments, the following:
test.tex
:
\documentclass{article}
\begin{document}
\subsection{foo}
%...other content of this subsection...
\end{document}
does not result in a warning when compiled. So, perhaps one way of dealing with this is to have a fully compilable sub-file (as shown above) by adding \documentclass
and \begin{document}
prior to the content followed by \end{document}
. This should eliminate the warning. In the main file, you would need to include the standalone
package:
main.tex
:
\documentclass{scrbook}
\usepackage{standalone}
\begin{document}
\chapter{Foo}
\section{Foo2}
\input{test}% import the subsection
\end{document}
Martin, the package author provides a good example here. Also, do note that the main.tex file will need to include all the packages required by the subfiles.
If you include all the packages in the subfiles as well, you will be able to compile each them separately as well.
Update: However, quoting from the TeXlipse documentation it appears that this particular issue is hard coded into its own syntax parser:
The plug-in tries to indicate if there are errors in the document... Also, subsections without a preceding section (or subsubsection without a preceding subsection) cause a warning annotation (the warning annotation is a yellow triangle with a black exclamation mark).
so one way to get around this would be to tell the parser to ignore this portion of your document by surrounding it with %###
as per the TeXlipse FAQ:
%###
\subsection
%###
\documentclass
so that those trying to help don't have to recreate it.