11

I would like to generate a paper using revtex4-1 while also appending a supplement pdf file to the paper with the help of pdfpages. If I use the preprint option, I find that the supplement superimposes on the main text unless I use a workaround for adding the supplement (in the minimal code below). However, with the reprint option (which produces a more concise version of the paper useful for arXiv), this workaround doesn't work and the first page of the supplement is superimposed with the last page of the paper.

  1. How can I generate a REVTeX 4.1 paper and pdfpages supplement using the reprint option without overlapping text?

  2. Are there other packages besides pdfpages that I can use? I have tried pasting the pdf as a figure (answered here), but that doesn't seem to work.

  3. Even with the preprint option, the code below appends a blank page to the document. Why is it there and how do I get rid of it? I suspect the REVTeX rules for title pages have something to do with the behavior.

Minimal code (requires a dummy file named revtex.pdf to be in the same directory; the 7 in 2-7 is the page length of the dummy file):

\documentclass[reprint]{revtex4-1}    %%% preprint/reprint option here
\usepackage{pdfpages}
\begin{document}
\title{Title}
\maketitle

Lorem ipsum dolor sit amet...

\newpage\newpage
\includepdf[pages={1,{},2-7}]{revtex} %%% A workaround for preprint option
%\includepdf[pages=-]{revtex}         %%% What should be the working command

\end{document}
  • Welcome to TeX.SX! Nice problem. I think that revtex4-1 tries hard to be as incompatible as possible with other packages. :( – egreg Feb 9 '15 at 23:43
  • Thanks for the workaround below! I emailed REVTeX: The REVTeX developers do not have any intention of supporting pdfpages at this time. We appreciate your understanding. – Victor V Albert Feb 11 '15 at 14:36
6

Actually, revtex4-1 seems to be incompatible with a lot of packages, including pdfpages. Here are two workarounds (one for each option) and both of them require the package pgffor.

Workaround when using the preprint option

\foreach \x in {1,...,7}
{%
\clearpage
\includepdf[pages={\x}]{revtex} 
}

MWE

\documentclass[preprint]{revtex4-1}    %%% preprint/reprint option here
\usepackage{pdfpages}
\usepackage{pgffor}
\begin{document}
\title{Title}
\maketitle

Lorem ipsum dolor sit amet...

\foreach \x in {1,...,7}
{%
\clearpage
\includepdf[pages={\x}]{revtex} 
}

\end{document} 

Workaround when using the reprint option

\foreach \x in {1,...,7}
{%
\clearpage
\includepdf[pages={\x,{}}]{revtex}
}

MWE

\documentclass[reprint]{revtex4-1}    %%% preprint/reprint option here
\usepackage{pdfpages}
\usepackage{pgffor}
\begin{document}
\title{Title}
\maketitle

Lorem ipsum dolor sit amet...

\foreach \x in {1,...,7}
{%
\clearpage
\includepdf[pages={\x,{}}]{revtex}
}

\end{document} 

If one wants to test it, just compile this file

revtex.tex

\documentclass{book}
\usepackage{blindtext}
\begin{document}
\blinddocument
\blinddocument
\end{document} 
2

A solution that sidesteps these issues (and TeX in general), but that might also remove the metadata from the pdf is to use some generic pdf toolkit like pdftk.

In the same directory as the two files to be concatenated run this command:

pdftk MAIN_FILE.pdf SUPPLEMENT.pdf cat output RESULTING_FILE.pdf

You will need the pdftk package which is available in most linux software repositories.

Regrettably this does not really answer the TeX question, but it might solve your problem (if you are doing it locally and not compiling on arXiv).

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.