Skip to content

latexindent adds 1 space each run #599

@MightyPlaza

Description

@MightyPlaza

Each time latexindent is ran with the file above, & 3 gets shifted by 1 space to the right

original .tex code

\documentclass[]{article}

\begin{document}
\begin{align*} & 3
\end{align*}
\end{document}

yaml settings

None needed

actual/given output

Running latexindent -w file.tex results in:

\documentclass[]{article}

\begin{document}
\begin{align*}  & 3
\end{align*}
\end{document}

The diff from the original file beeing:

diff --git a/backup.tex b/file.tex
index 14a82ea..0de0460 100644
--- a/backup.tex
+++ b/file.tex
@@ -1,6 +1,6 @@
 \documentclass[]{article}
 
 \begin{document}
-\begin{align*} & 3
+\begin{align*}  & 3
 \end{align*}
 \end{document}

Running latexindent -w file.tex again results in:

\documentclass[]{article}

\begin{document}
\begin{align*}   & 3
\end{align*}
\end{document}

Where the diff is:

diff --git a/backup.tex b/file.tex
index 14a82ea..3c8ee7a 100644
--- a/backup.tex
+++ b/file.tex
@@ -1,6 +1,6 @@
 \documentclass[]{article}
 
 \begin{document}
-\begin{align*} & 3
+\begin{align*}   & 3
 \end{align*}
 \end{document}

This can be done again and again

desired or expected output

The behaviour I'd expect would be running it more than once would result in no change

Metadata

Metadata

Assignees

No one assigned

    Labels

    align-at-ampersand-routinethe align at ampersand; documented in lookForAlignDelimsbugunexpected behaviour; should be a priority for fixing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions