[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65648: 13.2; indentation of nested environments
From: |
Ikumi Keita |
Subject: |
bug#65648: 13.2; indentation of nested environments |
Date: |
Sat, 09 Sep 2023 15:52:42 +0900 |
Hi Paul and Uwe,
>>>>> Paul Nelson <ultrono@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
Description: align to beg-col
- bug#65648: 13.2; indentation of nested environments, (continued)
- bug#65648: 13.2; indentation of nested environments, Uwe Brauer, 2023/09/03
- bug#65648: 13.2; indentation of nested environments, Paul Nelson, 2023/09/03
- bug#65648: 13.2; indentation of nested environments, Uwe Brauer, 2023/09/03
- bug#65648: 13.2; indentation of nested environments, Paul Nelson, 2023/09/03
- bug#65648: 13.2; indentation of nested environments, Uwe Brauer, 2023/09/03
- bug#65648: [off-topic your packages] (was: bug#65648: 13.2; indentation of nested environments), Uwe Brauer, 2023/09/03
- bug#65648: [off-topic your packages] (was: bug#65648: 13.2; indentation of nested environments), Paul Nelson, 2023/09/03
- bug#65648: [off-topic your packages], Uwe Brauer, 2023/09/03
- bug#65648: 13.2; indentation of nested environments, Ikumi Keita, 2023/09/04
- bug#65648: 13.2; indentation of nested environments, Paul Nelson, 2023/09/04
- bug#65648: 13.2; indentation of nested environments,
Ikumi Keita <=
- bug#65648: 13.2; indentation of nested environments, Paul Nelson, 2023/09/09
- bug#65648: 13.2; indentation of nested environments, Ikumi Keita, 2023/09/12
- bug#65648: 13.2; indentation of nested environments, Ikumi Keita, 2023/09/14
- bug#65648: 13.2; indentation of nested environments, Uwe Brauer, 2023/09/09
- bug#65648: 13.2; indentation of nested environments, Paul Nelson, 2023/09/09
- bug#65648: 13.2; indentation of nested environments, Uwe Brauer, 2023/09/09
- bug#65648: 13.2; indentation of nested environments, Uwe Brauer, 2023/09/10
- bug#65648: 13.2; indentation of nested environments, Ikumi Keita, 2023/09/10