I find LaTeX's choice of putting a page number in one-page documents stylistically odd, so I would like to suppress that behavior. I've previously done this manually, but it would be better to not need to keep track of how long the document is myself.
The question has been asked before, but the preferred solution by the OP involves playing with \maketitle, which has no relevance to me here. The accepted answer creates a macro that needs to go after \begin{doucument}, but it would be better to have something that I can put in my preamble or .sty file, so that I don't need to remember to always put some custom macro in every document I write.
MWE:
\documentclass{article}
\usepackage{lipsum,fancyhdr}
\pagestyle{fancy}
\fancyhead[C]{Don't ever remove this header}
\begin{document}
\lipsum[1] % automatically remove page number in a document with this line
\lipsum[1-6] % automatically keep page numbers in a document with this line
\end{document}
.styfile. The Creating Packages page at Wikibooks is one reference, I'm sure we have others here. – Mike Renfro Mar 16 '14 at 14:38.styfile" line. They're equivalent options. – Sverre Mar 16 '14 at 14:48\onemoreside, one in the\maketitledefinition, and another after\maketitle. This resembles something I had to do with my thesis class, and I know I didn't have to include odd commands like this in it. Will see what I can find. – Mike Renfro Mar 16 '14 at 14:54