Closed arodomanov closed 11 months ago
Many thanks, that's a helpful example.
Certainly not expected behaviour, and definitely a bug. I'll look into it.
Note to self, maybe try removing the g switch from the find and replace in
https://github.com/cmhughes/latexindent.pl/blob/main/LatexIndent/Special.pm
Note to self, maybe try removing the g switch from the find and replace in
https://github.com/cmhughes/latexindent.pl/blob/main/LatexIndent/Special.pm
This didn't work
Implemented and released at https://github.com/cmhughes/latexindent.pl/releases/tag/V3.23.2
thanks again!
Thanks a lot for such a quick fix!
You're welcome, and thank you for such a clear, concise example. Happy indenting!
On Mon, 25 Sep 2023, 14:11 Anton Rodomanov, @.***> wrote:
Thanks a lot for such a quick fix!
— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/477#issuecomment-1733683052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYFURIGCKRCPYQQAGN3X4F7GLANCNFSM6AAAAAA46MHJWU . You are receiving this because you modified the open/close state.Message ID: @.***>
Hi,
I'm trying to make
latexindent
automatically indent the text inside any (round) parentheses (in other words, to treat(
and)
as the beginning and end, respectively, of a certain environment).To achieve this, I've tried to declare a
specialBeginEnd
block (see thelatexindent.yaml
file below).At first, this seemed to work fine and produced the result I wanted. However, I then noticed that the result isn't stable. Specifically, the output changes if you run
latexindent
again (one or several times) without changing anything. In particular, I managed to obtain two different outputs after runninglatexindent
several times on the same file with the same settings and by using the same command (see below).From my limited understanding (after inspecting the log file), it looks as if the problem is that each run of
latexindent
joins the settings fromspecialBeginEnd
in an arbitrary order which results in different internal regular expressions.Please confirm if it's a bug, or if I'm misusing the
specialBeginEnd
feature.Original .tex code (
source.tex
)yaml settings (
latexindent.yaml
)The command used to run
latexindent
Actual output 1 [good] (
source-mod.tex
)Actual output 2 [bad] (
source-mod.tex
)Desired or expected output
The desired output is output 1 [good] presented above.
Version of
latexindent