
Eu tenho o seguinte arquivo que faz parte de uma das minhas classes personalizadas:
% actual latexindent output:
\DeclareDocumentCommand {\chapterformat} { } { \thechapter }
\DeclareDocumentCommand {\sectionformat} { } {\thesection}
\DeclareDocumentCommand \subsectionformat { } {\thesubsection}
\DeclareDocumentCommand \subsubsectionformat {} {\thesubsubsection}
\DeclareDocumentCommand \paragraphformat {} {\theparagraph}
\DeclareDocumentCommand \subparagraphformat {} {\thesubparagraph}
O código-fonte que você vê aqui é a saída exata após a execução do latexindent
. No entanto, em vez disso, eu esperaria ter uma saída como
% expected latexindent output:
\DeclareDocumentCommand {\chapterformat} { } { \thechapter }
\DeclareDocumentCommand {\sectionformat} { } {\thesection}
\DeclareDocumentCommand \subsectionformat { } {\thesubsection}
\DeclareDocumentCommand \subsubsectionformat {} {\thesubsubsection}
\DeclareDocumentCommand \paragraphformat {} {\theparagraph}
\DeclareDocumentCommand \subparagraphformat {} {\thesubparagraph}
Obviamente, latexindent
estou aplicando aqui as regras para recuo dos comandos de seccionamento, conforme minha configuração:
# 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
Gosto de recuar as seções, mas não as definições, e sinto que nunca disse latexindent
para recuar minhas definições. Claramente, há uma lacuna entre as minhas expectativas e a funcionalidade real.
A questão agora é: Como posso dizer latexindent
para não aplicar as definições dos comandos de seccionamento?
Responder1
Eu tenho o seguinte arquivo que faz parte de uma das minhas classes personalizadas
Dado que isso faz parte de um arquivo de classe, recomendo desligar o indentAfterHeadings
como em
latexindent.yaml
indentAfterHeadings:
chapter:
indentAfterThisHeading: 0
section:
indentAfterThisHeading: 0
subsection:
indentAfterThisHeading: 0
e então corra
latexindent.pl -l myfile.tex
Se você quiser chamar o yaml
arquivo de outra forma, diga marc.yaml
então você ligaria
latexindent.pl -l marc.yaml myfile.tex