Am 25.03.2014 15:23, schrieb Lenz Grimmer:
> Hi,
>
> I've started using Sphinx by converting an existing OpenOffice Document into
> rst/sphinx (using od2sphinx). I now have a directory "FirstDocument", that
> contains all the relevant files, e.g. the Makefile, conf.py and the *.rst files
> that resemble this document.
>
> Now I'd like to create another document, let's call it "SecondDocument". I would
> like to be able to render both documents as individual PDFs. However,
> SecondDocument will contain a number of chapters that are part of the
> "FirstDocument" folder already.
> To avoid having to maintain the same files in two locations, I was thinking of
> creating a directory "common" on the same level as the directories for
> FirstDocument and SecondDocument and change the index.rst files in both
> directories to include these files by adding them as "../common/Filename.rst" in
> the toctrees. However, this does not seem to work, I get the following warning
> when running "make latexpdf" in the document directories: "WARNING: toctree
> contains reference to nonexisting document u'common/Filename' - the resulting
> PDF does not contain the chapters in question.
All files referenced by "toctree" must be within the project, i.e. the directory
containing conf.py and its subdirs. Within that, relative paths like
"../common/Filename.rst" are possible.
Note that Sphinx can already produce multiple .tex (and then .pdf) files from a
single project: the "latex_documents" config value is a list.
If you export to HTML, it is not advisable to have a single .rst file in two
different "toctree"s, since each .rst document can only have one set of
parent/predecessor/successor in the TOC tree.
But if you export only to LaTeX, it should work perfectly.
Otherwise, Jan Ulrich's suggestion with "include" is what you want.
cheers,
Georg