TransWikia.com

Handling main text and supplementary information crossreferencing each other on arXiv

TeX - LaTeX Asked by user2653663 on May 1, 2021

A typical example when writing a paper is that you have a main document main.tex and a document containing supplementary information si.tex.
Both documents are stand-alone in the sense that they compile into separate documents with separate bibliographies, however one of or both document(s) may explicitly reference sections of the other.

This is often done by including something similar to

usepackage{xr}
newcommand*{myexternaldocument}[1]{%
    externaldocument{#1}%
    addFileDependency{#1.aux}%
}

myexternaldocument{si}

to main.tex and/or vice versa.

The problem arises from how arXiv processes your file submissions. All .tex files are compiled in alphabetical order, and each will have the corresponding .aux and .pdf files deleted beforehand. This order can be changed by renaming files or by specifying the toplevel file in 00README.XXX as described here. But the problem remains that arXiv deletes the .aux files corresponding to any .tex files that will be compiled. How is the best way to solve this?

One Answer

The simplest solution I've come up with that doesn't require changing anything in your .tex files is to compile your two documents yourself before uploading, then rename your two .tex files. Since arXiv only deletes .aux files that correspond to a .tex file, this effectively removes the cross-dependency between the files.

Say that both main.tex and si.tex reference each other. After compiling, validating that everything looks alright and renaming the .tex files you should be left with a set of temporary files as well as

main_renamed.tex
main.aux
si_renamed.tex
si.aux

Once upload on arXiv, main_renamed.tex will be compiled first and since si.aux are not deleted, the references should compile successfully. Afterwards si_renamed.tex will be compiled and since main.aux exists, the references should compile successfully. Since main_renamed.tex was compiled before si_renamed.tex, that is the order the text will appear in the final pdf document.

Answered by user2653663 on May 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP