
내 사용자 정의 클래스 중 하나의 일부인 다음 파일이 있습니다.
% actual latexindent output:
\DeclareDocumentCommand {\chapterformat} { } { \thechapter }
\DeclareDocumentCommand {\sectionformat} { } {\thesection}
\DeclareDocumentCommand \subsectionformat { } {\thesubsection}
\DeclareDocumentCommand \subsubsectionformat {} {\thesubsubsection}
\DeclareDocumentCommand \paragraphformat {} {\theparagraph}
\DeclareDocumentCommand \subparagraphformat {} {\thesubparagraph}
여기에 표시되는 소스 코드는 를 실행한 후의 정확한 출력입니다 latexindent
. 그러나 대신 다음과 같은 출력이 나올 것으로 예상됩니다.
% expected latexindent output:
\DeclareDocumentCommand {\chapterformat} { } { \thechapter }
\DeclareDocumentCommand {\sectionformat} { } {\thesection}
\DeclareDocumentCommand \subsectionformat { } {\thesubsection}
\DeclareDocumentCommand \subsubsectionformat {} {\thesubsubsection}
\DeclareDocumentCommand \paragraphformat {} {\theparagraph}
\DeclareDocumentCommand \subparagraphformat {} {\thesubparagraph}
분명히 latexindent
내 구성에 따라 여기에서 섹션 명령 들여쓰기 규칙을 적용하고 있습니다.
# 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
latexindent
나는 섹션 들여쓰기를 좋아하지만 정의는 좋아하지 않습니다. 그리고 정의를 들여쓰라고 말한 적이 없는 것 같습니다 . 분명히 내 기대와 실제 기능 사이에는 차이가 있습니다.
이제 문제는: latexindent
섹션화 명령의 정의에 적용하지 않도록 어떻게 알 수 있습니까?
답변1
내 사용자 정의 클래스 중 하나의 일부인 다음 파일이 있습니다.
indentAfterHeadings
이것이 클래스 파일의 일부라는 점을 감안할 때 다음과 같이 스위치를 끄는 것이 좋습니다.
latexindent.yaml
indentAfterHeadings:
chapter:
indentAfterThisHeading: 0
section:
indentAfterThisHeading: 0
subsection:
indentAfterThisHeading: 0
그런 다음 실행
latexindent.pl -l myfile.tex
yaml
파일 이름을 다른 이름으로 지정하려면 marc.yaml
다음으로 전화하세요.
latexindent.pl -l marc.yaml myfile.tex