You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is to report some inconsistent spacing behaviour in align and flalign (full-length) of amsmath with fleqn (left-aligned equations). Related issues have been reported in #136, #156, #162. The below example highlights the behaviour in various situations and could be used as a testcase. Issues:
Tags for flalign with several columns and leqno are misplaced.
flalign with a single align structure resorts to the behaviour of align. Technically, this is necessary to avoid a division by zero due to no flexible space in this situation, but it leads to inconsistent spacing behaviour in fleqn mode (due to the design choices in the following issues).
The handling of the left margin differs between equation and align and flalign: equation grows into the left margin if and only as far as is needed for long equations. align never uses the left margin and flalign always uses the full left margin unless left tags are present. I think that equation takes the most natural approach while the others waste or improperly use the left margin depending on the situation.
flalign skips the left margin whereas the other amsmath environments never use it or use it only if the equations become very long. This appears intentional behaviour in flalign (full-length), but to only skip the right margin while preserving the left margin is a worthwhile behaviour as well. Moreover, skipping the left margin in general introduces a competition in the measuring process because left tags will (re)enforce the full margin while long equations may actually need it.
I agree that some of the above inconsistent spacing issues may have become established behaviour (and/or are marginal) and thus any changes would have the flavour of an enhancement which could be challenging to implement. Nevertheless I consider them worthwhile reporting.
Minimal example showing the bug
\RequirePackage{latexbug}
\documentclass{article}
\PassOptionsToPackage{leqno}{amsmath}
%\PassOptionsToPackage{reqno}{amsmath}\usepackage[fleqn]{amsmath}
\textwidth12.1cm
\parindent0pt
\overfullrule5pt
\begin{document}
equation (short, unnumbered): for reference
\begin{equation}\nonumberXXXXXXXXXX\end{equation}
equation (short, numbered): for reference
\begin{equation}
XXXXXXXXXX\end{equation}
align (short, single-column, unnumbered): for reference
\begin{align}\nonumberXXXXXXXXXX\end{align}
align (short, single-column, numbered): for reference
\begin{align}
XXXXXXXXXX\end{align}
align (short, double-column, unnumbered): for reference
\begin{align}\nonumberXXXXX & XXXXX & XXXXX & XXXXX\end{align}
align (short, double-column, numbered): for reference
\begin{align}
XXXXX & XXXXX & XXXXX & XXXXX\end{align}
flalign (short, single-column, unnumbered):
behaves like align (by design of exception),
but as such does not skip left margin
\begin{flalign}\nonumber
XXXXX & XXXXX
\end{flalign}
flalign (short, single-column, numbered):
behaves like align (by design of exception),
but as such does not skip left margin in \verb+reqno+ mode
\begin{flalign}
XXXXX & XXXXX
\end{flalign}
flalign (short, double-column): works as intended
(no need to fill left margin)
\begin{flalign}\nonumber
XXXXX & XXXXX & XXXXX & XXXXX
\end{flalign}
flalign (short, double-column, numbered):
tag is clearly misplaced in \verb+leqno+ mode
\begin{flalign}
XXXXX & XXXXX & XXXXX & XXXXX
\end{flalign}
\newpage\setcounter{equation}{0}
\rule{\textwidth}{5pt}
equation (short, unnumbered): for reference
\begin{equation}\nonumberXXXXXXXXXX\end{equation}
equation (long, unnumbered): for reference
\begin{equation}\nonumberXXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXX\end{equation}
equation (short, numbered): for reference
\begin{equation}
XXXXXXXXXX\end{equation}
equation (long, numbered): for reference
\begin{equation}
XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXX\end{equation}
equation (very long, numbered): for reference
\begin{equation}
XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXX\end{equation}
align (short, unnumbered): works as intended
\begin{align}\nonumberXXXXX&XXXXX\end{align}
align (long, unnumbered):
this could well stretch into the left margin
(as for equation)
\begin{align}\nonumberXXXXX&XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&X&X\end{align}
align (short, numbered):
works as intended
\begin{align}
XXXXX&XXXXX\end{align}
align (long, numbered):
this could well stretch into the left margin
(as for equation)
\begin{align}
XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&X&X\end{align}
align (very long, numbered):
this could well stretch into the left margin
when the tag is shifted up (as for equation)
\begin{align}
XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&XX&X\end{align}
flalign (short, unnumbered):
this does not have to stretch into the left margin
(probably works as intended)
\begin{flalign}\nonumber
XXXXX&XXXXX&XXXXX&XXXXX
\end{flalign}
flalign (long, unnumbered):
this could stretch less into the left margin
and should not produce an overfull warning
\begin{flalign}\nonumber
XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&XXXXX&X&X
\end{flalign}
\end{document}
Disclosure: I'm working on an stand-alone enhancement of the various equation structures supplied by amsmath, where I'm reconsidering the measurement process alongside several other enhancements (see #224, #230, #231). Unfortunately, the resulting code will depart too much from the original one, so that fixes of individual issues will likely not translate too well. Therefore, I'm reporting the issues I'm finding in the amsmath implementation here.
Disclosure: I'm working on an stand-alone enhancement of the various equation structures supplied by amsmath
if you do that, please consider also support for the tagging project and ensure that your equation structures are properly tagged. See https://latex3.github.io/tagging-project/
@u-fischer thanks for the suggestion, sounds useful, I will consider it. I did not find immediately what it would take in practice to supply tagging for math or for aligned equations, but the code structures of the enhancement will be similar to the ones for align. I hope that's not too complex and does not exhaust my capabilities.
Brief outline of the bug
This is to report some inconsistent spacing behaviour in
align
andflalign
(full-length) of amsmath withfleqn
(left-aligned equations). Related issues have been reported in #136, #156, #162. The below example highlights the behaviour in various situations and could be used as a testcase. Issues:flalign
with several columns andleqno
are misplaced.flalign
with a single align structure resorts to the behaviour ofalign
. Technically, this is necessary to avoid a division by zero due to no flexible space in this situation, but it leads to inconsistent spacing behaviour infleqn
mode (due to the design choices in the following issues).equation
andalign
andflalign
:equation
grows into the left margin if and only as far as is needed for long equations.align
never uses the left margin andflalign
always uses the full left margin unless left tags are present. I think thatequation
takes the most natural approach while the others waste or improperly use the left margin depending on the situation.flalign
skips the left margin whereas the other amsmath environments never use it or use it only if the equations become very long. This appears intentional behaviour inflalign
(full-length), but to only skip the right margin while preserving the left margin is a worthwhile behaviour as well. Moreover, skipping the left margin in general introduces a competition in the measuring process because left tags will (re)enforce the full margin while long equations may actually need it.Minimal example showing the bug
Log files and PDF files
bug2b-l.log
bug2b-l.pdf
bug2b-r.log
bug2b-r.pdf
The text was updated successfully, but these errors were encountered: