Suppose I want to draw an horizontal line, at shipout, the position of which is on top of the footnotes if some are in the page, and the bottom of the text otherwise. How can I retrieve the height of the footnote section to do so?
For instance, the following puts a line at the end of the page (footnote included) :
\documentclass{article}
\usepackage{atbegshi}
\usepackage{picture}
\makeatletter
\AtBeginShipout{%
\AtBeginShipoutUpperLeftForeground{%
\dimen@i\topmargin\advance\dimen@i\headheight%
\advance\dimen@i\headsep\advance\dimen@i 1in%
\advance\dimen@i\textheight%
\put(0, -\dimen@i){\line(1,0){2\textwidth}}}
}
\newcount\@cp
\def\copypasta#1#2{\@cp=0\loop\ifnum\@cp<#1 #2\advance\@cp by1\repeat}
\begin{document}
\copypasta{400}{white purple }
\footnote{Oh noes}
\copypasta{200}{brown fox }
\end{document}
Thanks!
\ht\footinstells you how high the footnotes are that are currently queued for insertion, but this doesn't help because (i) some of these may be deferred if there are too many for this page, and (ii) by the time the shipout hook is invoked, the footnotes you are interested in will have been split from this register. But if you could get the difference between the value of\ht\footinsbefore and after the insertions were performed... – Charles Stewart Sep 8 '10 at 12:27