GNU bug report logs -
#65648
13.2; indentation of nested environments
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Thu, 31 Aug 2023 04:57:01 UTC
Severity: normal
Found in version 13.2
Done: Ikumi Keita <ikumi <at> ikumi.que.jp>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi Paul and Uwe,
>>>>> Paul Nelson <ultrono <at> gmail.com> writes:
> As for the "always-align t" case, there are still some natural "broken"
> examples, as you know:
> #+begin_src latex
> \begin{equation*}
> g = \begin{pmatrix}
> a & b \\
> c & d \\
> \end{pmatrix},
> \quad
> h = \begin{pmatrix}
> x & y \\
> z & w \\
> \end{pmatrix}.
> \end{equation*}
> #+end_src
> #+begin_src latex
> The matrix $\begin{pmatrix}
> a & b \\
> c & d
> \end{pmatrix}$ has determinant
> \begin{equation*}
> a d - b c.
> \end{equation*}
> The matrix $\begin{pmatrix}
> a & b \\
> c & d
> \end{pmatrix}$ has determinant
> \begin{equation*}
> a d - b c.
> \end{equation*}
> The matrix $\begin{pmatrix}
> a & b \\
> c & d
> \end{pmatrix}$ has determinant
> \begin{equation*}
> a d - b c.
> \end{equation*}
> #+end_src
I've been gradually inclined to the attached approach. Namely, align "&"
as well as \end{foo} relative to beg-col, not beg-pos. In this way, the
above examples turn into
----------------------------------------------------------------------
\begin{equation*}
g = \begin{pmatrix}
a & b \\
c & d \\
\end{pmatrix},
\quad
h = \begin{pmatrix}
x & y \\
z & w \\
\end{pmatrix}.
\end{equation*}
----------------------------------------------------------------------
and
----------------------------------------------------------------------
The matrix $\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}$ has determinant
\begin{equation*}
a d - b c.
\end{equation*}
The matrix $\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}$ has determinant
\begin{equation*}
a d - b c.
\end{equation*}
The matrix $\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}$ has determinant
\begin{equation*}
a d - b c.
\end{equation*}
----------------------------------------------------------------------
This patch indents as
\begin{equation}
n u m=\left[\begin{array}{ll}
2 & 25
\end{array}\right]
\end{equation}
, not the form Paul proposed
\begin{equation}
n u m=\left[\begin{array}{ll}
2 & 25
\end{array}\right]
\end{equation}
. Maybe Uwe doesn't like the former indentation, but it is more similar
to the behavior of other (non-tabular type) environments.
> With a bit more massaging, it should be possible to avoid these. I had in
> mind modifying LaTeX-indent-level-count (or the block surrounding where it
> is called) in \end{TABULAR} cases, adjusting by the difference between the
> matching \begin and its beginning of line.
A similar idea crossed my brain, too. The best position to modify would be
`LaTeX-indent-calculate-last'.
It would make the indent algorithm more complex, so I began to search
for more simple solution.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
[0001-temporal-commit.patch (text/x-diff, attachment)]
This bug report was last modified 1 year and 254 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.