2

I sometimes want to put the content of a float on a page by itself and control the alignment in the usual type area. To do this, I use a minipage that has exactly the size \textwidth x \textheight. However, depending on the content (and the packages loaded), I get Float too large warnings.

In the following example, both figures contain only a minipage with some text in them, the second one additionally has a footnote. For the first one I get a warning about the float being too large by 1.94397pt, for the second one by 2.85002pt. If I remove \usepackage[T1]{fontenc}, the first warning goes away, but the second stays. If I switch to LuaLaTeX, the first warning is back, this time about 2.06pt.

Why does the minipage not perfectly fit the type area and how can I fix this? Why does it even depend on the minipage's content? I would have thought the whole point of a fixed-height minipage is that the height is, well, fixed.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{lipsum}

\begin{document}

Hello World!

\begin{figure}[p]
  \begin{minipage}[b][\textheight]{\textwidth}
    \lipsum[1]
  \end{minipage}
\end{figure}

\begin{figure}[p]
  \begin{minipage}[b][\textheight]{\textwidth}
    \lipsum[1]\footnote{test}
  \end{minipage}
\end{figure}

\end{document}

2 Answers 2

4

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{lipsum}

\begin{document}


\sbox0{\begin{minipage}[b][\textheight]{\textwidth}
    \lipsum[1]
  \end{minipage}}

\showthe\textheight
\showthe\dimexpr\ht0+\dp0\relax

\end{document}

produces

> 550.0pt.
l.14 \showthe\textheight
                        
? 
> 551.94397pt.
<recently read> \relax 

if you put a vspace of 0pt at the bottom of the minipage it has depth 0 and the first warning goes

2
  • 2
    Additionally the extra depth comes from the decenders of the letters on the bottom line of the minipage. The height it above this baseline. In Davids calculation \ht0 actually equals \textheight. Commented 15 hours ago
  • Ah, so the depth of the float content has to fit inside the type area (unlike the depth of a normal page)? Didn't realize that. Commented 14 hours ago
3

Why don't you simply use [t] instead of [b]? Even with things that are very high all that happens is that the alignment point of the box is shifted, and the overall height+depth of the resulting box will stay \textheight:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{lipsum}

\begin{document}

Hello World!

\begin{figure}[p]
  \begin{minipage}[t][\textheight]{\textwidth}
    \lipsum[1]
  \end{minipage}
\end{figure}

\begin{figure}[p]
  \begin{minipage}[t][\textheight]{\textwidth}
    \rule{5cm}{5cm}\lipsum[1]\footnote{test}
  \end{minipage}
\end{figure}

\end{document}
4
  • Well, because I want the alignment point at the bottom, naturally. Basically, I want the bottom line in the float to be at the same position as the bottom line on any other page (i.e. with its baseline at the bottom edge of the type area). Commented 13 hours ago
  • 1
    @schtandard why though? The alignment point of the minipage won't be visible. And if you want the contents to be at the bottom of the minipage you can simply put a \vfill at the start of it. Or you'll have to smash the depth to silence the warnings. Commented 13 hours ago
  • 1
    For the same reason I don't work with \raggedbottom: So that the bottom lines on adjacent pages match. If I do the \vfill, this won't be the case. So yes, I'll have to smash the depth. (My problem was that I did not realize this was necessary, as it isn't on a non-float page.) Commented 13 hours ago
  • 1
    @schtandard the depth doesn't automatically go into \maxdepth as you are not placing the box directly on a page it is (by default in a p column) vertically centred so \vfii minipage \vfiill so threference point in the box has no effect only the total height+dpeth Commented 12 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.