Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacing issue at start of minipage (and similar) #989

Closed
FrankMittelbach opened this issue Jan 30, 2023 · 3 comments
Closed

Spacing issue at start of minipage (and similar) #989

FrankMittelbach opened this issue Jan 30, 2023 · 3 comments

Comments

@FrankMittelbach
Copy link
Member

Brief outline of the bug

There is a long-known issue that TeX drops spaces (and penalties) at the start of a vertical list (such as generated by minipage) but only if that list ist totaly empty. Things that produce invisible "whatsits" like color change that state and therefore a minipage starting with, say, a list, suddenly sees some vertical space at the top coming from \parskip being added and not dropped by TeX.

Minimal example showing the bug

\RequirePackage{latexbug}       % <--should be always the first line (see CONTRIBUTING)!
\documentclass{article}

\usepackage{hyperref,color}   % sample other code can have the same effect

\begin{document}

\fbox{%
  \begin{minipage}{10cm}%       % no issue
  \begin{itemize}
    \item abc \par xyz
  \end{itemize}
  \end{minipage}%
}

\fbox{%
  \begin{minipage}{10cm}% 
  \LinkTargetOff               % no issue if anchor/dest is suppressed
  \begin{enumerate}
    \item abc \par xyz
  \end{enumerate}
  \end{minipage}%
}

\fbox{%
  \begin{minipage}{10cm}%
  \begin{enumerate}
    \item abc\label{b} \par xyz   % hyperref backref is the issue
  \end{enumerate}
  \end{minipage}%
}

\fbox{%
  \begin{minipage}{10cm}%
  \color{red}                  % color is the issue
  \begin{enumerate}
    \item abc \par xyz
  \end{enumerate}
  \end{minipage}%
}

\end{document}

first two boxes show extra spacing.

With the new paragraph handling it should be possible to catch this finally.

@mrpiggi
Copy link

mrpiggi commented Jan 31, 2023

I am just curious, if this also addresses the issue with \addvspace (#307)?

@FrankMittelbach
Copy link
Member Author

I am just curious, if this also addresses the issue with \addvspace (#307)?

no it doesn't. It only deals with an extra \parskip added at the top of a vertical box, but this is a place where you can't necessarily avoid placing something like \color. The issue in (#307) is related but also different.

@mrpiggi
Copy link

mrpiggi commented Jan 31, 2023

Thanks for your response and clarification

josephwright pushed a commit that referenced this issue Feb 15, 2023
@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Mar 28, 2023
@josephwright josephwright removed the fixed in dev Fixed in development branch, not in stable release label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants