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

amsmath: column issues with aligned, alignedat and gathered #1609

Open
nbeisert opened this issue Jan 6, 2025 · 1 comment
Open

amsmath: column issues with aligned, alignedat and gathered #1609

nbeisert opened this issue Jan 6, 2025 · 1 comment

Comments

@nbeisert
Copy link

nbeisert commented Jan 6, 2025

Brief outline of the bug

There are a couple of minor inconsistencies with the aligned, alignedat and gathered environments of amsmath (which likely do not surface prominently in actual documents):

Minimal example showing the bug

\RequirePackage{latexbug}
\documentclass{article}
\usepackage{amsmath}

\makeatletter
\def\@amsmath@err#1#2{\quad\text{ERROR}}

\begin{document}

detection of excessive columns works in nesting here:
\[
\begin{alignedat}{1}
YYYYY
&\quad\text{col}: \the\column@
\\
\begin{aligned}Y&Y&Y&Y&Y\end{aligned}
&\quad\text{col}: \the\column@/\the\maxfields@
&\quad\text{col}: \the\column@/\the\maxfields@
\\
YYYYY
&\quad\text{col}: \the\column@/\the\maxfields@
\end{alignedat}
\]

detection of excessive columns can be misled by gathered:
\[
\begin{alignedat}{1}
YYYYY
&\quad\text{col}: \the\column@/\the\maxfields@
\\
\begin{gathered}YYYYY\end{gathered}
&\quad\text{col}: \the\column@/\the\maxfields@
&\quad\text{col}: \the\column@/\the\maxfields@
\\
YYYYY
&\quad\text{col}: \the\column@/\the\maxfields@
\end{alignedat}
\]

alignedat does not detect excessive column in final row:
\[\begin{alignedat}{1}
YYYYY
&\quad\text{col}: \the\column@/\the\maxfields@
&\quad\text{col}: \the\column@/\the\maxfields@
\\
YYYYY
&\quad\text{col}: \the\column@/\the\maxfields@
&\quad\text{col}: \the\column@/\the\maxfields@
\\
YYYYY
&\quad\text{col}: \the\column@/\the\maxfields@
&\quad\text{col}: \the\column@/\the\maxfields@
\end{alignedat}\]

Inconsistencies in eliminating the trailing tabsep in aligned:
\[\vrule\begin{aligned}
X\\
X&Y
\end{aligned}\vrule\]
\[\vrule\begin{aligned}
X\\
X&Y\\
\end{aligned}\vrule\]
\[\vrule\begin{aligned}
X&Y
\end{aligned}\vrule\]
\[\vrule\begin{aligned}
X&Y\\
\end{aligned}\vrule\]
\[\vrule\begin{aligned}
X&Y\\
X&Y
\end{aligned}\vrule\]
\[\vrule\begin{aligned}
X&Y\\
X&Y\\
\end{aligned}\vrule\]

\end{document}
@nbeisert
Copy link
Author

nbeisert commented Jan 6, 2025

log and pdf:
bug3b.log
bug3b.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant