summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex')
-rw-r--r--Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex202
1 files changed, 116 insertions, 86 deletions
diff --git a/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex b/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
index e1a3f0d09c7..d5afdbe0cfb 100644
--- a/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
+++ b/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
@@ -22,7 +22,7 @@
latexindent.pl myfile
\end{commandshell}
\begin{wrapfigure}[8]{r}[0pt]{6cm}
- \cmhlistingsfromfile[style=fileExtensionPreference]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference}
+ \cmhlistingsfromfile[style=fileExtensionPreference]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileExtensionPreference}}{lst:fileExtensionPreference}
\end{wrapfigure}
in which case the script will look for \texttt{myfile} with the extensions
@@ -78,19 +78,31 @@ copy myfile.bak4 to myfile.bak3
The default value of \texttt{cycleThroughBackUps} is \texttt{0}.
\yamltitle{logFilePreferences}*{fields}
- \begin{wrapfigure}[10]{r}[0pt]{9cm}
- \cmhlistingsfromfile[style=logFilePreferences,]{../defaultSettings.yaml}[width=.85\linewidth,before=\centering,yaml-TCB]{\texttt{logFilePreferences}}{lst:logFilePreferences}
- \end{wrapfigure}
\texttt{latexindent.pl} writes information to \texttt{indent.log}, some
of which can be customized by changing \texttt{logFilePreferences}; see \cref{lst:logFilePreferences}.
If you load your own user settings (see \vref{sec:indentconfig}) then \texttt{latexindent.pl} will
detail them in \texttt{indent.log}; you can choose not to have the details logged by switching
\texttt{showEveryYamlRead} to \texttt{0}. Once all of your settings have
been loaded, you can see the amalgamated settings in the log file by switching \texttt{showAmalgamatedSettings}
- to \texttt{1}, if you wish. The log file will end with the characters
+ to \texttt{1}, if you wish.
+
+ \cmhlistingsfromfile*[style=logFilePreferences,]*{../defaultSettings.yaml}[width=.9\linewidth,before=\centering,yaml-TCB]{\texttt{logFilePreferences}}{lst:logFilePreferences}
+
+ When%
+ \announce*{2018-01-13}{showDecorationStartCodeBlockTrace feature for log file} either of the \texttt{trace} modes (see \cpageref{page:traceswitch})
+ are active, you will receive detailed information in \texttt{indent.log}. You can specify character strings
+ to appear before and after the notification of a found code block using, respectively, \texttt{showDecorationStartCodeBlockTrace}
+ and \texttt{showDecorationFinishCodeBlockTrace}. A demonstration is given in \vref{app:logfile-demo}.
+
+ The log file will end with the characters
given in \texttt{endLogFileWith}, and will report the \texttt{GitHub} address
of \texttt{latexindent.pl} to the log file if \texttt{showGitHubInfoFooter} is set to \texttt{1}.
+ \texttt{latexindent.pl}%
+ \announce*{2018-01-13}{log file pattern layout for log file} uses the \texttt{log4perl} module \cite{log4perl}
+ to handle the creation of the logfile. You can specify the layout of the information given in the logfile
+ using any of the \texttt{Log Layouts} detailed at \cite{log4perl}.
+
\yamltitle{verbatimEnvironments}*{fields}
A field that contains a list of environments
@@ -98,11 +110,11 @@ copy myfile.bak4 to myfile.bak3
on environments that you have specified in this field, see \cref{lst:verbatimEnvironments}.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[style=verbatimEnvironments]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimEnvironments}}{lst:verbatimEnvironments}
+ \cmhlistingsfromfile[style=verbatimEnvironments]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimEnvironments}}{lst:verbatimEnvironments}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[style=verbatimCommands]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimCommands}}{lst:verbatimCommands}
+ \cmhlistingsfromfile[style=verbatimCommands]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{verbatimCommands}}{lst:verbatimCommands}
\end{minipage}%
Note that if you put an environment in \texttt{verbatimEnvironments}
@@ -117,7 +129,7 @@ copy myfile.bak4 to myfile.bak3
\yamltitle{noIndentBlock}*{fields}
\begin{wrapfigure}[8]{r}[0pt]{6cm}
- \cmhlistingsfromfile[style=noIndentBlock]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noIndentBlock}}{lst:noIndentBlock}
+ \cmhlistingsfromfile[style=noIndentBlock]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{noIndentBlock}}{lst:noIndentBlock}
\end{wrapfigure}
If you have a block of code that you don't want \texttt{latexindent.pl} to touch (even if it is \emph{not} a verbatim-like
environment) then you can wrap it in an environment from \texttt{noIndentBlock};
@@ -142,7 +154,7 @@ copy myfile.bak4 to myfile.bak3
\yamltitle{removeTrailingWhitespace}*{fields}\label{yaml:removeTrailingWhitespace}
\begin{wrapfigure}[10]{r}[0pt]{7cm}
- \cmhlistingsfromfile[style=removeTrailingWhitespace]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{removeTrailingWhitespace}{lst:removeTrailingWhitespace}
+ \cmhlistingsfromfile[style=removeTrailingWhitespace]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{removeTrailingWhitespace}{lst:removeTrailingWhitespace}
\vspace{.1cm}
\begin{yaml}[numbers=none]{removeTrailingWhitespace (alt)}[width=.8\linewidth,before=\centering]{lst:removeTrailingWhitespace-alt}
@@ -161,7 +173,7 @@ removeTrailingWhitespace: 1
\yamltitle{fileContentsEnvironments}*{field}
\begin{wrapfigure}[6]{r}[0pt]{6cm}
- \cmhlistingsfromfile[style=fileContentsEnvironments]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileContentsEnvironments}}{lst:fileContentsEnvironments}
+ \cmhlistingsfromfile[style=fileContentsEnvironments]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{fileContentsEnvironments}}{lst:fileContentsEnvironments}
\end{wrapfigure}
Before \texttt{latexindent.pl} determines the difference between preamble (if any) and the main document,
it first searches for any of the environments specified in \texttt{fileContentsEnvironments}, see
@@ -179,7 +191,7 @@ removeTrailingWhitespace: 1
\yamltitle{lookForPreamble}*{fields}
\begin{wrapfigure}[8]{r}[0pt]{5cm}
- \cmhlistingsfromfile[style=lookForPreamble]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{lookForPreamble}{lst:lookForPreamble}
+ \cmhlistingsfromfile[style=lookForPreamble]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{lookForPreamble}{lst:lookForPreamble}
\end{wrapfigure}
Not all files contain preamble; for example, \texttt{sty}, \texttt{cls} and \texttt{bib} files typically do \emph{not}. Referencing
\cref{lst:lookForPreamble}, if you set, for example, \texttt{.tex} to \texttt{0}, then regardless of the setting of the value of \texttt{indentPreamble}, preamble
@@ -205,7 +217,7 @@ postfoothook=\end{mdframed},
If you're interested in experimenting with \texttt{latexindent.pl} then you
can \emph{remove} all indentation by setting \texttt{defaultIndent: ""}.
-\yamltitle{lookForAlignDelims}*{fields}
+\yamltitle{lookForAlignDelims}*{fields}\label{yaml:lookforaligndelims}
\begin{wrapfigure}[12]{r}[0pt]{5cm}
\begin{yaml}[numbers=none]{\texttt{lookForAlignDelims} (basic)}[width=.8\linewidth,before=\centering]{lst:aligndelims:basic}
lookForAlignDelims:
@@ -232,101 +244,119 @@ lookForAlignDelims:
instances of the environment, you could wrap them in something from \texttt{noIndentBlock} (see \vref{lst:noIndentBlock}).
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic}
+ \cmhlistingsfromfile{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:basic}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic}
+ \cmhlistingsfromfile{demonstrations/tabular1-default.tex}{\texttt{tabular1.tex} default output}{lst:tabularafter:basic}
\end{minipage}%
- If you wish to remove the alignment of the \lstinline!\\! within a delimiter-aligned block, then the
+ If, for example, you wish to remove the alignment of the \lstinline!\\! within a delimiter-aligned block, then the
advanced form of \texttt{lookForAlignDelims} shown in \cref{lst:aligndelims:advanced} is for you.
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular.yaml}[yaml-TCB]{\texttt{tabular.yaml}}{lst:aligndelims:advanced}
+ \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular.yaml}[yaml-TCB]{\texttt{tabular.yaml}}{lst:aligndelims:advanced}
Note that you can use a mixture of the basic and advanced form: in \cref{lst:aligndelims:advanced} \texttt{tabular} and \texttt{tabularx}
are advanced and \texttt{longtable} is basic. When using the advanced form, each field should receive at least 1 sub-field, and \emph{can}
(but does not have to) receive any of the following fields:
\begin{itemize}
- \item \texttt{delims}: switch equivalent to simply specifying, for example, \texttt{tabular: 1} in
- the basic version shown in \cref{lst:aligndelims:basic} (default: 1);
- \item \texttt{alignDoubleBackSlash}: switch to determine if \lstinline!\\! should be aligned (default: 1);
- \item \texttt{spacesBeforeDoubleBackSlash}: optionally, specifies the number of spaces to be inserted
- before (non-aligned) \lstinline!\\!. In order to use this field, \texttt{alignDoubleBackSlash} needs
- to be set to 0 (default: 0).
- \item \announce{2017-06-19}{multiColumnGrouping} \texttt{multiColumnGrouping}: details if \texttt{latexindent.pl} should group columns
- underneath a \lstinline!\multicolumn! command (default: 0);
- \item \announce{2017-06-19}{alignRowsWithoutMaxDelims} \texttt{alignRowsWithoutMaxDelims}: details if rows that do not contain the
- maximum number of delimeters should be formatted so as to have the ampersands aligned (default: 1).
+ \item \texttt{delims}: binary switch (0 or 1) equivalent to simply specifying, for example, \texttt{tabular: 1} in
+ the basic version shown in \cref{lst:aligndelims:basic}. If \texttt{delims} is set to \texttt{0} then the align at ampersand routine
+ will not be called for this code block (default: 1);
+ \item \texttt{alignDoubleBackSlash}: binary switch (0 or 1) to determine if \lstinline!\\! should be aligned (default: 1);
+ \item \texttt{spacesBeforeDoubleBackSlash}: optionally,%
+ \announce*{2018-01-13}*{update to spacesBeforeDoubleBackSlash in ampersand alignment} specifies the number (integer $\geq$ 0) of spaces to be inserted
+ before \lstinline!\\! (default: 1). \footnote{Previously this only activated if \texttt{alignDoubleBackSlash} was set to \texttt{0}.}
+ \item \announce{2017-06-19}{multiColumnGrouping} \texttt{multiColumnGrouping}: binary switch (0 or 1) that details if \texttt{latexindent.pl} should group columns
+ above and below a \lstinline!\multicolumn! command (default: 0);
+ \item \announce{2017-06-19}{alignRowsWithoutMaxDelims} \texttt{alignRowsWithoutMaxDelims}: binary switch (0 or 1) that details if rows that do not contain the
+ maximum number of delimeters should be formatted so as to have the ampersands aligned (default: 1);
+ \item \announce*{2018-01-13}{spacesBeforeAmpersand in ampersand alignment}\texttt{spacesBeforeAmpersand}: optionally specifies the number (integer $\geq$ 0) of
+ spaces to be placed \emph{before} ampersands (default: 1);
+ \item \announce*{2018-01-13}{spacesAfterAmpersand in ampersand alignment}\texttt{spacesAfterAmpersand}: optionally specifies the number (integer $\geq$ 0) of
+ spaces to be placed \emph{After} ampersands (default: 1);
+ \item \announce*{2018-01-13}{justification of cells in ampersand alignment}\texttt{justification}: optionally specifies the justification of each cell as either \emph{left}
+ or \emph{right} (default: left).
\end{itemize}
- Assuming that you have the settings in \cref{lst:aligndelims:advanced} saved in \texttt{tabular.yaml}, and the code
- from \cref{lst:tabularbefore:basic} in \texttt{tabular1.tex} and you run
- \begin{commandshell}
-latexindent.pl -l tabular.yaml tabular1.tex
-\end{commandshell}
- then you should receive the before-and-after results shown in
- \cref{lst:tabularbefore:advanced,lst:tabularafter:advanced}; note that the ampersands have been aligned, but
- the \lstinline!\\! have not (compare the alignment of \lstinline!\\! in \cref{lst:tabularafter:basic,lst:tabularafter:advanced}).
+ We will explore each of these features using the file \texttt{tabular2.tex} in \cref{lst:tabular2} (which contains a \lstinline!\multicolumn! command),
+ and the YAML files in \crefrange{lst:tabular2YAML}{lst:tabular8YAML}.
+ \cmhlistingsfromfile{demonstrations/tabular2.tex}{\texttt{tabular2.tex}}{lst:tabular2}
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1.tex}{\texttt{tabular1.tex}}{lst:tabularbefore:advanced}
+ \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/tabular2.yaml}[yaml-TCB]{\texttt{tabular2.yaml}}{lst:tabular2YAML}
\end{minipage}%
\hfill
- \begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1-advanced.tex}{\texttt{tabular1.tex} using \cref{lst:aligndelims:advanced}}{lst:tabularafter:advanced}
+ \begin{minipage}{.48\textwidth}
+ \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/tabular3.yaml}[yaml-TCB]{\texttt{tabular3.yaml}}{lst:tabular3YAML}
\end{minipage}%
- Saving \cref{lst:aligndelims:advanced} into \texttt{tabular1.yaml} as in \cref{lst:tabular1YAML}, and running the command
- \begin{commandshell}
-latexindent.pl -l tabular1.yaml tabular1.tex
-\end{commandshell}
- gives \cref{lst:tabularafter:spacing}; note the spacing before the \lstinline!\\!.
-
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular1-advanced-3spaces.tex}{\texttt{tabular1.tex} using \cref{lst:tabular1YAML}}{lst:tabularafter:spacing}
+ \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular4.yaml}[yaml-TCB]{\texttt{tabular4.yaml}}{lst:tabular4YAML}
\end{minipage}%
\hfill
- \begin{minipage}{.54\textwidth}
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular1.yaml}[yaml-TCB]{\texttt{tabular1.yaml}}{lst:tabular1YAML}
+ \begin{minipage}{.48\textwidth}
+ \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular5.yaml}[yaml-TCB]{\texttt{tabular5.yaml}}{lst:tabular5YAML}
\end{minipage}%
- Now consider the file \texttt{tabular2.tex} in \cref{lst:tabular2}, which contains a \lstinline!\multicolumn! command, and
- the YAML files in \cref{lst:tabular2YAML,lst:tabular3YAML}.
-
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2.tex}{\texttt{tabular2.tex}}{lst:tabular2}
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular2.yaml}[yaml-TCB]{\texttt{tabular2.yaml}}{lst:tabular2YAML}
+ \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular6.yaml}[yaml-TCB]{\texttt{tabular6.yaml}}{lst:tabular6YAML}
\end{minipage}%
\hfill
- \begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tabular3.yaml}[yaml-TCB]{\texttt{tabular3.yaml}}{lst:tabular3YAML}
+ \begin{minipage}{.48\textwidth}
+ \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular7.yaml}[yaml-TCB]{\texttt{tabular7.yaml}}{lst:tabular7YAML}
+ \end{minipage}%
+
+ \begin{minipage}{.48\textwidth}
+ \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/tabular8.yaml}[yaml-TCB]{\texttt{tabular8.yaml}}{lst:tabular8YAML}
\end{minipage}%
On running the commands
\begin{commandshell}
latexindent.pl tabular2.tex
-latexindent.pl -s tabular2.tex -l tabular2.yaml
-latexindent.pl -s tabular2.tex -l tabular3.yaml
+latexindent.pl tabular2.tex -l tabular2.yaml
+latexindent.pl tabular2.tex -l tabular3.yaml
+latexindent.pl tabular2.tex -l tabular2.yaml,tabular4.yaml
+latexindent.pl tabular2.tex -l tabular2.yaml,tabular5.yaml
+latexindent.pl tabular2.tex -l tabular2.yaml,tabular6.yaml
+latexindent.pl tabular2.tex -l tabular2.yaml,tabular7.yaml
+latexindent.pl tabular2.tex -l tabular2.yaml,tabular8.yaml
\end{commandshell}
- we obtain the respective outputs given in \cref{lst:tabular2-default,lst:tabular2-mc,lst:tabular2-no-max}.
+ we obtain the respective outputs given in \crefrange{lst:tabular2-default}{lst:tabular2-mod8}.
\begin{widepage}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2-default.tex}{\texttt{tabular2-default.tex}}{lst:tabular2-default}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2-mc.tex}{\texttt{tabular2-mc.tex}}{lst:tabular2-mc}
- \cmhlistingsfromfile[showspaces=false,showtabs=false]*{demonstrations/tabular2-no-max.tex}{\texttt{tabular2-no-max.tex}}{lst:tabular2-no-max}
+ \cmhlistingsfromfile*{demonstrations/tabular2-default.tex}{\texttt{tabular2.tex} default output}{lst:tabular2-default}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod2.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML}}{lst:tabular2-mod2}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod3.tex}{\texttt{tabular2.tex} using \cref{lst:tabular3YAML}}{lst:tabular2-mod3}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod4.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular4YAML}}{lst:tabular2-mod4}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod5.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular5YAML}}{lst:tabular2-mod5}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod6.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular6YAML}}{lst:tabular2-mod6}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod7.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular7YAML}}{lst:tabular2-mod7}
+ \cmhlistingsfromfile*{demonstrations/tabular2-mod8.tex}{\texttt{tabular2.tex} using \cref{lst:tabular2YAML,lst:tabular8YAML}}{lst:tabular2-mod8}
\end{widepage}
Notice in particular:
\begin{itemize}
- \item in both \cref{lst:tabular2-default,lst:tabular2-mc} all rows have been aligned at the ampersand, even
+ \item in both \cref{lst:tabular2-default,lst:tabular2-mod2} all rows have been aligned at the ampersand, even
those that do not contain the maximum number of ampersands (3 ampersands, in this case);
\item in \cref{lst:tabular2-default} the columns have been aligned at the ampersand;
- \item in \cref{lst:tabular2-mc} the \lstinline!\multicolumn! command has grouped the $2$ columns beneath \emph{and} above it,
+ \item in \cref{lst:tabular2-mod2} the \lstinline!\multicolumn! command has grouped the $2$ columns beneath \emph{and} above it,
because \texttt{multiColumnGrouping} is set to $1$ in \cref{lst:tabular2YAML};
- \item in \cref{lst:tabular2-no-max} rows~3 and~6 have \emph{not} been aligned at the ampersand, because
+ \item in \cref{lst:tabular2-mod3} rows~3 and~6 have \emph{not} been aligned at the ampersand, because
\texttt{alignRowsWithoutMaxDelims} has been to set to $0$ in \cref{lst:tabular3YAML}; however,
- the \lstinline!\\! \emph{have} still been aligned.
+ the \lstinline!\\! \emph{have} still been aligned;
+ \item in \cref{lst:tabular2-mod4} the columns beneath and above the \lstinline!\multicolumn! commands have been
+ grouped (because \texttt{multiColumnGrouping} is set to $1$), and there are at least $4$ spaces \emph{before}
+ each aligned ampersand because \texttt{spacesBeforeAmpersand} is set to $4$;
+ \item in \cref{lst:tabular2-mod5} the columns beneath and above the \lstinline!\multicolumn! commands have been
+ grouped (because \texttt{multiColumnGrouping} is set to $1$), and there are at least $4$ spaces \emph{after}
+ each aligned ampersand because \texttt{spacesAfterAmpersand} is set to $4$;
+ \item in \cref{lst:tabular2-mod6} the \lstinline!\\! have \emph{not} been aligned, because \texttt{alignDoubleBackSlash}
+ is set to \texttt{0}, otherwise the output is the same as \cref{lst:tabular2-mod2};
+ \item in \cref{lst:tabular2-mod7} the \lstinline!\\! \emph{have} been aligned, and because \texttt{spacesBeforeDoubleBackSlash}
+ is set to \texttt{0}, there are no spaces ahead of them; the output is otherwise the same as \cref{lst:tabular2-mod2}.
+ \item in \cref{lst:tabular2-mod8} the cells have been \emph{right}-justified; note that cells above and below the \lstinline!\multicol!
+ statements have still been group correctly, because of the settings in \cref{lst:tabular2YAML}.
\end{itemize}
As of Version 3.0, the alignment routine works on mandatory and optional arguments within commands, and also within `special' code blocks
@@ -340,11 +370,11 @@ latexindent.pl matrix1.tex
shown in \cref{lst:matrixbefore,lst:matrixafter} are achievable by default.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[columns=fixed]{demonstrations/matrix1.tex}{\texttt{matrix1.tex}}{lst:matrixbefore}
+ \cmhlistingsfromfile{demonstrations/matrix1.tex}{\texttt{matrix1.tex}}{lst:matrixbefore}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[columns=fixed]{demonstrations/matrix1-default.tex}{\texttt{matrix1.tex} default output}{lst:matrixafter}
+ \cmhlistingsfromfile{demonstrations/matrix1-default.tex}{\texttt{matrix1.tex} default output}{lst:matrixafter}
\end{minipage}%
If you have blocks of code that you wish to align at the \& character that
@@ -355,11 +385,11 @@ latexindent.pl matrix1.tex
environment name that you have specified in \texttt{lookForAlignDelims}.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[columns=fixed]{demonstrations/align-block.tex}{\texttt{align-block.tex}}{lst:alignmentmarkup}
+ \cmhlistingsfromfile{demonstrations/align-block.tex}{\texttt{align-block.tex}}{lst:alignmentmarkup}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[columns=fixed]{demonstrations/align-block-default.tex}{\texttt{align-block.tex} default output}{lst:alignmentmarkup-default}
+ \cmhlistingsfromfile{demonstrations/align-block-default.tex}{\texttt{align-block.tex} default output}{lst:alignmentmarkup-default}
\end{minipage}%
With reference to \vref{tab:code-blocks} and the, yet undiscussed, fields of \texttt{noAdditionalIndent} and \texttt{indentRules}
@@ -367,7 +397,7 @@ latexindent.pl matrix1.tex
\yamltitle{indentAfterItems}*{fields}
\begin{wrapfigure}[5]{r}[0pt]{7cm}
- \cmhlistingsfromfile[style=indentAfterItems]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterItems}}{lst:indentafteritems}
+ \cmhlistingsfromfile[style=indentAfterItems]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterItems}}{lst:indentafteritems}
\end{wrapfigure}
The environment names specified in \texttt{indentAfterItems} tell
\texttt{latexindent.pl} to look for \lstinline!\item! commands; if these switches are set to \texttt{1}
@@ -384,7 +414,7 @@ latexindent.pl matrix1.tex
\yamltitle{itemNames}*{fields}
\begin{wrapfigure}[5]{r}[0pt]{5cm}
- \cmhlistingsfromfile[style=itemNames]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{itemNames}}{lst:itemNames}
+ \cmhlistingsfromfile[style=itemNames]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{itemNames}}{lst:itemNames}
\end{wrapfigure}
If you have your own \texttt{item} commands (perhaps you
prefer to use \texttt{myitem}, for example)
@@ -396,11 +426,11 @@ latexindent.pl matrix1.tex
\yamltitle{specialBeginEnd}*{fields}\label{yaml:specialBeginEnd}
The fields specified%
- \announce*{2017-08-21}*{specialBeginEnd} in \texttt{specialBeginEnd} are, in their default state, focused on math mode begin and end statements, but
+ \announce{2017-08-21}*{specialBeginEnd} in \texttt{specialBeginEnd} are, in their default state, focused on math mode begin and end statements, but
there is no requirement for this to be the case; \cref{lst:specialBeginEnd} shows the
default settings of \texttt{specialBeginEnd}.
- \cmhlistingsfromfile*[style=specialBeginEnd]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeginEnd}}{lst:specialBeginEnd}
+ \cmhlistingsfromfile[style=specialBeginEnd]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeginEnd}}{lst:specialBeginEnd}
The field \texttt{displayMath} represents \lstinline!\[...\]!, \texttt{inlineMath} represents
\lstinline!$...$! and \texttt{displayMathTex} represents \lstinline!$$...$$!. You can, of course,
@@ -422,20 +452,20 @@ latexindent.pl matrix1.tex
\texttt{lookForThis} to \texttt{0}.
There are%
- \announce*{2017-08-21}{specialBeforeCommand} examples in which it is advantageous to search for \texttt{specialBeginEnd} fields \emph{before}
+ \announce{2017-08-21}{specialBeforeCommand} examples in which it is advantageous to search for \texttt{specialBeginEnd} fields \emph{before}
searching for commands, and the \texttt{specialBeforeCommand} switch controls this behaviour. For example, consider
the file shown in \cref{lst:specialLRbefore}.
- \cmhlistingsfromfile*{demonstrations/specialLR.tex}{\texttt{specialLR.tex}}{lst:specialLRbefore}
+ \cmhlistingsfromfile{demonstrations/specialLR.tex}{\texttt{specialLR.tex}}{lst:specialLRbefore}
Now consider the YAML files shown in \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml}
\begin{minipage}{.49\linewidth}
- \cmhlistingsfromfile*{demonstrations/specialsLeftRight.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialsLeftRight.yaml}}{lst:specialsLeftRight-yaml}
+ \cmhlistingsfromfile[]*{demonstrations/specialsLeftRight.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialsLeftRight.yaml}}{lst:specialsLeftRight-yaml}
\end{minipage}
\hfill
\begin{minipage}{.49\linewidth}
- \cmhlistingsfromfile*{demonstrations/specialBeforeCommand.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeforeCommand.yaml}}{lst:specialBeforeCommand-yaml}
+ \cmhlistingsfromfile[]*{demonstrations/specialBeforeCommand.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{specialBeforeCommand.yaml}}{lst:specialBeforeCommand-yaml}
\end{minipage}
Upon running the following commands
@@ -448,11 +478,11 @@ latexindent.pl specialLR.tex -l=specialsLeftRight.yaml,specialBeforeCommand.yaml
we receive the respective outputs in \cref{lst:specialLR-comm-first-tex,lst:specialLR-special-first-tex}.
\begin{minipage}{.49\linewidth}
- \cmhlistingsfromfile*{demonstrations/specialLR-comm-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml}}{lst:specialLR-comm-first-tex}
+ \cmhlistingsfromfile{demonstrations/specialLR-comm-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml}}{lst:specialLR-comm-first-tex}
\end{minipage}
\hfill
\begin{minipage}{.49\linewidth}
- \cmhlistingsfromfile*{demonstrations/specialLR-special-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml}}{lst:specialLR-special-first-tex}
+ \cmhlistingsfromfile{demonstrations/specialLR-special-first.tex}{\texttt{specialLR.tex} using \cref{lst:specialsLeftRight-yaml,lst:specialBeforeCommand-yaml}}{lst:specialLR-special-first-tex}
\end{minipage}
Notice that in:
@@ -464,7 +494,7 @@ latexindent.pl specialLR.tex -l=specialsLeftRight.yaml,specialBeforeCommand.yaml
\yamltitle{indentAfterHeadings}*{fields}
\begin{wrapfigure}[17]{r}[0pt]{8cm}
- \cmhlistingsfromfile[style=indentAfterHeadings]{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterHeadings}}{lst:indentAfterHeadings}
+ \cmhlistingsfromfile[style=indentAfterHeadings]*{../defaultSettings.yaml}[width=.8\linewidth,before=\centering,yaml-TCB]{\texttt{indentAfterHeadings}}{lst:indentAfterHeadings}
\end{wrapfigure}
This field enables the user to specify
indentation rules that take effect after heading commands such as \lstinline!\part!, \lstinline!\chapter!,
@@ -487,7 +517,7 @@ latexindent.pl specialLR.tex -l=specialsLeftRight.yaml,specialBeforeCommand.yaml
and that you have the text from \cref{lst:headings1} saved into \texttt{headings1.tex}.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/headings1.yaml}[yaml-TCB]{\texttt{headings1.yaml}}{lst:headings1yaml}
+ \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/headings1.yaml}[yaml-TCB]{\texttt{headings1.yaml}}{lst:headings1yaml}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
@@ -501,11 +531,11 @@ latexindent.pl headings1.tex -l=headings1.yaml
then you should receive the output given in \cref{lst:headings1-mod1}.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile{demonstrations/headings1-mod1.tex}{\texttt{headings1.tex} using \cref{lst:headings1yaml}}{lst:headings1-mod1}
+ \cmhlistingsfromfile[showtabs=true]{demonstrations/headings1-mod1.tex}{\texttt{headings1.tex} using \cref{lst:headings1yaml}}{lst:headings1-mod1}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile{demonstrations/headings1-mod2.tex}{\texttt{headings1.tex} second modification}{lst:headings1-mod2}
+ \cmhlistingsfromfile[showtabs=true]{demonstrations/headings1-mod2.tex}{\texttt{headings1.tex} second modification}{lst:headings1-mod2}
\end{minipage}
Now say that you modify the \texttt{YAML} from \cref{lst:headings1yaml} so that the \texttt{paragraph} \texttt{level} is \texttt{1}; after
@@ -518,7 +548,7 @@ latexindent.pl headings1.tex -l=headings1.yaml
\yamltitle{maximumIndentation}*{horizontal space}
You can control the maximum indentation given to your file by%
- \announce*{2017-08-21}{maximumIndentation}
+ \announce{2017-08-21}{maximumIndentation}
specifying the \texttt{maximumIndentation} field as horizontal space (but \emph{not} including tabs).
This feature uses the \texttt{Text::Tabs} module \cite{texttabs}, and is \emph{off}
by default.
@@ -527,11 +557,11 @@ latexindent.pl headings1.tex -l=headings1.yaml
shown in \cref{lst:mult-nested-default}.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile*{demonstrations/mult-nested.tex}{\texttt{mult-nested.tex}}{lst:mult-nested}
+ \cmhlistingsfromfile{demonstrations/mult-nested.tex}{\texttt{mult-nested.tex}}{lst:mult-nested}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile*{demonstrations/mult-nested-default.tex}{\texttt{mult-nested.tex} default output}{lst:mult-nested-default}
+ \cmhlistingsfromfile[showtabs=true]{demonstrations/mult-nested-default.tex}{\texttt{mult-nested.tex} default output}{lst:mult-nested-default}
\end{minipage}
Now say that, for example, you have the \texttt{max-indentation1.yaml} from \cref{lst:max-indentation1yaml} and
@@ -542,11 +572,11 @@ latexindent.pl mult-nested.tex -l=max-indentation1
You should receive the output shown in \cref{lst:mult-nested-max-ind1}.
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/max-indentation1.yaml}[yaml-TCB]{\texttt{max-indentation1.yaml}}{lst:max-indentation1yaml}
+ \cmhlistingsfromfile[style=yaml-LST]*{demonstrations/max-indentation1.yaml}[yaml-TCB]{\texttt{max-indentation1.yaml}}{lst:max-indentation1yaml}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \cmhlistingsfromfile*{demonstrations/mult-nested-max-ind1.tex}{\texttt{mult-nested.tex} using \cref{lst:max-indentation1yaml}}{lst:mult-nested-max-ind1}
+ \cmhlistingsfromfile[showspaces=true]{demonstrations/mult-nested-max-ind1.tex}{\texttt{mult-nested.tex} using \cref{lst:max-indentation1yaml}}{lst:mult-nested-max-ind1}
\end{minipage}
Comparing the output in \cref{lst:mult-nested-default,lst:mult-nested-max-ind1} we notice that the (default) tabs