1

I just realized that an empty minipage does not work as a placeholder since it neglects the specified width. Adding, for example, a \strut achieves the desired result. Maybe someone can enlighten me why some phantom element is needed here and whether or not a \strut is what you should use in this case.

Disclaimer: I am not actually looking for an alternative to using minipage. I am just curious about the reasons why it doesn't work as I expected it to work.

Example:

\documentclass[11pt,a4paper]{article}
\usepackage{lipsum}

\begin{document}
  \lipsum[1]

  \vspace{1em}%

  \noindent
  \begin{minipage}[t]{0.3\textwidth}
    % Placing a \strut here, the width would be respected
  \end{minipage}%
  \begin{minipage}[t]{0.7\textwidth}
    \lipsum[1]%
  \end{minipage}%
\end{document}

Result:

enter image description here

1
  • 1
    Just as an observation \leavevmode also works as material to get the box to "be there"
    – daleif
    Nov 8, 2023 at 8:44

1 Answer 1

2

The width argument is used to set \hsize locally, that is the width used for linebreaking. So if you have any horizontal materal in the content, it will cause a paragraph and at least one line wiill be \hsize wide (or over-full).

If there is no content (or more specifically no horizontal mode) then the box will be the width of its content, which will be 0pt, for an empty box

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .