52

There are more and more papers which accept supplementary materials, as e.g. the Physical Review Letters: see their policy regarding supplementary materials. For them you can submit two different documents, say main.tex and supp.tex. I believe that preprint servers will display only one final document. At least it seems so for arXiv, see their policy regarding LaTeX submission. Let stick ourself with RevTeX and arXiv examples for the present purpose. The problems are that main.tex and supp.tex usually do not use the same layout and co. : two columns vs. one column, different abstracts, different bibliographies, ...

So I'm wondering about the best choice(s) for presenting our papers including supplementary materials on preprint servers. I'm well aware that it should depend on the nature of the supplementary materials (video, code, equations, ...). Here let us suppose the supplementary materials are some pure LaTeX document.

What is the the best option: including extra documents (with the difficulty to have a clear distinction between the main part and the supplementary part, especially the preamble of supp.tex is not displayed anymore, see How to include a document into another document?), or to abuse of appendix (with the problem that appendix is not a supplementary material) ?

So, in short: How to combine my main.tex and my supp.tex into a global paper.tex file in a clever way ?

1
  • 3
    The package combine is supposed to address exactly this sort of situation. I’ve never been able to get it to work satisfactorily (which is why I’m giving this as a comment not an answer) but it may be worth trying. Aug 9, 2018 at 17:39

5 Answers 5

32

Here I give a workable solution, but not a clever one. In whatever case, we have to make a third separate file for arXiv submission (say, with at least one line to include Supp.) unless they support supplementary directly.

Basically, the method is to append the supplementary material at the end of main text. Then add the commands to reset all counters and append the "S" for equations, figures, table and references. The resulting file would look like

enter image description here

The \pagebreak will put supplementary materials in the new page, but I don't know why it doesn't work here. The template codes are given below. Note the important codes is in the middle part. Also, please don't use same reference citation name, otherwise, there will be wrong numbering for citation.

\documentclass[twocolumn,superscriptaddress,floatfix,preprintnumbers]{revtex4}
\usepackage{graphics,amssymb,amsmath,epsfig,color}
\usepackage{graphicx}

\begin{document}

\title{Title for main text}
\author{You name here}
\affiliation{Somewhere}
\date{\today}
\begin{abstract}
Abstract...
\end{abstract}
\pacs{}
\maketitle


Paragraph 1. Main text here \cite{RefA}:
\begin{equation}
  E=mc^2
\end{equation}

Paragraph 2.

Paragraph 3 \cite{RefB}:
\begin{equation}
  S=k_B \ln(\Omega)
\end{equation}


\begin{thebibliography}{11}
\bibitem{RefA} A. Someone, C. Someone, D. Someone, Phys. Rev. Lett. {\bf 11}, 1111 (1911).
\bibitem{RefB} B. Someone, {\it et. al.}, Phys. Rev. Lett. {\bf 22}, 2222 (1922).
\end{thebibliography}




%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
\pagebreak
\widetext
\begin{center}
\textbf{\large Supplemental Materials: Title for main text}
\end{center}
%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
%%%%%%%%%% Prefix a "S" to all equations, figures, tables and reset the counter %%%%%%%%%%
\setcounter{equation}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{page}{1}
\makeatletter
\renewcommand{\theequation}{S\arabic{equation}}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\bibnumfmt}[1]{[S#1]}
\renewcommand{\citenumfont}[1]{S#1}
%%%%%%%%%% Prefix a "S" to all equations, figures, tables and reset the counter %%%%%%%%%%


\section{Section 1}
Copy and paste your Supplemental Materials text here \cite{S_RefA}, blah, blah, blah, blah, blah, blah, ...
\begin{equation}
  i\hbar\frac{\partial}{\partial t}\psi(x,t) = -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2}\psi(x,t) + V(x,t) \psi(x,t)
\end{equation}


\begin{thebibliography}{11}
\bibitem{S_RefA} A. Someone, C. Someone, D. Someone, Phys. Rev. Lett. {\bf 11}, 1111 (1911).
\end{thebibliography}


\end{document} 
5
  • I've come with exactly this issue, and your solution looks like a great one. Cheers! I will try to incorporate this into the next version of arXiv:1402.4596 and let you know how it turns out.
    – user60102
    Aug 2, 2014 at 19:22
  • 4
    This works great. Just one tweak to suggest: I prefer using \onecolumngrid and \twocolumngrid instead of widetext, thus eliminating the ugly (IMHO) horizontal lines
    – yohbs
    Mar 8, 2015 at 14:10
  • 1
    Is there any way to re-number sections as well (perhaps with a different style of numbering)?
    – Andrew Mao
    Apr 1, 2015 at 17:39
  • 10
    If both the main text and the supplementary materials use BibTeX and use the same .bib file, it's going to have some problems.
    – wdg
    Jun 19, 2016 at 13:24
  • how can I reset the table of contents in the supplement part?
    – n3rd
    Jul 16, 2018 at 23:22
19

If you upload two separate tex files, arXiv converts them to pdfs separately and then stitches the pdfs together to create a single file. All you have to pay attention to is that the files in the final product are ordered alphabetically, so to ensure that the supplemental material comes after the main text, you have to name them accordingly.

6
  • 1
    This answer seems to be the option that is recommended by arxiv, see arxiv.org/help/submit_tex. Jul 25, 2021 at 8:59
  • I uploaded both tex files, but arXiv compiled only the main text and ignored supplement. Any idea what might be the issue and how I can solve it? Aug 19, 2022 at 12:08
  • How do you deal with references from main-text to supplemental, and back? I usually use \externaldocument, but I'm not sure if ArXiv will like that?
    – a06e
    Apr 19 at 7:57
  • The same happened with me as with @NagabhushanSN. What happened afterwards? Did it still appear as Suppmat, clickable separately? May 3 at 6:54
  • I combined both the tex files into a single one. Check this May 3 at 17:17
7

The suggestion by hwlau works perfectly. A tweak to put the supplement on a new page is to replace:

%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
\pagebreak
\widetext

by

%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
\widetext
\clearpage

Note that \clearpage command with RevTex can sometimes lead to strange behaviour. For example see:

How to retain the double-column formatting of the previous page after \clearpage?

5

The suggested solution works great -- many thanks. For a table, however, one needs to add the line:

\renewcommand{\thetable}{S\arabic{table}}

Then it works completely well.

1
  • Welcome to TeX.SX.
    – Johannes_B
    Dec 12, 2019 at 4:57
4

Perfect solution! My solution to the section number:

\setcounter{section}{0}
\renewcommand{\thesection}{S-\Roman{section}}

You must log in to answer this question.

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