3

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}                  
\usepackage[load=named]{siunitx}
\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?

5
  • 2
    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. Commented Jan 23, 2012 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
    – myulz
    Commented Jan 23, 2012 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
    Commented Jan 23, 2012 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.
    – myulz
    Commented Jan 23, 2012 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
    Commented Jan 23, 2012 at 15:54

1 Answer 1

1

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
\@ifclassloaded{combine}
  {\let\@begindocumenthook\@empty}
  {}
\makeatother
\begin{document}
 Hello World
\end{document}

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

2
  • Thanks Joseph I was hoping you would chip in! Works great. I should correct what I said above about being able to "reference equations and figures" in sub documents from the main document: it can't be done.
    – myulz
    Commented Jan 26, 2012 at 1:24
  • I am combining several documents. I need the siunitx package so I used Joseph's suggestion. Unfortunately, this causes other problems with, for example, section numbering (3.65 instead of 4) and the numbering of theorem like environments. Does anyone know of a way to avoid this problem.
    – Tom Price
    Commented Jun 29, 2013 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .