Parse \pagestyle{fancy}, \fancyhf, \fancyhead/\fancyfoot with L/C/R positions,
the \lhead/\chead/\rhead/\lfoot/\cfoot/\rfoot shorthands and
\renewcommand{\headrulewidth}, and paint them on every page. Head fields are
placed at top margin - \headsep and feet at text height + \footskip, both in
content coordinates so the page origin shifts them with the body; left, centre
and right align against the text measure, \thepage is expanded per page, and
the head rule uses the requested width.
Size and shape declarations are stripped before macro expansion because class
files define \footnotesize in terms of itself; expanding it repeated
\@setfontsize internals on every pass. A title page with fancy style is treated
as \thispagestyle{empty}, matching class \maketitle definitions.
The arXiv template now shows "A Preprint" on the right and its short title in
the centre after the title page, with the page number in the footer; tests
cover field parsing, painted positions/alignment and the title-page
suppression.