Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:





\fancyhead[C]{arXiv version}





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






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.

share|improve this question
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 –  Loop Space 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. –  yo' 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

1 Answer 1

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.