Closed Rdeisenroth closed 1 year ago
Thanks for this, I hope to get to it soon.
As of https://github.com/cmhughes/latexindent.pl/commit/a7c87234807331ea445d1d17ef5e9bf561810c6d I've updated the fineTuning
routine so that you can specify
defaultIndent: "\t"
specialBeginEnd:
customSection:
begin: \\(?:section|chapter)
end: \%\h+end
specialBeforeCommand: 1
fineTuning:
trailingComments:
notPreceededBy: (?<!\\)
afterComment: (?!(?:\hend)).*? # <!----- NEW BIT
and then you receive
\chapter{Quaternionen} % S.176
\todo{Quaternionen}
\section{Vergleich mit anderen Darstellungsarten} % S.179
\todo{Quaternionen}
% end
% end
\chapter{Zusammenhang zwischen Rotationsmatrix, Drehvektor und Drehwinkel} % S.179
\todo{Rotationsmatrix, Drehvektor und Drehwinkel}
\section{Umwandlung von Drehvektor und Drehwinkel zu Rotationsmatrix} % S.179
\todo{Rotationsmatrix, Drehvektor und Drehwinkel}
% end
\section{Umwandlung von Rotationsmatrix zu Drehvektor und Drehwinkel} % S.179, S.180, S.181
\todo{Rotationsmatrix, Drehvektor und Drehwinkel}
% end
% end
I'll get this released soon; feel free to pull from develop
in the mean time.
Thanks again!
Implemented as of https://github.com/cmhughes/latexindent.pl/releases/tag/V3.22 upload to ctan imminent.
I am trying to get latexindent to accept this kind of indentation where i use a comment in order to mark a section or chapter end.
original .tex code
yaml settings
actual/given output
desired or expected output
anything else
I tried to define a custom noIndentBlock:
and seperately a
specialBeginEnd
:which unfortunately gives the same result.
If there is some way to turn off indentation for a pattern like this it would be enough for my usecase. However ideally it would auto-indent the comments. Apologies if i am overlooking something.