I'm a noob in LaTeX and I'm having trouble with this great template that a friend has given me.

The template has 3 TeX files and declares that if I compile the main TeX I should get 3 outputs:

  1. One PDF consisting on doc1;
  2. One PDF consisting on doc2;
  3. One PDF consisting on doc1 + doc2;

What I am getting with pdfLaTeX is the full doc (doc1+doc2) no matter which one I ask to compile.

What to do?

All else works.

"Readme" text is below:

Usage Instructions

To compile the pdf, type on the command line in the project directory:


This will produce document1.pdf and document2.pdf, corresponding to the two parts of Part B in the 2016 call. It will also produce IF-2016-Part_B.pdf, which contains both parts.

The author (unidentified in the text) also points me to a thread right here:

Consult this StackOverflow answer, which is what the script is based on.

I consulted the thread many times but I can't make sense of this inside windows. Looks like some solutions pointed out there are for Linux but I am not sure. Sorry if I need too much info but I couldn't find it anywhere. I found ways to separate pdf outputs for windows but they're all very complex and seem pointless since the template was already supposed to solve that problem.

I'm compiling with pdfLaTeX + bibtex + pdfLaTeX (apparently, from TeXStudio's menus).

  • 1
    Welcome to TeX.sx! According to the short link to tex.sx, the author might be u123456, who isn’t too active here, though.
    – doncherry
    Commented Aug 29, 2016 at 19:36
  • 1
    i think you're not supposed to compile from TeXStudio with pdfLaTeX + bibtex + pdfLaTeX . Usage Instructions To compile the pdf, type on the command line in the project directory.
    – touhami
    Commented Aug 29, 2016 at 19:53
  • @doncherry Thanks for the info and edit! Maybe someone else can help? To touhami: Yes, I got that much. The problem is that I am in windows and there is no Linux command line here. I can add it as an extra command (they call it user commands on TeXStudio)?
    – Bontempo
    Commented Aug 30, 2016 at 11:36
  • @E.Bontempo I just pinged that user, perhaps they will stop by here. Otherwise, here’s what I would recommend: Make copies (think of them as "trash" copies) of your files, perhaps in a different folder, and reduce them as much as possible so that you get a minimal working example (MWE) (Do check out that link!), beginning with \documentclass{...} and ending with \end{document}, not including anything in between that isn't necessary to reproduce ...
    – doncherry
    Commented Aug 30, 2016 at 16:31
  • ... the undesired behavior – in your case, that would be more or less just keeping the dependencies between the three tex files. Then, edit your question to include the code of these three files. This way, the users here can help to figure out the necessary compilation steps or to find a helpful tool like latexmk or arara. Now that I think of it, you could also just try running latexmk on the main file, that should be somewhere in TeXstudio’s Tools menu. But you might need to install Perl to use latexmk. All this might take you a while, but it’s necessary for us to know what you need.
    – doncherry
    Commented Aug 30, 2016 at 16:33

1 Answer 1


Indeed, @touhami is correct. The intention is to use the build script (which has now been replaced with a makefile) on the command line when you want to produce the documents separately. I would recommend using the makefile, because compiling the documents separately in an ide (e.g., TexStudio) might be quite cumbersome.


As you probably know, the requirements for the Marie Curie IF proposals is that one coherent document is produced, but that it is split into two pdfs. The trick used in this template to compile the proposal into two separate documents with correct cross-references between them is to use a flag with pdflatex:

--jobname=document1 "\includeonly{doc1}\input{IF-2016-Part_B}"

This tells the pdflatex compiler to only include the content of doc1.tex (and similarly for doc2.tex). If the full document, IF-2016-Part_B.tex has been compiled more recently than either of the individual documents, then the auxilliary file used by the compiler (IF-2016-Part_b.aux) will contain all the references throughout the combined document. Therefore, if you fully compile IF-2016-Part_b.pdf prior to either of the documents individually, you retain correct page numbers and cross-references between document1.pdf and document2.pdf.

Compiling within an IDE

The makefile does these repeated compilations on your behalf. Within the IDE, you will probably need to manually add and remove the --jobname... flag, first compiling without the flag (so that the cross-references are correct), then compiling with the flag (to produce an individual document).

In TexShop, this is done on the Engine submenu of the preferences. You can add the --jobname... flag to the end of the pdflatex command. (Probably, TexStudio is quite similar?)

Suggested Workflow

If using an IDE, the workflow that I would recommend would be to compile normally within the IDE while you work on writing the proposal and to produce the separate documents only occasionally to ensure that they can be produced correctly (either with the makefile or by manually adding and removing the pdflatex flag to your compile engine in your IDE preferences).

You must log in to answer this question.

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