Sometimes (in my field) a journal requires an anonymised version of the manuscript and a separate title page to be submitted. Other journals sometimes require other subsets of the overall document to be submitted separately. (For example for word count checking). Whilst, it isn't difficult to produce these different documents manually it is far from ideal to have to have separate tex files for each. Is there a way to automatically produce separate pdfs as needed?

N.B This is different to the question How can I get \maketitle to create a separate title page with the article class? which is about producing separate pages rather than separate documents.


This is not a LaTeX solution, but with pdftk this job is easy to do. Under Ubuntu you can combine pdflatex and pdftk cat like this:

pdflatex document.tex #Compiling the latex document
pdftk document.pdf cat 1 output titlepage.pdf #Cat first page of document to separate document
pdftk document.pdf cat 2-end output rest.pdf #Cat rest of document to another one

Using https://tex.stackexchange.com/a/29443/81639 maketitle gives a titlepage with \documentclass[titlepage]{article}.

  • This is very useful for the title page specifically. But, presumably it relies on knowing the page numbers in advance which is sometimes hard (if I want to omit the references for example) Jan 22 '20 at 22:11
  • @dothyphendot If you have already compiled your code, you can check the page numbers in the pdf file and modify the pdftk cat command appropriately.
    – bmv
    Jan 23 '20 at 8:37
  • This is very useful - I wondered if there was a way to do it programmatically but perhaps there isn’t Jan 23 '20 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.