# How to use the combine document class with the siunitx package

I am trying to squish several journal papers together (using the combine document class) to provide the filling for my thesis sandwich. The papers make use of the siunitx package but causes an error.

A similar posting is here: Using the "combine" document class with the listings package from which I have adapted the folowing minimal working example:

\documentclass{combine}
\begin{document}

\begin{papers}
\coltoctitle{Title}
\coltocauthor{Author}
\label{lbl}
\import{test}
\end{papers}

\end{document}


and in test.tex

\documentclass{article}
\begin{document}
Hello World
\end{document}


and I get the following error:

ERROR: LaTeX error: "kernel/command-already-defined"
--- TeX said --- !
! Control sequence \c_siunitx_textsf_tl already defined.

Can anyone help?

-
If you simply want to have journal papers like they are in your thesis use the pdfpages package. If you want to merge them to build your thesis I would rather do this manually. – Martin Scharrer Jan 23 '12 at 14:18
@Martin: I looked at pdfpages but wouldn't be able to reference equations and figures in the Discussion and Conclusion as easily, or add the papers' TOCs to the main thesis TOC – myles Jan 23 '12 at 14:21
How many papers are we talking here? It seems to me that the manual route is worth it for something as significant as a thesis. In fact, many universities do not allow this (mine did not either). I assume you've checked the guidelines for your school on this though! – qubyte Jan 23 '12 at 15:38
@Mark: Just three papers-in-progress. If you mean 'does my uni allow a thesis in the paper sandwich format' then Yes it does. I am not against manual methods in principal but I would have to maintain the main TOC and any \refs I make in the main document that refer to the papers when the papers develop. – myles Jan 23 '12 at 15:48
I wound up writing papers and thesis in tandem. It's a surprisingly good way of experimenting with structure. I understand where you're coming from though. – qubyte Jan 23 '12 at 15:54

As you say, this is caused by code at the beginning of the document. At least for the minimal example, simply bypassing this code in the subsidiary document works:

\documentclass{article}
\makeatletter

(\@begindocumenthook is where the \AtBeginDocumentCode is stored.)