Replies: 1 comment 2 replies
-
That is by design, we decided to only remove newlines in front of sectioning commands, see https://hannah-sten.github.io/TeXiFy-IDEA/code-style.html#specify-number-of-blank-lines-before-sectioning-commands The reason is that in LaTeX, newlines and empty lines can be significant and it is not always save to remove them. So the best thing we can do is 'hardcode' certain specific cases in which we are sure it won't change the result. So we need to take this one thing at a time. Examples of such cases are very much appreciated!
According to https://tex.stackexchange.com/a/9726/98850 empty lines can be added (or removed if there is more than one, I guess) only when LaTeX is in 'vertical mode', but then we need to know when that is the case. Thanks to your comment I did now find one more case where newlines should be removed according to the LaTeX Companion, around display environments: https://tex.stackexchange.com/a/600078/98850
I think you're right, spacing after and before sectioning commands seems to be safe to remove.
Spaces inside command parameters can be significant, for example for text commands like |
Beta Was this translation helpful? Give feedback.
-
I don't know if I should wait for
2024.1
and0.9.4
for a bug report.Using
0.9.3
and IntelliJ2023.3.5
there is a weird code reformatting.Or I use it wrong.
As example I can insert new lines in the enumerate environment or under chapters as much as I want.
They wont disappear.
Also the spaces between \chapter and \label or inside of {} and [] at the commands wont disappear.
But inserting new lines above the \chapter command removes them successfully.
Beta Was this translation helpful? Give feedback.
All reactions