10

After extensive discussion with Barbara Beeton in the chat room, and later with David Carlisle in the same place, I was recommended by both to write my question here; it has just taken some hours to strip everything down to as minimal of a working example as possible, and still get the problem reproduced by arXiv's mysterious TeX environment.

As suggested here by Tom Hejda (who works for Overleaf), I have selected to use TeX Live 2017 with Overleaf so that it emulates arXiv's environment as closely as possible. In Overleaf my MWE (minimal working example) leads to a 3-line bibliographic entry that wraps around such that the first two lines are perfectly right-justified:

The same MWE compiles in arXiv with no errors but the right-justification is not as nice:
enter image description here

Both PDFs were generated using the following MWE code:

\documentclass[amsmath,amssymb,aps,twocolumn]{revtex4-1}
\listfiles
\begin{document}
    \cite{Daday2012}
%\input{main.bbl}
    
\begin{thebibliography}{48}
\makeatletter
\providecommand \bibnamefont  [1]{#1}%
\providecommand \bibfnamefont [1]{#1}%
\providecommand \citenamefont [1]{#1}%
\let\auto@bib@innerbib\@empty

\bibitem [{\citenamefont {Daday}\ \emph {et~al.}(2012)\citenamefont {Daday},
  \citenamefont {Smart}, \citenamefont {Booth}, \citenamefont {Alavi},\ and\
  \citenamefont {Filippi}}]{Daday2012}%
  \BibitemOpen
  \bibfield  {author} {\bibinfo {author} {\bibfnamefont {C.}~\bibnamefont
  {Daday}}, \bibinfo {author} {\bibfnamefont {S.}~\bibnamefont {Smart}},
  \bibinfo {author} {\bibfnamefont {G.~H.}\ \bibnamefont {Booth}}, \bibinfo
  {author} {\bibfnamefont {A.}~\bibnamefont {Alavi}}, \ and\ \bibinfo {author}
  {\bibfnamefont {C.}~\bibnamefont {Filippi}},\ }\href {\doibase
  10.1021/ct300486d} {\bibfield  {journal} {\bibinfo  {journal} {Journal of
  {C}hemical {T}heory and {C}omputation}\ }\textbf {\bibinfo {volume} {8}},\
  \bibinfo {pages} {4441} (\bibinfo {year} {2012})}\BibitemShut {NoStop}
\end{thebibliography}
    
\end{document}

I used \listfiles to confirm that arXiv's environment has almost identical packages when compared to Overleaf. For Overleaf we have:

  *File List* 
 revtex4-1.cls    2010/07/25/20:33:00 4.1r (http://publish.aps.org/revtex4/ for  documentation)   
 aps4-1.rtx
 aps10pt4-1.rtx 
 textcase.sty    2004/10/07 v0.07   Text only upper/lower case changing (DPC)  
 amssymb.sty     2013/01/14 v3.01   AMS font symbols
 amsfonts.sty    2013/01/14 v3.01   Basic AMSFonts support  
 amsmath.sty     2016/11/05 v2.16a  AMS math features  
 amstext.sty     2000/06/29 v2.01   AMS text   
 amsgen.sty      1999/11/30 v2.0    generic functions  
 amsbsy.sty      1999/11/29 v1.2d   Bold Symbols   
 amsopn.sty      2016/03/08 v2.02   operator names
 url.sty         2013/09/16 ver 3.4 Verb mode for urls, etc.   
 natbib.sty      2010/09/13 8.31b   (PWD, AO) 
 revsymb4-1.sty  2010/07/25/20:33:00 4.1r (http://publish.aps.org/revtex4/ for documentation)  
 ***********

For arXiv we have identical packages, except for amsmath.sty for which Overleaf is 5 months newer, but this makes no difference because with TeX Live 2015 on my own laptop, I got exactly the same result as with Overleaf despite having an amsmath.sty that's 3 months older than arXiv's. Here's arXiv's packages:

 *File List*
revtex4-1.cls  2010/07/25/20:33:00 4.1r (http://publish.aps.org/revtex4/ for documentation)
aps4-1.rtx
aps10pt4-1.rtx
textcase.sty   2004/10/07 v0.07    Text only upper/lower case changing (DPC)
amssymb.sty    2013/01/14 v3.01    AMS font symbols
amsfonts.sty   2013/01/14 v3.01    Basic AMSFonts support
amsmath.sty    2016/06/28 v2.15d   AMS math features
amstext.sty    2000/06/29 v2.01    AMS text
amsgen.sty     1999/11/30 v2.0     generic functions
amsbsy.sty     1999/11/29 v1.2d    Bold Symbols
amsopn.sty     2016/03/08 v2.02    operator names
url.sty        2013/09/16 ver 3.4  Verb mode for urls, etc.
natbib.sty     2010/09/13 8.31b    (PWD, AO)
revsymb4-1.sty 2010/07/25/20:33:00 4.1r (http://publish.aps.org/revtex4/ for documentation)

Unfortunately arXiv also has all these, which weren't listed by Overleaf's compiler, nor my own local one:

hyperref.sty        2016/06/24 v6.83q Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14  Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty  2016/05/16 v1.14  Bundle oberdiek, subset generic (HO)
hobsub.sty          2016/05/16 v1.14  Construct package bundles (HO)
infwarerr.sty       2016/05/16 v1.4   Providing info/warning/error messages (HO)
ltxcmds.sty         2016/05/16 v1.23  LaTeX kernel commands for general use (HO)
ifluatex.sty        2016/05/16 v1.4   Provides the ifluatex switch (HO)
ifvtex.sty          2016/05/16 v1.6   Detect VTeX and its facilities (HO)
intcalc.sty         2016/05/16 v1.2   Expandable calculations with integers (HO)
ifpdf.sty           2016/05/14 v3.1   Provides the ifpdf switch
etexcmds.sty        2016/05/16 v1.6   Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty       2016/05/16 v1.17  Key value parser (HO)
kvdefinekeys.sty    2016/05/16 v1.4   Define keys (HO)
pdftexcmds.sty      2016/05/21 v0.22  Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty       2016/05/16 v1.14  Implements pdfTeX's escape features (HO)
bigintcalc.sty      2016/05/16 v1.4   Expandable calculations on big integers (HO)
bitset.sty          2016/05/16 v1.2   Handle bit-vector datatype (HO)
uniquecounter.sty   2016/05/16 v1.3   Provide unlimited unique counter (HO)
letltxmacro.sty     2016/05/16 v1.5   Let assignment for LaTeX macros (HO)
hopatch.sty         2016/05/16 v1.3   Wrapper for package hooks (HO)
xcolor-patch.sty    2016/05/16        xcolor patch
atveryend.sty       2016/05/16 v1.9   Hooks at the very end of document (HO)
atbegshi.sty        2016/06/09 v1.18  At begin shipout hook (HO)
refcount.sty        2016/05/16 v3.5   Data extraction from label references (HO)
hycolor.sty         2016/05/16 v1.8   Color options for hyperref/bookmark (HO)
keyval.sty          2014/10/28 v1.15  key=value parser (DPC)
ifxetex.sty         2010/09/12 v0.6   Provides ifxetex conditional
auxhook.sty         2016/05/16 v1.4   Hooks for auxiliary files (HO)
kvoptions.sty       2016/05/16 v3.12  Key value format for package options (HO)
pd1enc.def          2016/06/24 v6.83q Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg        2009/12/28 v1.0   hyperref configuration at arXiv.org
hdvips.def          2016/06/24 v6.83q Hyperref driver for dvips
pdfmark.def         2016/06/24 v6.83q Hyperref definitions for pdfmark specials
rerunfilecheck.sty  2016/05/16 v1.8   Rerun checks for auxiliary files (HO)
nameref.sty         2016/05/21 v2.44  Cross-referencing by name of section
gettitlestring.sty  2016/05/16 v1.5   Cleanup title references (HO)

There's related questions on TeX.SE:

But these don't solve this problem, because those questions deal with long URLs, or long quotes, long strings, or equations not being hyphonated to achieve right-justification; but in my case there is no URL and no quote, and not even any hyphonation needed!

There might be a solution using the package fancyvrb:

But it wouldn't explain why arXiv is unable to do what Overleaf and my local laptop can do.

While this question is interesting:

It is for the case where the Overleaf bbl file is causing errors in arXiv, whereas in my case there's no errors!

While the above two screenshots appear as if the arXiv version isn't very different, that is only the result after hours of stripping things down to a MWE. In the original version you can see why I (badly) want to fix the arXiv version:

Overleaf, and my local laptop:

https://i.stack.imgur.com/ol6xW.png

arXiv:

https://i.stack.imgur.com/7SZkU.png

arXiv adds hyperref without telling the user:

And by turning it off using a 00README.XXX file with nohypertex in it, the arXiv PDF looks the same as the Overleaf and local PDFs, but then my publication's citations wouldn't be reachable by clicking on their corresponding numbers in the main text. Is there a way to do get right-justification in the bibliography in revtex4.1 with arXiv, without turning off hyperref?

10
  • Definitely odd. Perhaps overly simplistic, but maybe worth a shot: Have you tried to typeset from your local tex build and then upload those files, rather than uploading the files made by Overleaf? Perhaps Overleaf is adding something odd in this case that arxiv doesn't like but both Overleaf and your local tex build are fine with, but that your local build won't add (or remove). Jun 24, 2020 at 1:54
  • Also, the last time I uploaded to arxiv, I did not use "\input{main.bbl}" in the tex file at all, but just uploaded the .bbl file generated by TexStudio in parallel with the bib and tex files, and it worked (on the APS submission server too). Could this work? Again, this is simplistic compared to other things you have tried, but who knows... Beyond that, I don't think I will be much help, though... Jun 24, 2020 at 1:56
  • @2ndQuantized In my question I mentioned that this MWE compiles the same on my local installation as on Overleaf. It was made by myself (not by Overleaf .. Overleaf was just used to create an environment as close to arXiv as possible). Also, you might notice that I have \input{main.bbl} commented in my code, so I didn't use it either! Jun 24, 2020 at 2:17
  • Does adding hyperref (and the other packages) to your MWE reproduce the bug on Overleaf?
    – Davislor
    Jun 24, 2020 at 2:35
  • @user1271772 What I mean is that the bbl file generated by overleaf may be different from the bbl file generated by your local build in some small hard to find way, even with the same tex file (the MWE you give). (You could always try diff on the two bbl files to see if they are different.) Since arxiv would use the bbl file you upload, that could be enough for arxiv to change what it does, even if your local build and overleaf seem not to care about the change. It may not work, but it is a simple try. Jun 24, 2020 at 2:36

1 Answer 1

5

This happens if you compile on the latex + dvips route: With this driver hyperref put the links by default in a box.

If you can't switch to a compilation with pdflatex, add the breakurl package:

\usepackage{hyperref}
\usepackage{breakurl}
5
  • 1
    you should also (I think?) be able to tell arxiv to use pdflatex ? Jun 24, 2020 at 9:41
  • @DavidCarlisle that would be the alternative, but I have no idea if you can. Jun 24, 2020 at 9:50
  • sure was mostly a comment for the OP. Jun 24, 2020 at 9:51
  • @DavidCarlisle I added an edit for this option. That is then clearer. Jun 24, 2020 at 9:55
  • 3
    One should be able to choose pdflatex on arxiv upload, arxiv.org/help/submit_tex
    – daleif
    Jun 24, 2020 at 10:18

You must log in to answer this question.

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