1

It seems that arXiv does not compile enough times my document (at some points it stops, saying that it reached the maximum number of tries). As a consequence, some parts of my document does not look nice (while if I compile with latexmk on my side, it works as expected).

I tried to add a main.aux file, but arXiv automatically removes my file. I also tried to create a file main_backup.aux containing a copy of main.aux (this one is not removed), and instead I added right before \begin{document}:

\IfFileExists{main_backup.aux}{
  \message{We saw a default backup.aux file, let's use it instead of the main aux file.}
  \nofiles % Disable default aux file
  \makeatletter
  \input{main_backup.aux}
  \makeatother
}{}

However this has two issues:

  1. locally, it compiles without errors, and my documents looks better… except for the table of content that is empty now!
  2. on the arxiv, it fails with an error right after loading the aux file:
We saw a default backup.aux file, let's use it instead of the main aux file.
No auxiliary output files.

(./main_backup.aux

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.23 \abx@aux@cite{0}{K il88_FoundingCrytpographyOblivious} ? ! Emergency stop. ...

l.23 \abx@aux@cite{0}{K il88_FoundingCrytpographyOblivious} No pages of output. Transcript written on main.log.

[verbose]: latex 'main.tex' failed. [verbose]: TEXMFCNF is unset.

Note that this errors seems to arrive on this line of my aux file:

\@writefile{toc}{\authcount {1}}
\abx@aux@cite{0}{Kil88_FoundingCrytpographyOblivious}

which mentions again table of content… so both of my issues might be related.

EDIT I also tried:

\IfFileExists{main_backup.aux}{
  \message{We saw a default backup.aux file, let's use it instead of the main aux file.}
  \makeatletter
  \usepackage{etoolbox}
  %% Try to patch the command given in
  %% https://tex.stackexchange.com/questions/285798/how-and-when-is-the-aux-file-read-and-processed
  % \regexpatchcmd{\enddocument}{\@@input\jobname.aux}{\@@input{main_backup.aux}}
  \patchcmd{\enddocument}{\@@input\jobname.aux}{\@@input{main_backup.aux}}{}{}
  %\input{main_backup.aux}
  \makeatother
}{}

but seems like the patch is not working.

EDIT

I also tried:

%%%% Really dirty trick because arxiv does not compile enough the document, so we need our own aux file:
\IfFileExists{main_backup.aux}{
  \IfFileExists{main.aux}{}{
    \message{We saw a default backup.aux file, let's use it instead of the main aux file.}
    \makeatletter
    \input{main_backup.aux}
    \makeatother
  }
}{}

\begin{document} ...

This work locally indeed, but not on the arxiv server, it fails again with this annoying, same error…

tobiasBora
  • 8,684
  • 1
    save the final aux file toxxx.tex and \input it before \begin{document} – David Carlisle Mar 02 '23 at 20:41
  • 1
    but the error looks like you have a line break in the aux file after K, how did that happen? – David Carlisle Mar 02 '23 at 20:44
  • 1
    is there a linebreak in your backup_aux? \IfFileExists{main_backup.aux}{ is the wrong test, the file will always be there, you should test for main.aux and just input the saved file if the aux is not there – David Carlisle Mar 02 '23 at 20:46
  • you will get no toc as you have used \nofiles that stops all file writing not just .aux – David Carlisle Mar 02 '23 at 21:10
  • Are the problems tied to biblatex or more widespread? – Dai Bowen Mar 02 '23 at 22:27
  • @DavidCarlisle Do you mean the .tex extension could bring anything new compared to .aux, as I'm already doing the exact same thing you propose with just a different extension. Also, I guess in any case this would not bring the toc back, any idea how to disable \nofiles only for the main .aux file? But no I have no line break, the content of the file at the line is the one I copy/pasted. – tobiasBora Mar 02 '23 at 23:14
  • The \IfFileExists{main_backup.aux} is because I don't want to locally use this later as this is meant only for the arxiv (I have a makefile that adds the main_backup.aux file only in the arxiv .zip file). But for my tests I also tried to disable the it and the issue is the same. – tobiasBora Mar 02 '23 at 23:14
  • @DaiBowen Hum, hard to say… Do you mean I should try to disable biblatex to see if other packages also produce this error? – tobiasBora Mar 02 '23 at 23:15
  • 2
    do not use \nofiles just use your backup file if there is no aux file so the first run picks up saved data and acts like a final run, after that you can use the aux file as normal. the error you show with il88_FoundingCrytpographyOblivious} flush left is really odd, I would have expected it indented past the K – David Carlisle Mar 02 '23 at 23:26
  • @DavidCarlisle I tried your solution, and indeed it seems to work locally (I also tried to patch the \enddocument, but the patch seems ineffective). However, the error on the arxiv is still, again, the same… – tobiasBora Mar 02 '23 at 23:57
  • Oh, I might have an idea why it's failing: I'm using LaTeX 2022 locally, and arxiv has LaTeX 2020. If I use overleaf 2020, I can reproduce a very similar error… so maybe bibtex changed significantly enough between 2020 and now to make aux files from now uncompatible with older aux files… I'll try to see if somehow I can get a valid aux file from 2020. – tobiasBora Mar 03 '23 at 00:09
  • overleaf has a 2020 option if you don't have it locally – David Carlisle Mar 03 '23 at 00:22
  • Yeah, it's what I just tried… but no idea why, the compilation times out, even with the 2022 version. I'll try to install it locally tomorrow I guess… – tobiasBora Mar 03 '23 at 00:24
  • @tobiasBora Largely speculation given the error was on a biblatex macro, but biblatex and biber versions are closely tied, so the biblatex bbl generated from a certain TeX Live version is not easily transferred to a different TeX Live edition. As arXiv requires you to upload the .bbl it has been quite difficult to match local and arXiv versions to get a suitable .bbl in the past. It may be worth checking if using the bbl from Overleaf's 2020 TL without trying to supply any aux files resolves your original issue. – Dai Bowen Mar 03 '23 at 00:50
  • It may be necessary to explicitly tell Overleaf to recompile from scratch when changing TeX Live versions – Dai Bowen Mar 03 '23 at 00:51

2 Answers2

1

You can reproduce with

\documentclass{article}
\usepackage{biblatex}
\makeatletter
\@writefile{toc}{\authcount {1}}
\abx@aux@cite{0}{Kil88_FoundingCrytpographyOblivious}

\begin{document} x \end{document}

which runs without error in texlive 2022 and 2023 but in 2020 gives

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ...

l.5 \abx@aux@cite{0}{K il88_FoundingCrytpographyOblivious} ?

Note this is not the format you showed as the il88 is indented past the K but I suspect it is the error you got. (I could not think of any way to get the error you showed.)

The old version of \abx@aux@cite only had one argument so it looks like you can simply edit your saved file to delete the first numeric argument, it should be close enough for a first run, the second run will pick up a real 2020 aux.

\documentclass{article}
\usepackage{biblatex}
\makeatletter
\@writefile{toc}{\authcount {1}}
\abx@aux@cite{Kil88_FoundingCrytpographyOblivious}

\begin{document} x \end{document}

runs without error in 2020; in 2023 it gives

Runaway argument?
! Paragraph ended before \abx@aux@cite was complete.
<to be read again> 
                   \par 
l.6

?

David Carlisle
  • 757,742
  • Thanks a lot. So I actually went all the way to download 2020 locally, to create a true aux file. It works locally, again… (but with 2020 this time) and does not produce any error on the arxiv server… but it does not fix my issues, it still tries to compile many times, and my document is still poorly formatted… – tobiasBora Mar 03 '23 at 01:09
  • I'll accept meanwhile this answer, but if you have ideas on what the arxiv is doing in a so strange way, please let me know. (maybe it adds other stuff, e.g. to add the timestamp on the first page?) – tobiasBora Mar 03 '23 at 01:10
  • Ok, in fact the issue seems to be unrelated with the number of compilations, but in fact it seems to be an issue with tikzpagenodes, but that fires only in specific conditions that I need to clarify. Anyway, thanks a lot! – tobiasBora Mar 03 '23 at 01:31
  • Ok, so in fact the issue seems to be different, and linked to tikzpagenodes… I created another question here https://tex.stackexchange.com/questions/678421/tikzpagenodes-gives-bad-output-on-the-arxiv – tobiasBora Mar 06 '23 at 09:50
1

Ok, after digging more, the issue was that arXiv uses a tool called autotex that does not handle some kinds of dynamic pictures when using the DVI output (even if in my tests, DVI was working fine locally, the issue seems to be autotex), so tikz's pictures can go wrong. By putting:

\pdfoutput=1

on the very first line, you force arXiv to compile to a pdf. Putting a4paper in the class might also prevent arXiv from trying to play with the geometry.

If for some reasons you can't make it work even with the above text, the simpler might be to directly submit a PDF, with the following to hide the fact that the pdf is produced by LaTeX (otherwise arXiv will not let you submit the pdf):

\usepackage{hyperref}
% Hide to arXiv that this pdf is produced by LaTeX:
\pdfsuppressptexinfo=-1 
\hypersetup{
  pdfproducer={},
  pdfcreator={},
}
tobiasBora
  • 8,684