## subfiles package

Help
Anonymous
2012-06-01
2013-05-29

• Anonymous
2012-06-01

Is it possible to use the subfiles package in TeXclipse? As I understand it, I should be able to include a preamble in my subfiles using this package, but TeXclipse always spits out the error "Can be used only in preamble…" For instance:

document.tex:

\documentclass{report}
\usepackage{subfiles}
\begin{document}
\title{Subfiles Test}
\date{\today}
\maketitle
\subfile{sub}
\end{document}


sub.tex:

\documentclass[document.tex]{subfiles}
\usepackage{xr}
\externaldocument[A-]{sub2}
Reference: \ref{A-sub2Ref}


sub2.tex:

\begin{equation}
\label{sub2Ref}
x=y
\end{equation}


Obviously the idea is that I want to reference things that are in different subfiles (so I could have each chapter in a report be it's only subfile, but reference between chapters, for instance).