2

I have set up a LaTeX file for a book-type document with the following preamble:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{textgreek}                      
\usepackage{gensymb}                        
\usepackage{csquotes}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\usepackage[backend=bibtex8,style=chem-angew,doi=true]{biblatex}
\addbibresource{Bib.bib}
\usepackage{wrapfig}
\usepackage{chemmacros} 
\usepackage{psfrag}
\usepackage[runs=2]{auto-pst-pdf}
\usepackage{chemnum}

Now, when I make a document were everything is included after the preamble, that includes a figure with TMP - tags, all works out fine, the tags are replaced with compound numbers.

\begin{document}
    \cmpd*{Bla}
    \cmpd*{Blab}
    blalba\cite{text} 

    \begin{figure}[h]
        \centering
        \replacecmpd{Bla}
        \replacecmpd{Blab}
        \includegraphics{rxn.eps}
        \caption{\ortho-selective chemistry.}
    \end{figure}
    \printbibliography
\end{document}

If, however I copy all the content of the document into an additional file like this:

\begin{document}
    \input{text}
\end{document}

I get the following error:

pdfTeX error: pdflatex (file ./main-pics.pdf): PDF inclusion:
required page does not exist <1>

Can anyone explain this? The .log file is not really conclusive. The problem does not change when I use \include instead of \input I really don't want to put everything into one file.

edit: I forgot, I am using MacTeX 2015.

6
  • And how is main-pics.pdf related to the code you show here?
    – daleif
    Mar 10, 2016 at 20:53
  • "main" would be the name of the .tex file to compile, thus the error relates tomain-pics.pdf.
    – siggg
    Mar 11, 2016 at 17:03
  • the point here, where does the pics part come in? Where is that related to the mwe you provide?
    – daleif
    Mar 11, 2016 at 17:08
  • I don't really get it myself, but I believe it is in a way related to the package auto-psd-pdf. I only started having this error when I wanted to use the tags, so I added the packages psfrag and auto-psd-pdf.
    – siggg
    Mar 12, 2016 at 8:33
  • So I can extend a bit here: I just tried on a bit and the MWE posted above works now. However I do not understand why. What I did is i commented \usepackage{chemmacros} out, the document compiled, then i added the package again and the document would still be compiled, which worked repeatedly, also when adding specific elements of the chemmacros-package.
    – siggg
    Mar 14, 2016 at 14:30

2 Answers 2

0

I was came across a similar problem to yours, until I started using the package subfile. There is some good documentation here: https://en.wikibooks.org/wiki/LaTeX/Modular_Documents#Subfiles

I found subfile particularly useful since I was working on a multi chapter book, so I needed to have multiple tex files for the different chapters which compile using a main.tex (mother file). The chap1.tex (child file) could then be compiled on its own, and automatically integrated in the main when compiling main.tex.

...just my cents worth....

4
  • Thank you, I will try this out first thing next week and report back how it worked out.
    – siggg
    Mar 11, 2016 at 17:05
  • So I tried out \subfile but unfortunately the error remains the same, no change.
    – siggg
    Mar 14, 2016 at 7:39
  • Is there a reason why you are using "./" as prefix to your file? Mar 15, 2016 at 8:41
  • Yes, the path to the specified file is not recognized otherwise. I also tried out the same sequences when having all the files to be called up in one folder, the problem does not change.
    – siggg
    Mar 15, 2016 at 9:14
0

So just to update, I actually found the "solution" to the problem. All that was necessary was to update the complete TeX distribution, since - although I just recently installed it - many of the packages (foremost the chemmacros, which seemed to interfere the most) were not up to date. Sorry for the fuss, I am glad I could resolve it thanks to all of you, especially clemens!

You must log in to answer this question.

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