# Redefining AASTeX 6.1's \mag breaks LaTeX on arXiv, and Using it Breaks LaTeX Overall

I'm trying to submit a series of articles to arXiv using the AASTeX 6.1 template. I'm running into an error that the arXiv support staff says the relevant part of is:

(/texlive/2016/texmf-dist/tex/latex/amscls/amsthm.sty) No file blah.aux. ! Missing number, treated as zero. $l.140 \begin{document} ? ! Emergency stop. The test file I cooked up is short enough to place here:  \documentclass[twocolumn]{aastex61} \usepackage{amsmath,amsthm,amssymb} \protected\def\micron{\ifmmode \,\operatorname{\mu m}\else$\operatorname{\mu m}$\fi} \protected\def\mag{\ifmmode \,\operatorname{mag}\else$\operatorname{mag}$\fi} \shorttitle{Scam Yourself} \shortauthors{Dobbs} \begin{document} \title{Pull the Wool Over Your Own Eyes} \author{J.~R.~Dobbs} \affiliation{Church of the SubGenius} \correspondingauthor{J.~R.~Dobbs} \email{BobDobbs@fake.email.fake.com.com.org} \begin{abstract} Slack shall set you free! \end{abstract} \keywords{religion,slack} \section{Introduction} Praise Bob, and pass the slack! 5 \micron,$5\micron$6 \mag,$6\mag$\end{document} The vexing problem is that this LaTeX file compiles fine on my computer, using the same version of TeXLive as arXiv (2016), but produces that cryptic error on arXiv. Replacing the \def with \renewcommand doesn't work. The arXiv support staff has even told me that removing the \usepackage and custom \def lines also leads to the problem. How is this fixed? I definitely want to overwrite the \micron and \mag commands provided by AASTeX, among others. For the ones I don't need to overwrite, I use \DeclareMathOperator, and that doesn't cause problems. I'm asking this here to provide the people at arXiv and AAS a forum to work on this, or to allow some outside TeX guru that already knows a clever solution the chance to chime in. Edit: here is the full relevant section of the arXiv log: [verbose]: This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./blah.tex LaTeX2e <2016/03/31> patch level 3 Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. (./aastex61.cls Document Class: aastex61 2016/04/16 Version 6.1/AAS markup document class (/texlive/2016/texmf-arxiv/tex/latex/revtex/revtex4-1.cls Document Class: revtex4-1 2010/07/25/20:33:00 4.1r (http://publish.aps.org/revt ex4/ for documentation) ltxutil[2010/07/25/20:33:00 4.1r utilities package (portions licensed from W. E . Baxter web at superscript.com)] ltxfront[2010/07/25/20:33:00 4.1r frontmatter package (AO,DPC)] ltxgrid[2010/07/25/20:33:00 4.1r page grid package (portions licensed from W. E . Baxter web at superscript.com)] (/texlive/2016/texmf-arxiv/tex/latex/revtex/aps4-1.rtx) (/texlive/2016/texmf-arxiv/tex/latex/revtex/aps10pt4-1.rtx) (/texlive/2016/texmf-dist/tex/latex/textcase/textcase.sty) (/texlive/2016/texmf-dist/tex/latex/url/url.sty) (/texlive/2016/texmf-local/tex/latex/natbib/natbib.sty This is natbib version 8.31 !!WARNING!! !!WARNING!! !!WARNING!! !!WARNING!! This version (v8.31) of natbib is stricter in its formatting requirements for bibitem entries than the previous version used at arXiv (v7.1). If your submission encounters a problem see http://arXiv.org/help/faq/texlive and the natbib documentation at http://www.ctan.org/tex-archive/macros/latex/contrib/natbib/ for explanation and adjust your submission accordingly. The arXiv team. ) (/texlive/2016/texmf-arxiv/tex/latex/revtex/revsymb4-1.sty)) (/texlive/2016/texmf-dist/tex/latex/base/latexsym.sty) (/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty (/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty) (/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty (/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty) (/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/texlive/2016/texmf-dist/tex/latex/graphics-def/dvips.def))) (/texlive/2016/texmf-dist/tex/latex/amsfonts/amssymb.sty (/texlive/2016/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/texlive/2016/texmf-dist/tex/generic/epsf/epsf.sty This is epsf.tex' v2.7.4 <14 February 2011> ) (/texlive/2016/texmf-dist/tex/latex/tools/longtable.sty) (/texlive/2016/texmf-dist/tex/latex/xcolor/xcolor.sty (/texlive/2016/texmf-dist/tex/latex/graphics-cfg/color.cfg)) (/texlive/2016/texmf-dist/tex/latex/hyperref/hyperref.sty (/texlive/2016/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/texlive/2016/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/texlive/2016/texmf-dist/tex/generic/ifxetex/ifxetex.sty) (/texlive/2016/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty) (/texlive/2016/texmf-dist/tex/latex/hyperref/pd1enc.def) (/texlive/2016/texmf-config/tex/latex/latexconfig/hyperref.cfg)) Package hyperref Message: Driver (default): hdvips. (/texlive/2016/texmf-dist/tex/latex/hyperref/hdvips.def (/texlive/2016/texmf-dist/tex/latex/hyperref/pdfmark.def (/texlive/2016/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))) (/texlive/2016/texmf-dist/tex/latex/tools/array.sty) (/texlive/2016/texmf-dist/tex/generic/ulem/ulem.sty)) (/texlive/2016/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the ?' option. (/texlive/2016/texmf-dist/tex/latex/amsmath/amstext.sty (/texlive/2016/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/texlive/2016/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/texlive/2016/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/texlive/2016/texmf-dist/tex/latex/amscls/amsthm.sty) No file blah.aux. ! Missing number, treated as zero.$
l.140 \begin{document}

?
! Emergency stop.

$l.140 \begin{document} No pages of output. Transcript written on blah.log. and the entire log from the same level of compile from my computer: This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./blah.tex LaTeX2e <2016/03/31> Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. (./aastex61.cls Document Class: aastex61 2016/04/16 Version 6.1/AAS markup document class (/usr/local/texlive/2016/texmf-dist/tex/latex/revtex/revtex4-1.cls Document Class: revtex4-1 2010/07/25/20:33:00 4.1r (http://publish.aps.org/revt ex4/ for documentation) ltxutil[2010/07/25/20:33:00 4.1r utilities package (portions licensed from W. E . Baxter web at superscript.com)] ltxfront[2010/07/25/20:33:00 4.1r frontmatter package (AO,DPC)] ltxgrid[2010/07/25/20:33:00 4.1r page grid package (portions licensed from W. E . Baxter web at superscript.com)] (/usr/local/texlive/2016/texmf-dist/tex/latex/revtex/aps4-1.rtx) (/usr/local/texlive/2016/texmf-dist/tex/latex/revtex/aps10pt4-1.rtx) (/usr/local/texlive/2016/texmf-dist/tex/latex/textcase/textcase.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/url/url.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/natbib/natbib.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/revtex/revsymb4-1.sty)) (/usr/local/texlive/2016/texmf-dist/tex/latex/base/latexsym.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/local/texlive/2016/texmf-dist/tex/latex/pdftex-def/pdftex.def (/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))) (/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/local/texlive/2016/texmf-dist/tex/generic/epsf/epsf.sty This is epsf.tex' v2.7.4 <14 February 2011> ) (/usr/local/texlive/2016/texmf-dist/tex/latex/tools/longtable.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/local/texlive/2016/texmf-dist/tex/latex/graphics-cfg/color.cfg)) (/usr/local/texlive/2016/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/local/texlive/2016/texmf-dist/tex/generic/ifxetex/ifxetex.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/local/texlive/2016/texmf-dist/tex/latex/latexconfig/hyperref.cfg)) Package hyperref Message: Driver (autodetected): hpdftex. (/usr/local/texlive/2016/texmf-dist/tex/latex/hyperref/hpdftex.def (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/local/texlive/2016/texmf-dist/tex/latex/tools/array.sty) (/usr/local/texlive/2016/texmf-dist/tex/generic/ulem/ulem.sty)) (/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the ?' option. (/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2016/texmf-dist/tex/latex/amscls/amsthm.sty) No file blah.aux. (/usr/local/texlive/2016/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty (/usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/grfext.sty) (/usr/local/texlive/2016/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)) (/usr/local/texlive/2016/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2016/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (/usr/local/texlive/2016/texmf-dist/tex/latex/base/ulasy.fd) (/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2016/texmf-dist/tex/latex/amsfonts/umsb.fd) [1{/usr/local/t exlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2] (./blah.aux) LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right . ) < /usr/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on blah.pdf (2 pages, 97265 bytes). SyncTeX written on blah.synctex.gz. Transcript written on blah.log. Edit 2017-02-22: When I comment out the lines \usepackage{amsmath,amsthm,amssymb} \protected\def\micron{\ifmmode \,\operatorname{\mu m}\else$\operatorname{\mu m}$\fi} \protected\def\mag{\ifmmode \,\operatorname{mag}\else$\operatorname{mag}$\fi} I get a similar error on my machine:  ./blah.tex:160: Missing number, treated as zero. , l.160 6 \mag,$6\mag$? ./blah.tex:160: Missing number, treated as zero.$
l.160 6 \mag, $6\mag$

?
[2
./blah.tex:162: Incompatible magnification (0);
the previous value will be retained (1000).
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox
\fi \fi
l.162 \end{document}

Though, in this case, the document finishes compiling, it is just missing the magnitude units.

• I don't have the class, but the definitions you have made are fragile, you could use \protected\def (are you sure you want \, space before an operator? it already gets space by virtue of being an operator?) – David Carlisle Feb 22 '17 at 0:03
• It seems to need it. These are units, and there needs to be a small space between the number and the units. Try removing the \, and the needed space won't be there. Adding \protected before the \defs doesn't help. – Sean Lake Feb 22 '17 at 0:07
• comparing the two logs, you are running pdflatex, and arxiv, while using pdftex, is running simply "latex" which will produce a dvi file, and assumes postscript conventions, not pdf. the difference between the two logs where failure occurs is that yours reads .../context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] so the question i would ask is where that is triggered. looking backward in the log, i'd look at hpdftex.def. – barbara beeton Feb 22 '17 at 14:29
• @barbarabeeton arXiv uses latex by default, unless otherwise requested: arxiv.org/help/submit_tex#pdflatex – giordano Feb 22 '17 at 18:16
• the latest edit identifies the problem unambiguously: \mag is a tex primitive, and shouldn't be redefined. why this didn't appear in the logs you posted is beyond me, but if you rename your command to (say) \Mag it should stop having a problem. – barbara beeton Feb 22 '17 at 20:14

an edit made to the question on 2017-02-22 added information that made it possible to answer the question without guessing. the information consisted of these lines from a log file:

./blah.tex:160: Missing number, treated as zero.
,
l.160 6 \mag,
$6\mag$
?


\mag is a tex primitive (identified as such in the index of the texbook by being flagged with an asterisk). it indicates the amount of magnification to be applied to an object, and expects a number.

the problematic file contained this definition:

\protected\def\mag{\ifmmode \,\operatorname{mag}\else $\operatorname{mag}$\fi}


i'm not going to try to explain why the error at arxiv was triggered before \begin{document}, but once a full error message was provided from a log file, it became obvious that this was the cause of the failure.

it is never a good idea to redefine a primitive. and this is one reason why latex provides -- and strongly recommends the use of -- \newcommand, so that it will be immediately obvious that the particular command name is already in use. when that happens, it's time for some research ... what is the purpose of the command you have inadvertently tried to redefine. \def blithely wipes out whatever was there before, sometimes leading to mysteries like this one.