1

Sometimes, when a page is ended with a formula, it goes below the desired page border. For example, the following code

\documentclass{article}
\usepackage[showframe,
            textwidth=4cm,
            textheight=5cm]{geometry}

\def\formula{%
x\frac{x\sum_{n=1}^\infty\frac{x^n}{n!}}
{x\sum_{n=1}^\infty\frac{nx^n}{n!}}}

\begin{document}
\[ \formula \]
\vfill
\[ \formula \]
\[ \formula \]
\[ \formula \]
\end{document}

produces this result at page 1:

Formula hangs below the page border

(I'm using TeXLive 2016 both on Windows and Linux, the result is the same, also the same for pdflatex and lualatex.) Is there a way to make it respect page boundaries?

  • 2
    There is no page break point between consecutive displays; however consecutive displays should never be used: there is gather* from amsmath that features \displaybreak. – egreg Apr 27 '17 at 08:30
  • The same happens if there's a paragraph after the formula which comes last on a page. – Sergei Golovan Apr 27 '17 at 08:31
  • 1
    Yes, of course; there's no page break point for exactly the same reason: no page break is possible just after a math display. But it is if you use amsmath environments and \displaybreak. – egreg Apr 27 '17 at 08:34
  • I'm not sure I follow. I see that one page is complete and then goes another one. Wasn't is a page break? Also, Isn't it possible to end a paragraph with a display formula? – Sergei Golovan Apr 27 '17 at 08:38
  • Yes, it's possible: just have a blank line after the display. Sorry, but I can't follow you: can you please tell us what's your aim? Surely setting two (or more) consecutive \[...\] is wrong. – egreg Apr 27 '17 at 08:42
  • It's an artificial example. I can write a paragraph above and below the formula instead. For example: `Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text [ \formula ]

    Some text Some text Some text Some text Some text` The output again shows that the formula which ends a page goes to the bottom margin slightly.

    – Sergei Golovan Apr 27 '17 at 08:48
  • 3
    That is the \maxdepth value. You would see it with normal chars with some depth too. Try \par\vfill j. It would disappear if you set \maxdepth=0pt. – Ulrike Fischer Apr 27 '17 at 09:16
  • \pagebreak[3] is like the plain TeX \goodbreak. (Also \penalty@highpenalty) – John Kormylo Apr 27 '17 at 19:29

1 Answers1

6

That is due to the \maxdepth value which allows the page to have additional depth. You would see a similar behaviour with normal chars with some depth too. Try e.g. \par\vfill j.

It would disappear if you set \maxdepth=0pt.

Ulrike Fischer
  • 327,261