1

I have a document that has \usepackage[all]{nowidow} in order to eliminate all widows and orphans.

This sometimes causes lots of white space between the bottom of the body of text and the footer. I dislike this white space, but I wish to keep \usepackage[all]{nowidow}.

My initial strategy to eliminate the white space was to find a way to have the footer move to always be just below the body of text --- jump up and down, as it were --- after removal of all widows and orphans. I did not see a way of doing this, however; so I asked SE.

In response to that question (How to make footer move to just below the body of text), I have been told that it is difficult to automatically have the footer jump up and down in the way I have described.

Therefore, my new strategy is to forget about the real footer entirely, and instead, if possible, first to have LaTeX automatically identify the location of the last line of the actual body-of-text output on a given page after nowidow has taken effect, then to place \thepage, centered, one \baselineskip below that location. (For all I had wanted in my footer was \thepage.)

How might I do this, if possible? Or if impossible, why is that, exactly?

I am aware that my attitude toward widows and orphans (eliminating them all) and footers and quasi-footers (wanting them to jump around) is abominable in the eyes of many.

You can see the annoyingly large white space at the bottom of pages 2, 7, 27, 31, 33, 36, and 38 of the following MWE. This is simply illustrative, for, I repeat, my new strategy does not involve using a real footer.

\documentclass{book}
\usepackage[paperwidth=4.25in, paperheight=5.5in, footskip=0cm]{geometry}
\usepackage[skip=0pt, indent=20pt]{parskip}
\usepackage{fancyhdr}
\usepackage{microtype}
\usepackage[all]{nowidow} % Eliminates orphans and widows
\usepackage{lipsum}

\emergencystretch 30pt % Causes text to better heed margin

\fancyhf{} \pagestyle{fancy} \renewcommand\headrulewidth{0pt} \fancyfoot[CE,CO]{{\small[} \oldstylenums{\thepage} {\small]}}

\begin{document}

\lipsum[1-70]

\end{document}

Noah J
  • 515
  • 2
    Have you considered using lua-widow-control? (Article, CTAN) It doesn't solve the specific problem in the question, but it should prevent the too-short pages entirely. I'd say it's the best solution for removing widows and orphans, but I'm probably a little biased as its author :) – Max Chernoff Jul 03 '23 at 02:45
  • 1
    this is hard (and pretty weird) as page breaking happens asynchronously so you do not know which line will be last on the page at the time any macro in the text are evaluated, only later in the output routine (when float and page head and foot added) so you need to modify the page foot code to (try to) detect white space at the end of the page and back up. That is not generally possible unless using luatex – David Carlisle Jul 03 '23 at 04:53
  • 1
    This is a mater of taste, but maybe instead of avoid paragraph skips ([skip=0pt]), orphans and widows at any cost ([all]), so forcing big gaps somewhere, and then try to dissimulate that moving the footers, you could allow some small paragraph skip glue (x pt plus y pt minus z pt)), and allow even a bit of flexibility in the baseline skips and any other possible glue. As more flexibility you allow, less noticeable gaps you will find trough all the document. – Fran Jul 03 '23 at 16:51

0 Answers0