I'm using the standalone package to create a document. The main document is


\section{Section 1}
\section{Section 2}

Now within the .tex files Section1 and Section2 I have defined a new command


Which is required by both for standalone compilation, however when I try to compile main.tex this produces the error Command \br already defined. What is the best way for me to include new commands so that everything compiles correctly?

  • 2
    Define the command conditionally in each subfile and then define it in your main file. Or use \providecommand... rather than \newcommand....
    – cfr
    Mar 25 '15 at 22:52
  • Or use subpreabbles=true on only the first file. Mar 25 '15 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.