branch: externals/auctex commit 4ad82777c0d31d8121a20b19b1577e893ffd86fe Author: Ikumi Keita <ik...@ikumi.que.jp> Commit: Ikumi Keita <ik...@ikumi.que.jp>
Add new test for indent * tests/latex/latex-test.el (LaTeX-indent-tabular): Add cookie to recognize \usepackage. * tests/latex/tabular-in.tex: * tests/latex/tabular-out.tex: Add \usepackage to deal with align and aligned environments. Add new test involving aligned environment. --- tests/latex/latex-test.el | 2 ++ tests/latex/tabular-in.tex | 14 ++++++++++++++ tests/latex/tabular-out.tex | 14 ++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/tests/latex/latex-test.el b/tests/latex/latex-test.el index e02b2185c1..aff0adcc60 100644 --- a/tests/latex/latex-test.el +++ b/tests/latex/latex-test.el @@ -55,6 +55,8 @@ (with-temp-buffer (insert-file-contents LaTeX-indent-tabular-test/in) (LaTeX-mode) + (let ((TeX-parse-self t)) + (TeX-update-style t)) (indent-region (point-min) (point-max)) (buffer-string)) (with-temp-buffer diff --git a/tests/latex/tabular-in.tex b/tests/latex/tabular-in.tex index 8f75ab72db..faaf4057d1 100644 --- a/tests/latex/tabular-in.tex +++ b/tests/latex/tabular-in.tex @@ -1,4 +1,5 @@ \documentclass{article} +\usepackage{amsmath} \begin{document} \begin{tabular}{llll} Lorem ipsum dolor & sit amet, ei mei @@ -39,6 +40,19 @@ detraxit & no. & Ne sea doming & deserunt. 9 \end{align} +% Example given by Uwe Brauer <o...@mat.ucm.es>. +% (https://lists.gnu.org/r/auctex-devel/2022-01/msg00055.html) +\begin{equation} + \begin{aligned} +&n u m=\left[\begin{array}{ll} +2 & 25 +\end{array}\right] \\ +&d e n=\left[\begin{array}{lll} +1 & 4 & 25 +\end{array}\right] +\end{aligned} +\end{equation} + % Next table tests filling with a control symbol \& inside a cell; the % function `LaTeX-indent-tabular' now (March 2017) detects \&, see: % https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26010 diff --git a/tests/latex/tabular-out.tex b/tests/latex/tabular-out.tex index 73521d2d05..9e4cec1a72 100644 --- a/tests/latex/tabular-out.tex +++ b/tests/latex/tabular-out.tex @@ -1,4 +1,5 @@ \documentclass{article} +\usepackage{amsmath} \begin{document} \begin{tabular}{llll} Lorem ipsum dolor & sit amet, ei mei @@ -39,6 +40,19 @@ 9 \end{align} +% Example given by Uwe Brauer <o...@mat.ucm.es>. +% (https://lists.gnu.org/r/auctex-devel/2022-01/msg00055.html) +\begin{equation} + \begin{aligned} + &n u m=\left[\begin{array}{ll} + 2 & 25 + \end{array}\right] \\ + &d e n=\left[\begin{array}{lll} + 1 & 4 & 25 + \end{array}\right] + \end{aligned} +\end{equation} + % Next table tests filling with a control symbol \& inside a cell; the % function `LaTeX-indent-tabular' now (March 2017) detects \&, see: % https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26010