# How to detect whether “I'm on arXiv.org”?

I write a class. I'm interested in having a different page headers (and eventually make some other small differences) based on whether the class is used on the site arXiv.org or not. Minimal example follows:

myclass.cls

\ProvidesClass{myclass}[2013/02/27]

\date{}

\RequirePackage{fancyhdr}
\fancyhf{}
\fancyfoot[C]{\thepage}

%\ifABC
%\fi

\pagestyle{fancy}

\endinput


testarticle.tex

\documentclass{myclass}

\title{Just an Article}
\author{Me the First}

\usepackage{lipsum}

\begin{document}

\maketitle

\lipsum[1-8]

\end{document}


In the file myclass.cls, the if conditional (disabled in MWE) should detect whether "arXiv or not". Since the class file will be used by many people I don't know, solution as bullet-proof as possible is welcomed, as well as just ideas that might need further development to work. My first idea was to detect at the beginning whether the package hyperref is loaded before the classfile is processed (since it's always loaded on arXiv), but it doesn't seem to work.

-
I'm not quite sure what you can use to detect what system things are being run on unless you know that there is some testable information set by the platform. Presumably that requires insight into the arXiv set up, which we can't really offer. –  Joseph Wright Feb 27 '13 at 9:09
\ifx\tikzversion\reallyreallyoutdated \arxivtrue \else \arxivfalse \fi –  Andrew Stacey Feb 27 '13 at 9:10
@JosephWright arXiv does crazy things to the articles: disregards a4paper option sometimes, activates hyperref by default, adds the arXiv stamp on the first page etc. Some of them must be possible to detect. I'll look into it during the weekend if I don't get an answer here inbetween. –  tohecz Feb 27 '13 at 23:10
The arXiv uses AutoTeX to process the files. You might check the documentation/source to see if it defines any macros you can use to check. –  mforbes Mar 27 '13 at 5:59
@tohecz How do you test? Apart from days where I submit articles (with a frequency counted in tens of nanohertz), I don't see when I could. –  Bruno Le Floch May 19 '13 at 1:38
show 1 more comment

Without an explicit flag being set by the 'host' platform, there is no general way of detecting that a .tex file is being processed by a particular publisher's system. Thus without knowledge of the arXiv system, and probably contacts, there is no way to achieve this detection.