After stripping away hundreds of line of code to reach this MWE, I found that my "A «box» was supposed to be here" seemed to be caused by a \renewcommand{\headrule}
in conjunction with fancyhdr
.
Moreover, the error goes away if I delete \leaders
from the \box
specification.
This redefinition was something that I cobbled together at some point, undoubtedly inspired by examples I didn't fully understand.
I'd appreciate insight into why I'm getting this error and how to rewrite it to squash that error.
\documentclass[12pt,final]{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrule}{%
\hbox to\headwidth{\leaders\rule[5pt]{\headwidth}{0.4pt}\hfill}%
% \hbox to\headwidth{\rule[5pt]{\headwidth}{0.4pt}\hfill}%
}%
\begin{document}
Hello, world.
\end{document}
P.S., the error message isn't really "«box»" but rather the « and » should be replaced with less-than and greater-than signs. Those were rejected when I entered them here.
\rule
to fine-tune the vertical position of each rule. I also set a color for these rules (though I removed that from the MWE because it wasn't causing trouble).