EDIT: Substantial edit of the original version has been done to clarify the question.
Background
I've written two small python package manuals with sphinx
(http://sphinx-doc.org/) a program that helps with source code documentation. Among others sphinx
allows to output the manuals to LaTeX, based on their own documentclass and defined in a style file.
I am currently writing my thesis and would like to present the manuals in the appendix of the document. The format of the sphinx latex files is convenient for its purpose, but I don't want to use it for the remainder of the thesis. However, vice-versa in the manuals I'd like to stick to the sphinx-format.
Question
Is there a way to include full documents into a main document, such that they maintain their format without interfering with the main document? A similar problem would be to include a refereed paper inside e.g. a thesis such that it maintains the format of the Journal.
Notes
Including the files in tex format and compiling them together with the main document would allow referencing as well as correcly numbered pages and inclusion in the toc.
EDIT:
Options from the comments below:
standalone package this seems promising. However I still have issues with it (see below.) (also https://tex.stackexchange.com/a/12268/27635)
combine
seems to me that it is rather usefull to produce something like conference proceedings with mutliple files in the same format. It also only lists the titles in the general TOC.Compiling the manuals indivudualy and including them in the main tex as pdf. I would rather not use this option, if possible.
Possible contender: Standalone
I am not sure if this is the right way to go. From what I understand standalone
loads the preamble from the sub-files for the main.tex
file. This is what I'd like to avoid. Hoever, so far I managed to use standalone to include the manuals into my main manual, however the style remains the same as in the main tex, otherwise this would be what I search for. Here is my current setup for my main.tex
:
\documentclass[12pt, twoside, paper=A4, final]{scrbook}
\usepackage{standalone}
\usepackage{load other packages ...}
\begin{document}
Mainmatter
\input{manual}
\end{document}
and my manual.tex
:
\documentclass[subpreamble]{standalone}
\usepackage{sphinx}
\standaloneconfig{class=sphinxmanual}
\begin{document}
manual content
\end{document}
I am not sure if I declare the documentclass for standalone correcly and wheter \standaloneconfig
accepts it.
\documentclass{...}
and ending with\end{document}
.standalone
seems promising and I managed to include the files, however the different style is not adopted, yet. @EthanBolker BolkerFrom what I seecombine
needs the same style for each document and is more though to produce something like conference proceedings.