1

I've to fix a footer minipage on one page at the bottom of that page without using of e.g. fancyhdr so that the floating text is breaking into new page when that footer is reached. How to do that? Many thanks in advance.

UPDATE (2021-09-25)

The volume of the beginning text at page 1 is not static. It is dynamically given by another program. It can be 130 words long but also 1,000 or so. So a {figure}[b] at page 1 is no option here because the text may move this figure to page 2 when the volume of the text is big enough.

enter image description here

The text is floating into new page because the minipage is reached but the minipage keeps at this position:

enter image description here

Toru
  • 135

2 Answers2

1

You can use a bottom float. THIS IS AN EDITED VERSION OF MY ORIGINAL ANSWER

% botprob.tex  SE 616534

\documentclass{article} \usepackage{lipsum} %\setlength{\textheight}{0.4\textheight}

%%% EDITED RESPONSE \begin{document} \begin{figure}[b] \fbox{At the bottom of the page.} \end{figure}

\lipsum[1-5]

\end{document}

% ORIGINAL RESPONSE

\begin{document} \lipsum[1]

\begin{figure}[b] \fbox{At the bottom of the page.} \end{figure}

\lipsum[2-3]

\end{document}

\begin{figure} A FIGURE. \caption{A fig} \end{figure}

\end{document}

enter image description here

Peter Wilson
  • 28,066
0

It's a bit overkill, but easy to implement.

\documentclass{article}
\usepackage{float}
\floatstyle{boxed}
\newfloat{Message}{b}{lom}% \message already used

\usepackage{lipsum} \begin{document} \lipsum[1]

\begin{Message} Hello World! \end{Message}

\lipsum[2-6] \end{document}


This version takes more work but gives more control over the spacing (\textfloatsep).

\documentclass{article}
\usepackage{newfloat}
\DeclareFloatingEnvironment[placement=b,fileext=lom]{floatmsg}

\newsavebox{\messagebox} \newenvironment{Message}{\floatmsg\vskip-\textfloatsep \begin{lrbox}{\messagebox}\minipage{\dimexpr \linewidth-2\fboxsep-2\fboxrule}}% {\endminipage\end{lrbox}\fbox{\box\messagebox}\endfloatmsg}

\usepackage{lipsum} \begin{document} \lipsum[1]

\begin{Message} Hello World! \end{Message}

\lipsum[2-6] \end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
  • Sorry, but \begin{document}\lipsum[1-5]\begin{Message}... moves the message to page 2. So the message isn't fixed at page 1. See my update. – Toru Sep 25 '21 at 21:15
  • If you wait until page 2 to create it, there is no way to put it on page 1. Do you want to specify the page number and create it in the preamble? (See https://tex.stackexchange.com/questions/506766/pin-figure-to-page-and-column-in-a-2-column-document) – John Kormylo Sep 26 '21 at 15:45