1

I am trying to keep an equation together with some other descriptive paragraphs, so I put them inside a minipage so that they do not as easily break across pages. However, even though I used \textwidth, the whole text block seems to shift to the right. Because I get an overfull hbox warning, I suspect that in fact the minipage has some internal padding to accommodate the equation number, which leads to the added with.

How can I have it so that the minipage, and the equation and text inside it, simply follow the flow of the rest of the text? (Also there is vertical space between the first line of the paragraph in the minipage and the rest, I am not sure what is causing that.)

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}

\begin{document}

\lipsum[2]

\begin{minipage}{\textwidth} \vspace{\baselineskip} \begin{equation}\label{0-eq:mwg-formula} cross_{MWG} = \frac{1}{4} \cdot mn (m-1)(n-1) \end{equation} \vspace{\baselineskip} \lipsum[3] \end{minipage}

\end{document}

enter image description here

  • Add \noindent just before \begin{minipage}. – Bernard Mar 25 '21 at 09:57
  • A minipage is a box so it's just being indented, you should put a \noindent before it. However, I don't quite know what you are trying to do with the \vspace, that cannot possibly be your desired output (and you've got also a spurious space). – campa Mar 25 '21 at 09:58
  • @Bernard Thanks, that works. If you can add it as an answer I can accept it. Some explanation as to why this is needed would also be helpful. – Bram Vanroy Mar 25 '21 at 10:05
  • @campa Thanks. The vspace before the equation is to leave some space after the previous paragraph. That works. I had hoped that I could similarly created some space after the equation, between the next paragraph, but that does not seem to work as I had expected. – Bram Vanroy Mar 25 '21 at 10:06
  • I think you can safely remove the \vspaces provided you use \begin{minipage}[t]{\linewidth}. – campa Mar 25 '21 at 10:07
  • Thank you, but I think it certainly is in a previous answer, and I don't want to make a duplicate. As to the explanation, your minipage starts a new paragraph (due to the blank line) so at the beginning of this paragraph, there is a \parindent, unless you explicily say you don't want one. – Bernard Mar 25 '21 at 10:09
  • @Bernard What do you think: https://tex.stackexchange.com/q/152582/82917 or https://tex.stackexchange.com/q/426315/82917? – campa Mar 25 '21 at 11:40
  • @Campa: Well, the second answer is what I suggest in my comment. I didn't know this thread. – Bernard Mar 25 '21 at 12:48

0 Answers0