I have the following file that is part of one of my custom classes:
% actual latexindent output:
\DeclareDocumentCommand {\chapterformat} { } { \thechapter }
\DeclareDocumentCommand {\sectionformat} { } {\thesection}
\DeclareDocumentCommand \subsectionformat { } {\thesubsection}
\DeclareDocumentCommand \subsubsectionformat {} {\thesubsubsection}
\DeclareDocumentCommand \paragraphformat {} {\theparagraph}
\DeclareDocumentCommand \subparagraphformat {} {\thesubparagraph}
The source code you see here is the exact output after running latexindent.
However, instead I would expect to have an output like
% expected latexindent output:
\DeclareDocumentCommand {\chapterformat} { } { \thechapter }
\DeclareDocumentCommand {\sectionformat} { } {\thesection}
\DeclareDocumentCommand \subsectionformat { } {\thesubsection}
\DeclareDocumentCommand \subsubsectionformat {} {\thesubsubsection}
\DeclareDocumentCommand \paragraphformat {} {\theparagraph}
\DeclareDocumentCommand \subparagraphformat {} {\thesubparagraph}
Obviously, latexindent is applying the rules for indenting sectioning commands here, as per my configuration:
# from latexindentconfig.yaml
indentAfterHeadings:
part:
indentAfterThisHeading: 0
level: 1
chapter:
indentAfterThisHeading: 1
level: 2
section:
indentAfterThisHeading: 1
level: 4
subsection:
indentAfterThisHeading: 1
level: 8
subsection*:
indentAfterThisHeading: 0
level: 9
subsubsection:
indentAfterThisHeading: 0
level: 10
paragraph:
indentAfterThisHeading: 0
level: 11
subparagraph:
indentAfterThisHeading: 0
level: 12
I like indenting the sectioning, but not the definitions, and I feel like I never told latexindent to indent my definitions. Clearly, there is a gap between my expectations and the actual functionality.
The question now is: How do I tell latexindent not to apply to the definitions of sectioning commands?
latexindent.yamlthat turns off the switches for this fileindentAfterThisHeading: 0– cmhughes Jan 22 '24 at 12:43