# # latexindent.pl, version 4.0, 2026-03-15 # a script that aims to beautify .tex, .sty, .cls files # # defaultSettings.yaml, the default settings for latexindent.pl # # documentation: https://latexindentpl.readthedocs.io/en/latest/ # communication: https://github.com/cmhughes/latexindent.pl # #--------------------------------------------------------------------------------------- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # See http://www.gnu.org/licenses/. # # Chris Hughes (cmhughes) # #--------------------------------------------------------------------------------------- # latexindent can be called to act on a file without using the file's extension, # latexindent myfile # in which case latexindent will look for, in order: # myfile.tex, myfile.sty, myfile.cls, myfile.bib fileExtensionPreference: .tex: 1 .sty: 2 .cls: 3 .bib: 4 # default file extension of backup file (if -w switch is active) # for example, if your .tex file is called # myfile.tex # backup file will be # myfile.bak backupExtension: .bak # only one backup per file: # 0: the number on the extension increments by 1 each time: # myfile.bak0, myfile.bak1, myfile.bak2 # 1: then the backup file will be overwritten each time onlyOneBackUp: 0 # maxNumberOfBackUps # 0 (or less) then infinitely many backups are possible, unless onlyOneBackUp: 1 # n (>0) at most n back-up files will be created maxNumberOfBackUps: 0 # some users may wish to cycle through back up files. # # for example, with maxNumberOfBackUps: 4, will perform the following # # copy myfile.bak1 to myfile.bak0 # copy myfile.bak2 to myfile.bak1 # copy myfile.bak3 to myfile.bak2 # copy myfile.bak4 to myfile.bak3 # # the back up will be written to myfile.bak4 cycleThroughBackUps: 0 # verbatim environments verbatimEnvironments: verbatim: 1 lstlisting: 1 minted: 1 # verbatim commands such as \verb! body !, \lstinline$something else$ verbatimCommands: verb: 1 lstinline: 1 # no indent blocks (not necessarily verbatim # environments) which are marked as %\begin{noindent} # or anything else that you detail in the following noIndentBlock: noindent: 1 cmhtest: 1 # \begin{document} and \end{document} are treated differently # by latexindent within filecontents environments fileContentsEnvironments: filecontents: 1 filecontents*: 1 # indent preamble indentPreamble: 0 # assume no preamble in cls, sty, by default lookForPreamble: .tex: 1 .sty: 0 .cls: 0 .bib: 0 STDIN: 1 # default value of indentation defaultIndent: "\t" # remove trailing whitespace from all lines removeTrailingWhitespace: beforeProcessing: 0 afterProcessing: 1 # name of code blocks that should have their body aligned at ampersand delimiters lookForAlignDelims: tabular: 1 tabularx: 1 longtable: 1 tabu: 1 array: 1 matrix: 1 listabla: 1 # amsmath align: 1 align*: 1 alignat: 1 alignat*: 1 aligned: 1 alignedat: 1 bmatrix: 1 Bmatrix: 1 cases: 1 flalign: 1 flalign*: 1 pmatrix: 1 split: 1 vmatrix: 1 Vmatrix: 1 # mathtools cases*: 1 dcases: 1 dcases*: 1 rcases: 1 rcases*: 1 drcases: 1 drcases*: 1 # nicematrix NiceTabular: 1 NiceMatrix: 1 pNiceMatrix: 1 bNiceMatrix: 1 BNiceMatrix: 1 vNiceMatrix: 1 VNiceMatrix: 1 NiceArray: 1 pNiceArrayC: 1 bNiceArrayC: 1 BNiceArrayC: 1 vNiceArrayC: 1 VNiceArrayC: 1 NiceArrayCwithDelims: 1 pNiceArrayRC: 1 bNiceArrayRC: 1 BNiceArrayRC: 1 vNiceArrayRC: 1 VNiceArrayRC: 1 NiceArrayRCwithDelims: 1 # tabularray tblr: 1 longtblr: 1 talltblr: 1 spreadtab: 1 # if you want the script to look for \item commands # and format it, as follows (for example), # \begin{itemize} # \item content here # next line is indented # next line is indented # \item another item # \end{itemize} # then populate indentAfterItems. See also itemNames indentAfterItems: itemize: 1 itemize*: 1 enumerate: 1 enumerate*: 1 description: 1 description*: 1 list: 1 # specialBeginEnd defaults are mathmode focus, but no restrictions specialBeginEnd: - amalgamate: 1 - name: displayMath begin: (?<]+ keyEqualsValuesBracesBrackets: name: [a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h:\#-]* arguments: between: |- (?x) (?: [_^*#0-9(),+-] | (?:node|at|to|decoration) | (?:\([^)]*\)) ) trailingComments: notPrecededBy: (? " # change dos line breaks into unix dos2unixlinebreaks: 0