Suppose I have the following code listing:
font/lm/.code={
\RequirePackage{fix-cm}
\RequirePackage[rm={lining=true}]{cfr-lm}
\RequirePackage{amsfonts, amssymb}
% Define tabular-lining figures and oldstyle windows
\providerobustcmd{\tablining}{\tlstyle}
\providerobustcmd{\propold}{\postyle}
% Define bold small caps for AC and other header labels
\providerobustcmd{\labelstyle}[#1]{}
% Define title style
\providerobustcmd{}[]{}
\RequirePackage{inconsolata}
},
Running latexindent.pl on this file with the default options as specified in defaultSettings.yaml gives this result:
font/lm/.code={
\RequirePackage{fix-cm}
\RequirePackage[rm={lining=true}]{cfr-lm}
\RequirePackage{amsfonts, amssymb}
% Define tabular-lining figures and oldstyle windows
\providerobustcmd{\tablining}{\tlstyle}
\providerobustcmd{\propold}{\postyle}
% Define bold small caps for AC and other header labels
\providerobustcmd{\labelstyle}[#1]{}
% Define title style
\providerobustcmd{}[]{}
\RequirePackage{inconsolata}
},
Ideally, I'd like the indent of the closing brace } to be on the same level as the font/lm/... line, and the argument within the braces, i.e. the various \RequirePackages and the providerobustcmd{}... to be indented by four spaces, similar to the function bodies of C-style languages:
int main() {
// code
}
Of course, I'd like to extend this to optional arguments as well—this would be particularly useful when typesetting tikzpicture/pgfplots environments, where there are easily tens of arguments within the square brackets.
keyEqualsValuesBracesBrackets: 1. See https://latexindentpl.readthedocs.io/en/latest/sec-default-user-local.html#noadditionalindent-and-indentrules and also https://latexindentpl.readthedocs.io/en/latest/sec-default-user-local.html#keyequalsvaluesbracesbrackets for reference. – cmhughes Jul 19 '20 at 19:57