diff options
Diffstat (limited to 'Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex')
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex b/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex index cb2d0999945..7ed4d4eaeb3 100644 --- a/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex +++ b/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex @@ -6,9 +6,8 @@ \yamltitle{commandCodeBlocks}*{fields} - The \texttt{commandCodeBlocks} field% - \announce{2018-04-27}*{commandCodeBlocks} contains a few switches detailed in - \cref{lst:commandCodeBlocks}. + The \texttt{commandCodeBlocks} field \announce{2018-04-27}*{commandCodeBlocks} contains a + few switches detailed in \cref{lst:commandCodeBlocks}.% \cmhlistingsfromfile[style=commandCodeBlocks]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{commandCodeBlocks}}{lst:commandCodeBlocks} @@ -54,12 +53,11 @@ latexindent.pl pstricks1.tex -l noRoundParentheses.yaml Notice the difference between \cref{lst:pstricks1-default} and \cref{lst:pstricks1-nrp}; in particular, in \cref{lst:pstricks1-nrp}, because round parentheses are \emph{not} - allowed, \texttt{latexindent.pl} finds that the - \lstinline!\defFunction! command finishes at the first opening round parenthesis. As - such, the remaining braced, mandatory, arguments are found to be - \texttt{UnNamedGroupingBracesBrackets} (see \vref{tab:code-blocks}) which, by default, - assume indentation for their body, and hence the tabbed indentation in - \cref{lst:pstricks1-nrp}. + allowed, \texttt{latexindent.pl} finds that the \lstinline!\defFunction! command finishes + at the first opening round parenthesis. As such, the remaining braced, mandatory, + arguments are found to be \texttt{UnNamedGroupingBracesBrackets} (see + \vref{tab:code-blocks}) which, by default, assume indentation for their body, and hence + the tabbed indentation in \cref{lst:pstricks1-nrp}. Let's explore this using the YAML given in \cref{lst:defFunction} and run the command \index{switches!-l demonstration} @@ -128,8 +126,7 @@ latexindent.pl tikz-node1.tex -l draw.yaml specified in \cref{lst:draw}. Let's compare this with the output from using the YAML settings in \cref{lst:no-strings}, - and running the command - \index{switches!-l demonstration} + and running the command \index{switches!-l demonstration} \begin{commandshell} latexindent.pl tikz-node1.tex -l no-strings.yaml \end{commandshell} @@ -151,13 +148,13 @@ latexindent.pl tikz-node1.tex -l no-strings.yaml with argument \lstinline![below,align=left,scale=0.5]! \end{itemize} - Referencing \vref{lst:commandCodeBlocks},% - \announce{2018-04-27}*{amalgamate feature in commandCodeBlocks}, we see that the first - field in the \texttt{stringsAllowedBetweenArguments} is \texttt{amalgamate} and is set to - \texttt{1} by default. This is for users who wish to specify their settings in multiple - YAML files. For example, by using the settings in either \cref{lst:amalgamate-demo} + Referencing \vref{lst:commandCodeBlocks}, \announce{2018-04-27}*{amalgamate feature in + commandCodeBlocks}, we see that the first field in the + \texttt{stringsAllowedBetweenArguments} is \texttt{amalgamate} and is set to \texttt{1} + by default. This is for users who wish to specify their settings in multiple YAML files. + For example, by using the settings in either \cref{lst:amalgamate-demo} or\cref{lst:amalgamate-demo1} is equivalent to using the settings in - \cref{lst:amalgamate-demo2}. + \cref{lst:amalgamate-demo2}.% \begin{cmhtcbraster}[raster columns=3, raster left skip=-3.5cm, @@ -188,8 +185,7 @@ latexindent.pl tikz-node1.tex -l no-strings.yaml \end{cmhtcbraster} Let's compare this with the output from using the YAML settings in \cref{lst:foreach}, - and running the command - \index{switches!-l demonstration} + and running the command \index{switches!-l demonstration} \begin{commandshell} latexindent.pl for-each.tex -l foreach.yaml \end{commandshell} @@ -205,18 +201,17 @@ latexindent.pl for-each.tex -l foreach.yaml \texttt{foreach} command has not included any of the subsequent strings, and that the braces have been treated as a \texttt{namedGroupingBracesBrackets}. In \cref{lst:for-each-mod1} the \texttt{foreach} command has been allowed to have - \lstinline!\x/\y! and \texttt{in} between arguments because of the settings given - in \cref{lst:foreach}. + \lstinline!\x/\y! and \texttt{in} between arguments because of the settings given in + \cref{lst:foreach}. \yamltitle{commandNameSpecial}*{fields} - There are some special command names% - \announce{2018-04-27}*{commandNameSpecial} that do not fit within the names recognised by - \texttt{latexindent.pl}, the first one of which is \lstinline!\@ifnextchar[!. From the - perspective of \texttt{latexindent.pl}, the whole of the text \lstinline!\@ifnextchar[! - is a command, because it is immediately followed by sets of mandatory arguments. However, - without the \texttt{commandNameSpecial} field, \texttt{latexindent.pl} would not be able - to label it as such, because the \lstinline![! is, necessarily, not matched by a closing - \lstinline!]!. + There are some special command names \announce{2018-04-27}*{commandNameSpecial} that do + not fit within the names recognised by \texttt{latexindent.pl}, the first one of which is + \lstinline!\@ifnextchar[!. From the perspective of \texttt{latexindent.pl}, the whole of + the text \lstinline!\@ifnextchar[! is a command, because it is immediately followed by + sets of mandatory arguments. However, without the \texttt{commandNameSpecial} field, + \texttt{latexindent.pl} would not be able to label it as such, because the \lstinline![! + is, necessarily, not matched by a closing \lstinline!]!.% For example, consider the sample file in \cref{lst:ifnextchar}, which has default output in \cref{lst:ifnextchar-default}. @@ -246,8 +241,7 @@ latexindent.pl for-each.tex -l foreach.yaml The \texttt{amalgamate} field can be used for \texttt{commandNameSpecial}, just as for \texttt{stringsAllowedBetweenArguments}. The same condition holds as stated previously, - which we state again here: - \index{warning!amalgamate field} + which we state again here: \index{warning!amalgamate field} \begin{warning} It is important to note that the \texttt{amalgamate} field, if used, in either |