I was writing a scientific manuscript, and the journal did not want the supplement displayed with the main article. However, I needed the supplement to be processed concurrently in order to get the cross references to supplemental figures. I had trouble finding a solution to this problem, but eventually found this question and answer on tex.stachexchange.
This solved the problem, but was not automated. Thus I created a
Makefile with some sed
calls to automate it. Run make
to build the
document.
In my experience, the online submission systems for academic journals are cumbersome. Thus they won't be able to run this Makefile on their servers. I uploaded the two .aux files created with this Makefile, and the system was able to build the document with the cross-references included. Please leave a comment below if this also works for you!
The example tex file is minimal. For example, if you are managing your
references with BibTeX, you will need to add a call to bibtex
and an
additional call to pdflatex
to the Makefile rule.
This is hacky and won't work for everything. For example, if your template has page numbers, the total number of pages listed will be the number of pages in the main article plus the supplement, even though the document produced in the end only contains the pages in the main article.
The code in main.tex is from egreg and newbie and is licensed under the CC BY-SA 3.0 (according to the StackExchange rules).
The Makefile is in the public domain (CC0). Please use and modify it as needed. No need for attribution.
Please feel free to leave a comment below. Unfortunately GitHub will not notify me if you do so, so if you'd like a response, please contact me by email.