texlive[60045] trunk: latexindent (24jul21)

commits+karl at tug.org commits+karl at tug.org
Sat Jul 24 22:49:15 CEST 2021


Revision: 60045
          http://tug.org/svn/texlive?view=revision&revision=60045
Author:   karl
Date:     2021-07-24 22:49:14 +0200 (Sat, 24 Jul 2021)
Log Message:
-----------
latexindent (24jul21)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
    trunk/Master/bin/win32/latexindent.exe
    trunk/Master/texmf-dist/doc/support/latexindent/README
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
    trunk/Master/texmf-dist/doc/support/latexindent/logo.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-conclusions-know-limitations.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
    trunk/Master/texmf-dist/doc/support/latexindent/title.tex
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
    trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
    trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl

Modified: trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)

Modified: trunk/Master/bin/win32/latexindent.exe
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README	2021-07-24 20:49:14 UTC (rev 60045)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    latexindent.pl, version 3.10, 2021-06-19
+    latexindent.pl, version 3.10.1, 2021-07-23
 
     PERL script to indent code within environments, and align delimited 
     environments in .tex files.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/logo.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/logo.tex	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/logo.tex	2021-07-24 20:49:14 UTC (rev 60045)
@@ -14,8 +14,8 @@
 \begin{document}
 \begin{tikzpicture}[logo/.style={draw=blue,circle,fill=white}]
 	\matrix{
-		\node[logo,dash pattern=on .5pt off 1.0pt,thick,draw=purple!75!white]{};  & \node[logo,draw=burntorange]{};                         \\
-		\node[logo,fill,draw=bakeoffgreen,fill=bakeoffblue]{}; & \node[logo,double,draw=cmhgold,fill=harvestgold]{};\\};
+		\node[logo,dash pattern=on .5pt off 1.0pt,thick,draw=purple!75!white]{}; & \node[logo,draw=burntorange]{};                                  \\
+		\node[logo,fill,draw=bakeoffgreen,fill=bakeoffblue]{};                           & \node[logo,double,draw=cmhgold,fill=harvestgold]{};\\};
 \end{tikzpicture}
 \end{document}
 
@@ -24,8 +24,8 @@
 \pagecolor{white}
 \begin{tikzpicture}[logo/.style={draw=blue,circle,fill=none,fill opacity=0.75}]
 	\matrix{%
-		\node[logo,dash pattern=on .5pt off 1.0pt,thick,draw=purple!75!white]{}; & \node[logo,draw=burntorange]{};                         \\
-		\node[logo,fill,draw=bakeoffgreen,fill=bakeoffblue]{}; & \node[logo,double,draw=cmhgold,fill=harvestgold]{};\\};
+		\node[logo,dash pattern=on .5pt off 1.0pt,thick,draw=purple!75!white]{}; & \node[logo,draw=burntorange]{};                                  \\
+		\node[logo,fill,draw=bakeoffgreen,fill=bakeoffblue]{};                           & \node[logo,double,draw=cmhgold,fill=harvestgold]{};\\};
 	\begin{scope}[on background layer]
 		%\node [yshift=0.01em,xshift=0.07em] {\resizebox{1cm}{!}{\color{gray!50!white}\faGithub}};
 		\node {\resizebox{1cm}{!}{\color{gray!25!white}\faGithub}};

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-conclusions-know-limitations.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-conclusions-know-limitations.tex	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-conclusions-know-limitations.tex	2021-07-24 20:49:14 UTC (rev 60045)
@@ -3,29 +3,16 @@
  There are a number of known limitations of the script, and almost certainly quite a few
  that are \emph{unknown}!
 
- The main limitation is to do with the alignment routine discussed in
- \cpageref{lst:aligndelims:advanced}; for example, consider the file given in \cref{lst:matrix2}.
+ For example, with reference to the multicolumn alignment routine in
+ \vref{lst:tabular2-mod2}), when working with code blocks in which multicolumn commands
+ overlap, the algorithm can fail.
 
- \cmhlistingsfromfile{demonstrations/matrix2.tex}{\texttt{matrix2.tex}}{lst:matrix2}
-
- The default output is given in \cref{lst:matrix2-default}, and it is clear that the alignment
- routine has not worked as hoped, but it is \emph{expected}. \cmhlistingsfromfile{demonstrations/matrix2-default.tex}{\texttt{matrix2.tex} default output}{lst:matrix2-default}
-
- The reason for the problem is that when \texttt{latexindent.pl} stores its code blocks
- (see \vref{tab:code-blocks}) it uses replacement tokens. The alignment routine is using
- the \emph{length of the replacement token} in its measuring -- I hope to be able to address this in the
- future.
-
- There are other limitations to do with the multicolumn alignment routine (see
- \vref{lst:tabular2-mod2}); in particular, when working with code blocks in which
- multicolumn commands overlap, the algorithm can fail.
-
  Another limitation is to do with efficiency, particularly when the \texttt{-m}
  switch is active, as this adds many checks and processes. The current implementation
  relies upon finding and storing \emph{every} code block (see the discussion on
- \cpageref{page:phases}); it is hoped that, in a future version, only
- \emph{nested} code blocks will need to be stored in the `packing' phase, and
- that this will improve the efficiency of the script.
+ \cpageref{page:phases}); I hope that, in a future version, only \emph{nested} code
+ blocks will need to be stored in the `packing' phase, and that this will improve the
+ efficiency of the script.
 
  You can run \texttt{latexindent} on any file;%
  \announce{2019-07-13}*{ability to call latexindent on any file} if you don't specify an extension, then the extensions that you

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex	2021-07-24 20:49:14 UTC (rev 60045)
@@ -12,6 +12,12 @@
  \emph{integer} in \emph{this} section, assume that it must be
  greater than or equal to \texttt{0} unless otherwise stated.
 
+ For most of the settings in \texttt{defaultSettings.yaml} that are specified as integers, then
+ we understand \texttt{0} to represent `off' and \texttt{1} to
+ represent `on'. For fields that allow values other than \texttt{0} or
+ \texttt{1}, it is hoped that the specific context and associated commentary
+ should make it clear which values are allowed.
+
 \yamltitle{fileExtensionPreference}*{fields}
 	\texttt{latexindent.pl} can be called to
 	act on a file without specifying the file extension.  For example we can call
@@ -109,11 +115,11 @@
 	\announce{2021-03-14}*{no longer using log4perl}
 
 	Some of the options%
-	\announce*{2021-06-19}*{logFilePreferences updated to include Dumper options}for Perl's \texttt{Dumper} module can
-	be specified in \cref{lst:logFilePreferences}; see \cite{dumper} and
-	\cite{dumperdemo} for more information. These options will mostly be helpful for
-	those calling \texttt{latexindent.pl} with the \texttt{-tt} option described
-	in \cref{sec:commandline}.
+	\announce*{2021-06-19}*{logFilePreferences updated to include Dumper options}for Perl's
+	\texttt{Dumper} module can be specified in \cref{lst:logFilePreferences}; see
+	\cite{dumper} and \cite{dumperdemo} for more information. These options
+	will mostly be helpful for those calling \texttt{latexindent.pl} with the
+	\texttt{-tt} option described in \cref{sec:commandline}.
 
 \subsection{Verbatim code blocks}
 \yamltitle{verbatimEnvironments}*{fields}
@@ -139,6 +145,11 @@
 	breaking routines (only relevant if the \texttt{-m} is active, see
 	\vref{sec:modifylinebreaks}).
 
+	With reference to \cref{lst:verbatimCommands}, by default \texttt{latexindent.pl} looks for
+	\lstinline|\verb| immediately followed by another character, and then it takes the
+	body as anything up to the next occurrence of the character; this means that, for
+	example, \lstinline|\verb!x+3!| is treated as a \texttt{verbatimCommands}.
+
 \yamltitle{noIndentBlock}*{fields}
 	If you have a block of code that you don't want \texttt{latexindent.pl} to touch (even if
 	\index{verbatim!noIndentBlock} it is \emph{not} a verbatim-like environment) then
@@ -153,17 +164,18 @@
 
 	\cmhlistingsfromfile{demonstrations/noindentblock.tex}{\texttt{noIndentBlock.tex}}{lst:noIndentBlockdemo}
 
-	Important note: it is assumed that the \texttt{noindent} block statements appear on
-	their own line.
+	Important note: it is assumed that the \texttt{noindent} block statements specified
+	in this way appear on their own line.
 
 	The%
 	\announce*{2021-06-19}{noIndentBlock specified as regex} \texttt{noIndentBlock}
 	fields can also be specified in terms of \texttt{begin} and
-	\texttt{end} fields. We begin with the file given in \cref{lst:noIndentBlock1}
+	\texttt{end} fields. We use the code in \cref{lst:noIndentBlock1} to demonstrate
+	this feature.
 
 	\cmhlistingsfromfile*{demonstrations/noindentblock1.tex}{\texttt{noIndentBlock1.tex}}{lst:noIndentBlock1}
 
-	The settings given in \cref{lst:noindent1,lst:noindent2} are equivalent
+	The settings given in \cref{lst:noindent1,lst:noindent2} are equivalent:
 
 	\begin{cmhtcbraster}[raster columns=3,
 			raster left skip=-3.5cm,
@@ -186,7 +198,9 @@
 	The \texttt{begin}, \texttt{body} and \texttt{end} fields
 	for \texttt{noIndentBlock} are all \emph{regular expressions}. If the
 	\texttt{body} field is not specified, then it takes a default value of
-	\lstinline!.*?! which is written explicitly in \cref{lst:noindent1}.
+	\lstinline!.*?! which is written explicitly in \cref{lst:noindent1}. In this
+	context,
+	we interpret \lstinline!.*?! in words as \emph{the fewest number of characters (possibly none) until the `end' field is reached}.
 
 	The \texttt{lookForThis} field is optional, and can take the values 0 (off) or 1 (on);
 	by default, it is assumed to be 1 (on).
@@ -518,8 +532,8 @@
 		\item \cref{lst:sba3} demonstrates the new \emph{advanced} way to specify
 		      \texttt{spacesBeforeAmpersand}, and
 		      for us to set the \texttt{default} value that sets the number of spaces before
-		      ampersands which are \emph{not} in leading blank columns.	      The default
-		      value is \texttt{1}.
+		      ampersands which are \emph{not} in leading blank columns.		The
+		      default value is \texttt{1}.
 
 		      We note that \texttt{leadingBlankColumn} has not been specified in \cref{lst:sba3},
 		      and it will inherit the value from \texttt{default};
@@ -1168,9 +1182,9 @@
 			\caption{Code blocks known to \texttt{latexindent.pl}}\label{tab:code-blocks}
 			\begin{tabular}{m{.3\linewidth}@{\hspace{.25cm}}m{.4\linewidth}@{\hspace{.25cm}}m{.2\linewidth}}
 				\toprule
-				Code block                    & characters allowed in name                                                                                     & example                                                                                                                                                                                                                                     \\
+				Code block                    & characters allowed in name                                                                  & example                                                                                                                                                               \\
 				\midrule
-				environments                  & \lstinline!a-zA-Z@\*0-9_\\!                                                                                        &
+				environments                  & \lstinline!a-zA-Z@\*0-9_\\!                                                                 &
 				\begin{lstlisting}[,nolol=true,]
 \begin{myenv}
 body of myenv
@@ -1177,7 +1191,7 @@
 \end{myenv}
   \end{lstlisting}
 				\\\cmidrule{2-3}
-				optionalArguments             & \emph{inherits} name from parent (e.g environment name)                                                        &
+				optionalArguments             & \emph{inherits} name from parent (e.g environment name)                                     &
 				\begin{lstlisting}[,nolol=true,]
 [
 opt arg text
@@ -1184,7 +1198,7 @@
 ]
   \end{lstlisting}
 				\\\cmidrule{2-3}
-				mandatoryArguments            & \emph{inherits} name from parent (e.g environment name)                                                        &
+				mandatoryArguments            & \emph{inherits} name from parent (e.g environment name)                                     &
 				\begin{lstlisting}[,nolol=true,]
 {
 mand arg text
@@ -1191,10 +1205,10 @@
 }
   \end{lstlisting}
 				\\\cmidrule{2-3}
-				commands                      & \lstinline!+a-zA-Z@\*0-9_\:!                                                                                        & \lstinline!\mycommand!$\langle$\itshape{arguments}$\rangle$                                                                                                                                                                                \\\cmidrule{2-3}
-				keyEqualsValuesBracesBrackets & \lstinline!a-zA-Z@\*0-9_\/.\h\{\}:\#-!                                                                                        & \lstinline!my key/.style=!$\langle$\itshape{arguments}$\rangle$                                                                                                                                                                                \\\cmidrule{2-3}
-				namedGroupingBracesBrackets   & \lstinline!0-9\.a-zA-Z@\*><!                                                                                        & \lstinline!in!$\langle$\itshape{arguments}$\rangle$                                                                                                                                                                                \\\cmidrule{2-3}
-				UnNamedGroupingBracesBrackets & \centering\emph{No name!}                                                                                      & \lstinline!{! or \lstinline![! or \lstinline!,! or \lstinline!&! or \lstinline!)! or \lstinline!(! or \lstinline!$! followed by $\langle$\itshape{arguments}$\rangle$ \\\cmidrule{2-3}
+				commands                      & \lstinline!+a-zA-Z@\*0-9_\:!                                                                & \lstinline!\mycommand!$\langle$\itshape{arguments}$\rangle$                                                                                                           \\\cmidrule{2-3}
+				keyEqualsValuesBracesBrackets & \lstinline!a-zA-Z@\*0-9_\/.\h\{\}:\#-!                                                      & \lstinline!my key/.style=!$\langle$\itshape{arguments}$\rangle$                                                                                                       \\\cmidrule{2-3}
+				namedGroupingBracesBrackets   & \lstinline!0-9\.a-zA-Z@\*><!                                                                & \lstinline!in!$\langle$\itshape{arguments}$\rangle$                                                                                                                   \\\cmidrule{2-3}
+				UnNamedGroupingBracesBrackets & \centering\emph{No name!}                                                                   & \lstinline!{! or \lstinline![! or \lstinline!,! or \lstinline!&! or \lstinline!)! or \lstinline!(! or \lstinline!$! followed by $\langle$\itshape{arguments}$\rangle$ \\\cmidrule{2-3}
 				ifElseFi                      & \lstinline!@a-zA-Z! but must begin with either \newline \lstinline!\if! of \lstinline!\@if! &
 				\begin{lstlisting}[,nolol=true,]
 \ifnum...
@@ -1202,31 +1216,31 @@
 \else
 ...
 \fi
-  \end{lstlisting}                                                                                                                                                                                                                                                                                                                                                                      \\\cmidrule{2-3}
-				items                         & User specified, see \vref{lst:indentafteritems,lst:itemNames}                                                  &
+  \end{lstlisting}                                                                                                                                                                                                                                                                     \\\cmidrule{2-3}
+				items                         & User specified, see \vref{lst:indentafteritems,lst:itemNames}                               &
 				\begin{lstlisting}[,nolol=true,]
 \begin{enumerate}
   \item ...
 \end{enumerate}
-  \end{lstlisting}                                                                                                                                                                                                                                                                                                                                                                      \\\cmidrule{2-3}
-				specialBeginEnd               & User specified, see \vref{lst:specialBeginEnd}                                                                 &
+  \end{lstlisting}                                                                                                                                                                                                                                                                     \\\cmidrule{2-3}
+				specialBeginEnd               & User specified, see \vref{lst:specialBeginEnd}                                              &
 				\begin{lstlisting}[,nolol=true,]
 \[
   ...
 \]
-  \end{lstlisting}                                                                                                                                                                                                                                                                                                                                                                     \\\cmidrule{2-3}
-				afterHeading                  & User specified, see \vref{lst:indentAfterHeadings}                                                             &
+  \end{lstlisting}                                                                                                                                                                                                                                                                     \\\cmidrule{2-3}
+				afterHeading                  & User specified, see \vref{lst:indentAfterHeadings}                                          &
 				\begin{lstlisting}[,morekeywords={chapter},nolol=true,]
 \chapter{title}
   ...
 \section{title}
-  \end{lstlisting}                                                                                                                                                                                                                                                                                                                                                                     \\\cmidrule{2-3}
-				filecontents                  & User specified, see \vref{lst:fileContentsEnvironments}                                                        &
+  \end{lstlisting}                                                                                                                                                                                                                                              \\\cmidrule{2-3}
+				filecontents                  & User specified, see \vref{lst:fileContentsEnvironments}                                     &
 				\begin{lstlisting}[,nolol=true,]
 \begin{filecontents}
 ...
 \end{filecontents}
-  \end{lstlisting}                                                                                                                                                                                                                                                                                                                                                                     \\
+  \end{lstlisting}                                                                                                                                                                                                                                                                     \\
 				\bottomrule
 			\end{tabular}
 		\end{widepage}

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex	2021-07-24 20:49:14 UTC (rev 60045)
@@ -209,10 +209,10 @@
 		       first comment symbol, which has meant that everything following it has been moved to the
 		       end of the line; this is undesirable, clearly!
 		 \item \cref{lst:finetuning4-mod2} has fine-tuned the trailing comment matching, and says that
-		       \lstinline!%! cannot
+		       \% cannot
 		       be immediately preceeded by the words `Handbook', `for' or `Spoken', which means that
-		       none of the \lstinline!%! symbols have been treated as trailing comments, and
-		       the output is desirable.
+		       none of the \% symbols have been treated as trailing comments, and the output is
+		       desirable.
 	 \end{itemize}
 
 	 Another approach to this situation, which does not use \texttt{fineTuning}, is to use \texttt{noIndentBlock}
@@ -226,7 +226,7 @@
 
 	 \cmhlistingsfromfile*[style=yaml-LST]*{demonstrations/href3.yaml}[MLB-TCB]{\texttt{href3.yaml}}{lst:href3}
 
-	 With reference to the \texttt{body} field in \cref{lst:href3}, we note that \lstinline![^}]*?! can
+	 With reference to the \texttt{body} field in \cref{lst:href3}, we note that the \texttt{body} field can
 	 be interpreted as: the fewest number of zero or more characters that are not right braces. This
 	 is an example of character class.
 	 \index{regular expressions!character class demonstration}

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex	2021-07-24 20:49:14 UTC (rev 60045)
@@ -136,39 +136,30 @@
 
 	\cmhlistingsfromfile{demonstrations/textwrap3-mod1.tex}{\texttt{textwrap3-mod1.tex}}{lst:textwrap3-mod1}
 
-	The text wrapping routine of \texttt{latexindent.pl} is performed by the
-	\texttt{Text::Wrap} module, which provides a \texttt{separator} feature
-	to separate lines with characters other than a new line (see
-	\cite{textwrap}). By default, the separator is empty which means that a new
-	line token will be used, but you can change it as you see fit.
+	The%
+	\announce*{2021-07-23}*{huge:overflow is now default} default value of
+	\texttt{huge} is \texttt{overflow}, which means that words will
+	\emph{not} be broken by the text wrapping routine, implemented by the
+	\texttt{Text::Wrap} \cite{textwrap}. There are options to change the
+	\texttt{huge} option for the \texttt{Text::Wrap} module to either
+	\texttt{wrap} or \texttt{die}. Before modifying the value of
+	\texttt{huge}, please bear in mind the following warning:
+	\index{warning!changing huge (textwrap)}
+	\begin{warning}
+		\raggedright
+		Changing the value of \texttt{huge} to anything other than \texttt{overflow} will slow down
+		\texttt{latexindent.pl} significantly when the \texttt{-m} switch is active.
 
-	For example starting with the file in \cref{lst:textwrap4}
+		Furthermore, changing \texttt{huge} means that you may have some words \emph{or commands}(!)
+		split across lines in your .tex file, which may affect your output. I do not recommend
+		changing this field.
+	\end{warning}
 
-	\cmhlistingsfromfile{demonstrations/textwrap4.tex}{\texttt{textwrap4.tex}}{lst:textwrap4}
-	and using \texttt{textwrap2.yaml} from \cref{lst:textwrap2-yaml} with the following
-	command
+	For example, using the settings in \cref{lst:textwrap2A-yaml,lst:textwrap2B-yaml} and running the commands
 	\index{switches!-l demonstration}
 	\index{switches!-m demonstration}
 	\index{switches!-o demonstration}
 	\begin{commandshell}
-latexindent.pl -m textwrap4.tex -o textwrap4-mod2.tex -l textwrap2.yaml
-\end{commandshell}
-	then we obtain the output in \cref{lst:textwrap4-mod2}.
-
-	\begin{cmhtcbraster}[raster column skip=.1\linewidth]
-		\cmhlistingsfromfile{demonstrations/textwrap4-mod2.tex}{\texttt{textwrap4-mod2.tex}}{lst:textwrap4-mod2}
-		\cmhlistingsfromfile{demonstrations/textwrap2.yaml}[MLB-TCB]{\texttt{textwrap2.yaml}}{lst:textwrap2-yaml}
-	\end{cmhtcbraster}
-
-	There are options to specify the \texttt{huge} option for the
-	\texttt{Text::Wrap} module \cite{textwrap}
-	\announce{2019-09-07}{huge option for text wrap module}. This can be helpful if you would like to forbid the
-	\texttt{Text::Wrap} routine from breaking words. For example, using the settings
-	in \cref{lst:textwrap2A-yaml,lst:textwrap2B-yaml} and running the commands
-	\index{switches!-l demonstration}
-	\index{switches!-m demonstration}
-	\index{switches!-o demonstration}
-	\begin{commandshell}
 latexindent.pl -m textwrap4.tex -o=+-mod2A -l textwrap2A.yaml
 latexindent.pl -m textwrap4.tex -o=+-mod2B -l textwrap2B.yaml
 \end{commandshell}
@@ -176,10 +167,10 @@
 
 	\begin{cmhtcbraster}[raster column skip=.1\linewidth]
 		\cmhlistingsfromfile{demonstrations/textwrap4-mod2A.tex}{\texttt{textwrap4-mod2A.tex}}{lst:textwrap4-mod2A}
-		\cmhlistingsfromfile{demonstrations/textwrap2A.yaml}[MLB-TCB]{\texttt{textwrap2A.yaml}}{lst:textwrap2A-yaml}
+		\cmhlistingsfromfile*{demonstrations/textwrap2A.yaml}[MLB-TCB]{\texttt{textwrap2A.yaml}}{lst:textwrap2A-yaml}
 
 		\cmhlistingsfromfile{demonstrations/textwrap4-mod2B.tex}{\texttt{textwrap4-mod2B.tex}}{lst:textwrap4-mod2B}
-		\cmhlistingsfromfile{demonstrations/textwrap2B.yaml}[MLB-TCB]{\texttt{textwrap2B.yaml}}{lst:textwrap2B-yaml}
+		\cmhlistingsfromfile*{demonstrations/textwrap2B.yaml}[MLB-TCB]{\texttt{textwrap2B.yaml}}{lst:textwrap2B-yaml}
 	\end{cmhtcbraster}
 
 	You can also specify the \texttt{tabstop}
@@ -204,10 +195,11 @@
 		\cmhlistingsfromfile[showtabs=true]*{demonstrations/textwrap-ts-mod1.tex}{\texttt{textwrap-ts-mod1.tex}}{lst:textwrap-ts-mod1}
 	\end{cmhtcbraster}
 
-	You can specify \texttt{break} and \texttt{unexpand} options in
-	your settings in analogous ways to those demonstrated in \cref{lst:textwrap2B-yaml,lst:tabstop}, and
-	they will be passed to the \texttt{Text::Wrap} module. I have not found a useful
-	reason to do this; see \cite{textwrap} for more details.
+	You can specify \texttt{separator}, \texttt{break} and
+	\texttt{unexpand} options in your settings in analogous ways to those
+	demonstrated in \cref{lst:textwrap2B-yaml,lst:tabstop}, and they will be passed to the
+	\texttt{Text::Wrap} module. I have not found a useful reason to do this; see
+	\cite{textwrap} for more details.
 
 \subsubsection{text wrapping on a per-code-block basis}
 	By default, if the value of \texttt{columns} is greater than 0 and the
@@ -223,7 +215,7 @@
 	In particular, note the field \texttt{perCodeBlockBasis: 0}.
 	\index{specialBeginEnd!textWrapOptions}
 
-	\cmhlistingsfromfile[style=textWrapOptionsAll]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptionsAll}
+	\cmhlistingsfromfile*[style=textWrapOptionsAll]*{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{textWrapOptions}}{lst:textWrapOptionsAll}
 
 	The code blocks detailed in \cref{lst:textWrapOptionsAll} are with direct reference to
 	those detailed in \vref{tab:code-blocks}. The only special case is the
@@ -375,7 +367,7 @@
 	\begin{widepage}
 		\cmhlistingsfromfile{demonstrations/textwrap6-mod9.tex}{\texttt{textwrap6.tex} using \cref{lst:textwrap9-yaml}}{lst:textwrap6-mod9}
 
-		\cmhlistingsfromfile{demonstrations/textwrap6-mod11.tex}{\texttt{textwrap6.tex} using \cref{lst:textwrap11-yaml}}{lst:textwrap6-mod11}
+		\cmhlistingsfromfile*{demonstrations/textwrap6-mod11.tex}{\texttt{textwrap6.tex} using \cref{lst:textwrap11-yaml}}{lst:textwrap6-mod11}
 	\end{widepage}
 
 	Notice that:
@@ -1897,70 +1889,70 @@
 
 	\clearpage
 	\begin{longtable}{llll}
-		\caption{Poly-switch mappings for all code-block types}\label{tab:poly-switch-mapping}                                                                                                                                                         \\
+		\caption{Poly-switch mappings for all code-block types}\label{tab:poly-switch-mapping}                                                                                                                                                   \\
 		\toprule
-		Code block                                             & Sample                                                                  & \multicolumn{2}{c}{Poly-switch mapping}                                                                     \\
+		Code block                                             & Sample                                                            & \multicolumn{2}{c}{Poly-switch mapping}                                                                     \\
 		\midrule
-		environment                                            & \verb!before words!$\BeginStartsOnOwnLine$                       & $\BeginStartsOnOwnLine$                 & BeginStartsOnOwnLine                                              \\
+		environment                                            & \verb!before words!$\BeginStartsOnOwnLine$                        & $\BeginStartsOnOwnLine$                 & BeginStartsOnOwnLine                                              \\
 		                                                       & \verb!\begin{myenv}!$\BodyStartsOnOwnLine$                        & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
 		                                                       & \verb!body of myenv!$\EndStartsOnOwnLine$                         & $\EndStartsOnOwnLine$                   & EndStartsOnOwnLine                                                \\
-		                                                       & \verb!\end{myenv}!$\EndFinishesWithLineBreak$                   & $\EndFinishesWithLineBreak$             & EndFinishesWithLineBreak                                          \\
-		                                                       & \verb!after words!                                              &                                         &                                                                   \\
+		                                                       & \verb!\end{myenv}!$\EndFinishesWithLineBreak$                     & $\EndFinishesWithLineBreak$             & EndFinishesWithLineBreak                                          \\
+		                                                       & \verb!after words!                                                &                                         &                                                                   \\
 		\cmidrule{2-4}
-		ifelsefi                                               & \verb!before words!$\BeginStartsOnOwnLine$                       & $\BeginStartsOnOwnLine$                 & IfStartsOnOwnLine                                                 \\
-		                                                       & \verb!\if...!$\BodyStartsOnOwnLine$                        & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
-		                                                       & \verb!body of if/or statement!$\OrStartsOnOwnLine$                          & $\OrStartsOnOwnLine$                    & OrStartsOnOwnLine                                                 %
-		\announce{2018-04-27}{new ifElseFi code block poly-switches}                                                                                                                                                                                   \\
-		                                                       & \verb!\or!$\OrFinishesWithLineBreak$                    & $\OrFinishesWithLineBreak$              & OrFinishesWithLineBreak                                           \\
-		                                                       & \verb!body of if/or statement!$\ElseStartsOnOwnLine$                       & $\ElseStartsOnOwnLine$                  & ElseStartsOnOwnLine                                               \\
-		                                                       & \verb!\else!$\ElseFinishesWithLineBreak$                 & $\ElseFinishesWithLineBreak$            & ElseFinishesWithLineBreak                                         \\
-		                                                       & \verb!body of else statement!$\EndStartsOnOwnLine$                        & $\EndStartsOnOwnLine$                   & FiStartsOnOwnLine                                                 \\
-		                                                       & \verb!\fi!$\EndFinishesWithLineBreak$                  & $\EndFinishesWithLineBreak$             & FiFinishesWithLineBreak                                           \\
-		                                                       & \verb!after words!                                             &                                         &                                                                   \\
+		ifelsefi                                               & \verb!before words!$\BeginStartsOnOwnLine$                        & $\BeginStartsOnOwnLine$                 & IfStartsOnOwnLine                                                 \\
+		                                                       & \verb!\if...!$\BodyStartsOnOwnLine$                               & $\BodyStartsOnOwnLine$                  & BodyStartsOnOwnLine                                               \\
+		                                                       & \verb!body of if/or statement!$\OrStartsOnOwnLine$                & $\OrStartsOnOwnLine$                    & OrStartsOnOwnLine                                                 %
+		\announce{2018-04-27}{new ifElseFi code block poly-switches}                                                                                                                                                                             \\
+		                                                       & \verb!\or!$\OrFinishesWithLineBreak$                              & $\OrFinishesWithLineBreak$              & OrFinishesWithLineBreak                                           \\
+		                                                       & \verb!body of if/or statement!$\ElseStartsOnOwnLine$              & $\ElseStartsOnOwnLine$                  & ElseStartsOnOwnLine                                               \\
+		                                                       & \verb!\else!$\ElseFinishesWithLineBreak$                          & $\ElseFinishesWithLineBreak$            & ElseFinishesWithLineBreak                                         \\
+		                                                       & \verb!body of else statement!$\EndStartsOnOwnLine$                & $\EndStartsOnOwnLine$                   & FiStartsOnOwnLine                                                 \\
+		                                                       & \verb!\fi!$\EndFinishesWithLineBreak$                             & $\EndFinishesWithLineBreak$             & FiFinishesWithLineBreak                                           \\
+		                                                       & \verb!after words!                                                &                                         &                                                                   \\
 		\cmidrule{2-4}
-		optionalArguments                                      & \verb!...!$\BeginStartsOnOwnLine$                      & $\BeginStartsOnOwnLine$                 & LSqBStartsOnOwnLine\footnote{LSqB stands for Left Square Bracket} \\
-		                                                       & \verb![!$\BodyStartsOnOwnLine$                       & $\BodyStartsOnOwnLine$                  & OptArgBodyStartsOnOwnLine                                         \\
-		\announce{2019-07-13}{new comma-related poly-switches} & \verb!value before comma!$\ElseStartsOnOwnLine$,                      & $\ElseStartsOnOwnLine$                  & CommaStartsOnOwnLine                                              \\
-		                                                       & $\ElseFinishesWithLineBreak$                                            & $\ElseFinishesWithLineBreak$            & CommaFinishesWithLineBreak                                        \\
-		                                                       & \verb!end of body of opt arg!$\EndStartsOnOwnLine$                        & $\EndStartsOnOwnLine$                   & RSqBStartsOnOwnLine                                               \\
-		                                                       & \verb!]!$\EndFinishesWithLineBreak$                  & $\EndFinishesWithLineBreak$             & RSqBFinishesWithLineBreak                                         \\
-		                                                       & \verb!...!                                             &                                         &                                                                   \\
+		optionalArguments                                      & \verb!...!$\BeginStartsOnOwnLine$                                 & $\BeginStartsOnOwnLine$                 & LSqBStartsOnOwnLine\footnote{LSqB stands for Left Square Bracket} \\
+		                                                       & \verb![!$\BodyStartsOnOwnLine$                                    & $\BodyStartsOnOwnLine$                  & OptArgBodyStartsOnOwnLine                                         \\
+		\announce{2019-07-13}{new comma-related poly-switches} & \verb!value before comma!$\ElseStartsOnOwnLine$,                  & $\ElseStartsOnOwnLine$                  & CommaStartsOnOwnLine                                              \\
+		                                                       & $\ElseFinishesWithLineBreak$                                      & $\ElseFinishesWithLineBreak$            & CommaFinishesWithLineBreak                                        \\
+		                                                       & \verb!end of body of opt arg!$\EndStartsOnOwnLine$                & $\EndStartsOnOwnLine$                   & RSqBStartsOnOwnLine                                               \\
+		                                                       & \verb!]!$\EndFinishesWithLineBreak$                               & $\EndFinishesWithLineBreak$             & RSqBFinishesWithLineBreak                                         \\
+		                                                       & \verb!...!                                                        &                                         &                                                                   \\
 		\cmidrule{2-4}
-		mandatoryArguments                                     & \verb!...!$\BeginStartsOnOwnLine$                      & $\BeginStartsOnOwnLine$                 & LCuBStartsOnOwnLine\footnote{LCuB stands for Left Curly Brace}    \\
-		                                                       & \verb!{!$\BodyStartsOnOwnLine$                       & $\BodyStartsOnOwnLine$                  & MandArgBodyStartsOnOwnLine                                        \\
-		\announce{2019-07-13}{new comma-related poly-switches} & \verb!value before comma!$\ElseStartsOnOwnLine$,                      & $\ElseStartsOnOwnLine$                  & CommaStartsOnOwnLine                                              \\
-		                                                       & $\ElseFinishesWithLineBreak$                                            & $\ElseFinishesWithLineBreak$            & CommaFinishesWithLineBreak                                        \\
-		                                                       & \verb!end of body of mand arg!$\EndStartsOnOwnLine$                        & $\EndStartsOnOwnLine$                   & RCuBStartsOnOwnLine                                               \\
-		                                                       & \verb!}!$\EndFinishesWithLineBreak$                  & $\EndFinishesWithLineBreak$             & RCuBFinishesWithLineBreak                                         \\
-		                                                       & \verb!...!                                             &                                         &                                                                   \\
+		mandatoryArguments                                     & \verb!...!$\BeginStartsOnOwnLine$                                 & $\BeginStartsOnOwnLine$                 & LCuBStartsOnOwnLine\footnote{LCuB stands for Left Curly Brace}    \\
+		                                                       & \verb!{!$\BodyStartsOnOwnLine$                                    & $\BodyStartsOnOwnLine$                  & MandArgBodyStartsOnOwnLine                                        \\
+		\announce{2019-07-13}{new comma-related poly-switches} & \verb!value before comma!$\ElseStartsOnOwnLine$,                  & $\ElseStartsOnOwnLine$                  & CommaStartsOnOwnLine                                              \\
+		                                                       & $\ElseFinishesWithLineBreak$                                      & $\ElseFinishesWithLineBreak$            & CommaFinishesWithLineBreak                                        \\
+		                                                       & \verb!end of body of mand arg!$\EndStartsOnOwnLine$               & $\EndStartsOnOwnLine$                   & RCuBStartsOnOwnLine                                               \\
+		                                                       & \verb!}!$\EndFinishesWithLineBreak$                               & $\EndFinishesWithLineBreak$             & RCuBFinishesWithLineBreak                                         \\
+		                                                       & \verb!...!                                                        &                                         &                                                                   \\
 		\cmidrule{2-4}
-		commands                                               & \verb!before words!$\BeginStartsOnOwnLine$                      & $\BeginStartsOnOwnLine$                 & CommandStartsOnOwnLine                                            \\
-		                                                       & \verb!\mycommand!$\BodyStartsOnOwnLine$                       & $\BodyStartsOnOwnLine$                  & CommandNameFinishesWithLineBreak                                  \\
-		                                                       & $\langle$\itshape{arguments}$\rangle$                                   &                                         &                                                                   \\
+		commands                                               & \verb!before words!$\BeginStartsOnOwnLine$                        & $\BeginStartsOnOwnLine$                 & CommandStartsOnOwnLine                                            \\
+		                                                       & \verb!\mycommand!$\BodyStartsOnOwnLine$                           & $\BodyStartsOnOwnLine$                  & CommandNameFinishesWithLineBreak                                  \\
+		                                                       & $\langle$\itshape{arguments}$\rangle$                             &                                         &                                                                   \\
 		\cmidrule{2-4}
-		namedGroupingBraces Brackets                           & before words$\BeginStartsOnOwnLine$                                     & $\BeginStartsOnOwnLine$                 & NameStartsOnOwnLine                                               \\
-		                                                       & myname$\BodyStartsOnOwnLine$                                            & $\BodyStartsOnOwnLine$                  & NameFinishesWithLineBreak                                         \\
-		                                                       & $\langle$\itshape{braces/brackets}$\rangle$                             &                                         &                                                                   \\
+		namedGroupingBraces Brackets                           & before words$\BeginStartsOnOwnLine$                               & $\BeginStartsOnOwnLine$                 & NameStartsOnOwnLine                                               \\
+		                                                       & myname$\BodyStartsOnOwnLine$                                      & $\BodyStartsOnOwnLine$                  & NameFinishesWithLineBreak                                         \\
+		                                                       & $\langle$\itshape{braces/brackets}$\rangle$                       &                                         &                                                                   \\
 		\cmidrule{2-4}
-		keyEqualsValuesBraces\newline Brackets                 & before words$\BeginStartsOnOwnLine$                                     & $\BeginStartsOnOwnLine$                 & KeyStartsOnOwnLine                                                \\
-		                                                       & key$\EqualsStartsOnOwnLine$=$\BodyStartsOnOwnLine$                      & $\EqualsStartsOnOwnLine$                & EqualsStartsOnOwnLine                                             \\
-		                                                       & $\langle$\itshape{braces/brackets}$\rangle$                             & $\BodyStartsOnOwnLine$                  & EqualsFinishesWithLineBreak                                       \\
+		keyEqualsValuesBraces\newline Brackets                 & before words$\BeginStartsOnOwnLine$                               & $\BeginStartsOnOwnLine$                 & KeyStartsOnOwnLine                                                \\
+		                                                       & key$\EqualsStartsOnOwnLine$=$\BodyStartsOnOwnLine$                & $\EqualsStartsOnOwnLine$                & EqualsStartsOnOwnLine                                             \\
+		                                                       & $\langle$\itshape{braces/brackets}$\rangle$                       & $\BodyStartsOnOwnLine$                  & EqualsFinishesWithLineBreak                                       \\
 		\cmidrule{2-4}
-		items                                                  & before words$\BeginStartsOnOwnLine$                                     & $\BeginStartsOnOwnLine$                 & ItemStartsOnOwnLine                                               \\
-		                                                       & \verb!\item!$\BodyStartsOnOwnLine$                       & $\BodyStartsOnOwnLine$                  & ItemFinishesWithLineBreak                                         \\
-		                                                       & \verb!...!                                             &                                         &                                                                   \\
+		items                                                  & before words$\BeginStartsOnOwnLine$                               & $\BeginStartsOnOwnLine$                 & ItemStartsOnOwnLine                                               \\
+		                                                       & \verb!\item!$\BodyStartsOnOwnLine$                                & $\BodyStartsOnOwnLine$                  & ItemFinishesWithLineBreak                                         \\
+		                                                       & \verb!...!                                                        &                                         &                                                                   \\
 		\cmidrule{2-4}
-		specialBeginEnd                                        & before words$\BeginStartsOnOwnLine$                                     & $\BeginStartsOnOwnLine$                 & SpecialBeginStartsOnOwnLine                                       \\
-		                                                       & \verb!\[!$\BodyStartsOnOwnLine$                       & $\BodyStartsOnOwnLine$                  & SpecialBodyStartsOnOwnLine                                        \\
-		                                                       & \verb!body of special/middle!$\ElseStartsOnOwnLine$                       & $\ElseStartsOnOwnLine$                  & SpecialMiddleStartsOnOwnLine                                      %
-		\announce{2018-04-27}{new special code block poly-switches}                                                                                                                                                                                    \\
-		                                                       & \verb!\middle!$\ElseFinishesWithLineBreak$                 & $\ElseFinishesWithLineBreak$            & SpecialMiddleFinishesWithLineBreak                                \\
-		                                                       & body of special/middle $\EndStartsOnOwnLine$                            & $\EndStartsOnOwnLine$                   & SpecialEndStartsOnOwnLine                                         \\
-		                                                       & \verb!\]!$\EndFinishesWithLineBreak$                  & $\EndFinishesWithLineBreak$             & SpecialEndFinishesWithLineBreak                                   \\
-		                                                       & after words                                                             &                                         &                                                                   \\
+		specialBeginEnd                                        & before words$\BeginStartsOnOwnLine$                               & $\BeginStartsOnOwnLine$                 & SpecialBeginStartsOnOwnLine                                       \\
+		                                                       & \verb!\[!$\BodyStartsOnOwnLine$                                   & $\BodyStartsOnOwnLine$                  & SpecialBodyStartsOnOwnLine                                        \\
+		                                                       & \verb!body of special/middle!$\ElseStartsOnOwnLine$               & $\ElseStartsOnOwnLine$                  & SpecialMiddleStartsOnOwnLine                                      %
+		\announce{2018-04-27}{new special code block poly-switches}                                                                                                                                                                              \\
+		                                                       & \verb!\middle!$\ElseFinishesWithLineBreak$                        & $\ElseFinishesWithLineBreak$            & SpecialMiddleFinishesWithLineBreak                                \\
+		                                                       & body of special/middle $\EndStartsOnOwnLine$                      & $\EndStartsOnOwnLine$                   & SpecialEndStartsOnOwnLine                                         \\
+		                                                       & \verb!\]!$\EndFinishesWithLineBreak$                              & $\EndFinishesWithLineBreak$             & SpecialEndFinishesWithLineBreak                                   \\
+		                                                       & after words                                                       &                                         &                                                                   \\
 		\cmidrule{2-4}
-		verbatim                                               & before words$\BeginStartsOnOwnLine$\verb!\begin{verbatim}!          & $\BeginStartsOnOwnLine$                 & VerbatimBeginStartsOnOwnLine                                      \\
+		verbatim                                               & before words$\BeginStartsOnOwnLine$\verb!\begin{verbatim}!        & $\BeginStartsOnOwnLine$                 & VerbatimBeginStartsOnOwnLine                                      \\
 		\announce{2019-05-05}{verbatim poly-switches}          & body of verbatim \verb!\end{verbatim}!$\EndFinishesWithLineBreak$ & $\EndFinishesWithLineBreak$             & VerbatimEndFinishesWithLineBreak                                  \\
-		                                                       & after words                                                             &                                         &                                                                   \\
+		                                                       & after words                                                       &                                         &                                                                   \\
 		\bottomrule
 	\end{longtable}

Modified: trunk/Master/texmf-dist/doc/support/latexindent/title.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/title.tex	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/doc/support/latexindent/title.tex	2021-07-24 20:49:14 UTC (rev 60045)
@@ -8,7 +8,7 @@
 			sharp corners,
 			enhanced,
 			overlay={\node[anchor=north east,outer sep=2pt] at ([xshift=3cm,yshift=4mm]frame.north east) {\includegraphics[width=3cm]{logo}}; }]
-		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.10
+		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.10.1
 	\end{tcolorbox}
 }
 \author{Chris Hughes \thanks{and contributors!
@@ -15,7 +15,7 @@
 		See \vref{sec:contributors}.
 		For
 		all communication, please visit \cite{latexindent-home}.}}
-\date{2021-06-19}
+\date{2021-07-23}
 \maketitle
 \begin{adjustwidth}{1cm}{1cm}
 	\small

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -26,8 +26,10 @@
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Tokens qw/%tokens/;
 use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::HiddenChildren qw/%familyTree/;
+use LatexIndent::Verbatim qw/%verbatimStorage/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/align_at_ampersand find_aligned_block double_back_slash_else main_formatting individual_padding multicolumn_padding multicolumn_pre_check multicolumn_post_check dont_measure/;
+our @EXPORT_OK = qw/align_at_ampersand find_aligned_block double_back_slash_else main_formatting individual_padding multicolumn_padding multicolumn_pre_check multicolumn_post_check dont_measure hidden_child_cell_row_width hidden_child_row_width /;
 our $alignmentBlockCounter;
 our @cellStorage;   # two-dimensional storage array containing the cell information
 our @formattedBody; # array for the new body
@@ -132,6 +134,9 @@
     my $self = shift;
     return if(${$self}{bodyLineBreaks}==0);
 
+    # some blocks may contain verbatim to be measured
+    ${$self}{measureVerbatim} = (${$self}{body}=~m/$tokens{verbatim}/ ? 1 : 0);
+
     my $maximumNumberOfAmpersands = 0;
 
     # clear the global arrays
@@ -278,6 +283,12 @@
                         delimiterLength=>0,
                         measureThis=> ($numberOfAmpersands>0 ?  ${$self}{measureRow} : 0) });
                     
+            # possible hidden children, see https://github.com/cmhughes/latexindent.pl/issues/85
+            if (  (${$self}{measureHiddenChildren} or ${$self}{measureVerbatim} )
+                 and $column =~m/.*?$tokens{beginOfToken}/s){
+                $self->hidden_child_cell_row_width($column,$rowCounter,$columnCounter);
+            }
+
             # store the maximum column width 
             $maxColumnWidth[$columnCounter] = (defined $maxColumnWidth[$columnCounter] 
                                                         ? 
@@ -424,15 +435,16 @@
     #       \end{align*}
     #
     # see https://github.com/cmhughes/latexindent.pl/issues/223 for example
+
     if (!${${$self}{linebreaksAtEnd}}{begin} 
             and ${$cellStorage[0][0]}{type} eq "X" 
             and ${$cellStorage[0][0]}{measureThis}){
 
-        my $partToMeasure = ${$self}{begin};
+        my $lengthOfBegin = ${$self}{begin};
         if( (${$self}{begin} eq '{' | ${$self}{begin} eq '[') and ${$self}{parentBegin}){
-            $partToMeasure = ${$self}{parentBegin}."{";
+            $lengthOfBegin = ${$self}{parentBegin}."{";
         }
-        ${$self}{indentation} = " " x Unicode::GCString->new($partToMeasure)->columns();
+        ${$self}{indentation} = " " x Unicode::GCString->new($lengthOfBegin)->columns();
         $logger->trace("Adjusting indentation of ${$self}{name} in AlignAtAmpersand routine") if($is_t_switch_active);
     }
   }
@@ -530,6 +542,10 @@
       # objective (2): calculate row width and update maximumRowWidth
       # objective (2): calculate row width and update maximumRowWidth
       my $rowWidth  = Unicode::GCString->new($tmpRow)->columns();
+
+      # possibly update rowWidth if there are hidden children; see test-cases/alignment/hidden-child1.tex and friends
+      $rowWidth = $self->hidden_child_row_width($tmpRow,$rowCount,$rowWidth) if(${$self}{measureHiddenChildren} or ${$self}{measureVerbatim});
+
       ${$formattedBody[$rowCount]}{rowWidth} = $rowWidth;
       
       # update the maximum row width
@@ -538,6 +554,19 @@
           ${$self}{maximumRowWidth} = $rowWidth;
       }
     }
+
+    # log file information
+    if($is_tt_switch_active and ${$self}{measureHiddenChildren}){
+        $logger->info('*FamilyTree after align for ampersand');
+        $logger->trace(Dumper(\%familyTree)) if($is_tt_switch_active);
+
+        $rowCount = -1;
+        # row loop
+        foreach my $row (@cellStorage) {
+            $rowCount++;
+            $logger->trace("row $rowCount row width: ${$formattedBody[$rowCount]}{rowWidth}");
+        }
+    }
 }
 
 sub dont_measure{
@@ -1344,4 +1373,211 @@
               logName=>"double-back-slash-block (for align at ampersand, see lookForAlignDelims)",
         );
 }
+
+# possible hidden children, see test-cases/alignment/issue-162.tex and friends
+#
+#     \begin{align}
+#     	A & =\begin{array}{cc}      % <!--- Hidden child
+#     		     BBB & CCC \\       % <!--- Hidden child
+#     		     E   & F            % <!--- Hidden child
+#     	     \end{array} \\         % <!--- Hidden child
+#
+#     	Z & =\begin{array}{cc}      % <!--- Hidden child
+#     		     Y & X \\           % <!--- Hidden child
+#     		     W & V              % <!--- Hidden child
+#     	     \end{array}            % <!--- Hidden child
+#     \end{align}
+#
+
+# PURPOSE:
+#
+#   measure CELL width that has hidden children
+#
+#     	A &     =\begin{array}{cc}
+#     	             BBB & CCC \\ 
+#     	             E   & F     
+#     	         \end{array} \\ 
+#
+#     	       ^^^^^^^^^^^^^^^^^^
+#     	       ||||||||||||||||||
+#
+#     	              Cell
+#
+sub hidden_child_cell_row_width{
+    my $self = shift;
+
+    my ($tmpCellEntry, $rowCounter, $columnCounter) = @_;
+
+    for my $hiddenChildToMeasure (@{${$self}{measureHiddenChildren}}){
+      if($tmpCellEntry =~m/.*?$hiddenChildToMeasure/s and defined $familyTree{$hiddenChildToMeasure}{bodyForMeasure}){
+           $tmpCellEntry =~ s/$hiddenChildToMeasure/$familyTree{$hiddenChildToMeasure}{bodyForMeasure}/s;
+      }
+    }
+
+    if ($tmpCellEntry =~ m/$tokens{verbatim}/){
+     #
+     # verbatim example:
+     #
+     #    \begin{tabular}{ll}
+     #      Testing & Line 1                        \\
+     #      Testing & Line 2                        \\
+     #      Testing & Line 3 \verb|X| \\
+     #      Testing & Line 4                        \\
+     #    \end{tabular}
+     while( my ($verbatimID,$child)= each %verbatimStorage){
+       if($tmpCellEntry =~m/.*?$verbatimID/s){
+           $tmpCellEntry =~ s/$verbatimID/${$child}{begin}${$child}{body}${$child}{end}/s;
+       }
+     }
+    }
+    my $bodyLineBreaks = 0;
+    $bodyLineBreaks++ while($tmpCellEntry =~ m/\R/sg);
+    if($bodyLineBreaks>0){
+        my $maxRowWidthWithinCell = 0;
+        foreach(split("\n",$tmpCellEntry)){
+           my $currentRowWidth = Unicode::GCString->new($_)->columns();
+           $maxRowWidthWithinCell = $currentRowWidth if ($currentRowWidth > $maxRowWidthWithinCell );
+        }
+        ${$cellStorage[$rowCounter][$columnCounter]}{width} = $maxRowWidthWithinCell;
+    } else {
+        ${$cellStorage[$rowCounter][$columnCounter]}{width} = Unicode::GCString->new($tmpCellEntry)->columns();
+    }
+}
+
+# PURPOSE:
+#
+#   measure ROW width that has hidden children
+#
+#     	A & =\begin{array}{cc}
+#     		     BBB & CCC \\ 
+#     		     E   & F     
+#     	     \end{array} \\ 
+#
+#     	^^^^^^^^^^^^^^^^^^^^^^
+#     	||||||||||||||||||||||
+#
+#     	          row
+#
+sub hidden_child_row_width{
+    my $self = shift;
+
+    my ($tmpRow,$rowCount,$rowWidth)  = @_;
+
+    # some alignment blocks have the 'begin' statement on the opening line:
+    #
+    #           this bit
+    #       ||||||||||||||
+    #       ``````````````
+    #       \begin{align*}1 & 2 \\
+    #                     3 & 4 \\
+    #                     5 & 6
+    #       \end{align*}
+    #
+    my $lengthOfBegin = 0;
+    if (!${${$self}{linebreaksAtEnd}}{begin} 
+            and ${$cellStorage[0][0]}{type} eq "X" 
+            and ${$cellStorage[0][0]}{measureThis}){
+
+        my $beginToMeasure = ${$self}{begin};
+        if( (${$self}{begin} eq '{' | ${$self}{begin} eq '[') and ${$self}{parentBegin}){
+            $beginToMeasure = ${$self}{parentBegin}."{";
+        }
+        $lengthOfBegin = Unicode::GCString->new($beginToMeasure)->columns();
+        $tmpRow = $beginToMeasure.$tmpRow if $rowCount == 0;
+    }
+
+    if ($tmpRow =~m/.*?$tokens{beginOfToken}/s){
+
+           $tmpRow = ("."x$lengthOfBegin).$tmpRow; 
+
+           for my $hiddenChildToMeasure (@{${$self}{measureHiddenChildren}}){
+               if($tmpRow=~m/(^.*)?$hiddenChildToMeasure/m and defined $familyTree{$hiddenChildToMeasure}{bodyForMeasure}){
+                  my $partBeforeId = $1;
+                  my $lengthPartBeforeId = Unicode::GCString->new($partBeforeId)->columns(); 
+
+                  foreach (@{$familyTree{$hiddenChildToMeasure}{ancestors}}){
+                    if (${$_}{ancestorID} eq ${$self}{id}){
+                      if($lengthOfBegin>0){ 
+                          ${$_}{ancestorIndentation} = (" " x ($lengthPartBeforeId)); 
+                      } else {
+                          ${$_}{ancestorIndentation} = ${$_}{ancestorIndentation}.(" " x ($lengthPartBeforeId)); 
+                      }
+                    }
+                  }
+                  my $tmpBodyToMeasure = join( "\n".("."x($lengthPartBeforeId)),
+                                               split("\n",$familyTree{$hiddenChildToMeasure}{bodyForMeasure}));
+
+                  # remove trailing \\ 
+                  $tmpBodyToMeasure =~ s/(\\\\\h*$)//mg;
+                               
+                  $tmpRow =~ s/$hiddenChildToMeasure/$tmpBodyToMeasure/s;
+               }
+           }
+
+           if ($tmpRow =~ m/$tokens{verbatim}/){
+            #
+            # verbatim example:
+            #
+            #    \begin{tabular}{ll}
+            #      Testing & Line 1                        \\
+            #      Testing & Line 2                        \\
+            #      Testing & Line 3 \verb|X| \\
+            #      Testing & Line 4                        \\
+            #    \end{tabular}
+            while( my ($verbatimID,$child)= each %verbatimStorage){
+              if($tmpRow =~m/.*?$verbatimID/s){
+                   $tmpRow =~ s/$verbatimID/${$child}{begin}${$child}{body}${$child}{end}/s;
+              }
+            }
+           }
+
+           my $bodyLineBreaks = 0;
+           $bodyLineBreaks++ while($tmpRow =~ m/\R/sg);
+           if($bodyLineBreaks>0){
+               my $maxRowWidth = 0;
+
+               foreach(split("\n",$tmpRow)){
+                  my $currentRowWidth = Unicode::GCString->new($_)->columns();
+                  $maxRowWidth = $currentRowWidth if ($currentRowWidth > $maxRowWidth );
+               }
+               $rowWidth  = $maxRowWidth;
+           } else {
+               $rowWidth  = Unicode::GCString->new($tmpRow)->columns();
+           }
+        } elsif (!${${$self}{linebreaksAtEnd}}{begin} 
+                  and ${$cellStorage[0][0]}{type} eq "X" 
+                  and ${$cellStorage[0][0]}{measureThis}){
+              $rowWidth  = Unicode::GCString->new($tmpRow)->columns();
+        }
+
+        # possibly draw ruler to log file
+        &draw_ruler_to_logfile($tmpRow,$rowWidth) if ($is_t_switch_active);
+        return $rowWidth;
+} 
+
+sub draw_ruler_to_logfile{
+    # draw a ruler to the log file, useful for debugging
+    #
+    # example:
+    #
+    # ----|----|----|----|----|----|----|----|----|----|----|----|----|----|
+    #    5   10   15   20   25   30   35   40   45   50   55   60   65   70
+    #
+    
+    my ($tmpRow,$maxRowWidth) = @_;
+    $logger->trace("*tmpRow:");
+
+    foreach(split("\n",$tmpRow)){
+       my $currentRowWidth = Unicode::GCString->new($_)->columns();
+       $logger->trace("$_ \t(length: $currentRowWidth)");
+    }
+
+    my $rulerMax = int($maxRowWidth/10 +1.5 )*10;
+    $logger->trace(("----|"x(int($rulerMax/5))));
+
+    my $ruler = q();
+    for (my $i=1;$i<=$rulerMax/5;$i++){ $ruler .= "   ".$i*5 };
+    $logger->trace($ruler);
+
+}
 1;

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -29,18 +29,18 @@
 use LatexIndent::FileExtension qw/file_extension_check/;
 use LatexIndent::BackUpFileProcedure qw/create_back_up_file/;
 use LatexIndent::BlankLines qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/;
-use LatexIndent::ModifyLineBreaks qw/modify_line_breaks_body modify_line_breaks_end remove_line_breaks_begin adjust_line_breaks_end_parent text_wrap remove_paragraph_line_breaks construct_paragraph_reg_exp text_wrap_remove_paragraph_line_breaks verbatim_modify_line_breaks/;
+use LatexIndent::ModifyLineBreaks qw/modify_line_breaks_body modify_line_breaks_end modify_line_breaks_end_after remove_line_breaks_begin adjust_line_breaks_end_parent text_wrap remove_paragraph_line_breaks construct_paragraph_reg_exp text_wrap_remove_paragraph_line_breaks verbatim_modify_line_breaks/;
 use LatexIndent::Sentence qw/one_sentence_per_line/;
 use LatexIndent::TrailingComments qw/remove_trailing_comments put_trailing_comments_back_in add_comment_symbol construct_trailing_comment_regexp/;
 use LatexIndent::HorizontalWhiteSpace qw/remove_trailing_whitespace remove_leading_space/;
 use LatexIndent::Indent qw/indent wrap_up_statement determine_total_indentation indent_begin indent_body indent_end_statement final_indentation_check  get_surrounding_indentation indent_children_recursively check_for_blank_lines_at_beginning put_blank_lines_back_in_at_beginning add_surrounding_indentation_to_begin_statement post_indentation_check/;
 use LatexIndent::Tokens qw/token_check %tokens/;
-use LatexIndent::HiddenChildren qw/find_surrounding_indentation_for_children update_family_tree get_family_tree check_for_hidden_children/;
-use LatexIndent::AlignmentAtAmpersand qw/align_at_ampersand find_aligned_block double_back_slash_else main_formatting individual_padding multicolumn_padding multicolumn_pre_check  multicolumn_post_check dont_measure/;
+use LatexIndent::HiddenChildren qw/find_surrounding_indentation_for_children update_family_tree get_family_tree check_for_hidden_children hidden_children_preparation_for_alignment unpack_children_into_body/;
+use LatexIndent::AlignmentAtAmpersand qw/align_at_ampersand find_aligned_block double_back_slash_else main_formatting individual_padding multicolumn_padding multicolumn_pre_check  multicolumn_post_check dont_measure hidden_child_cell_row_width hidden_child_row_width /;
 use LatexIndent::DoubleBackSlash qw/dodge_double_backslash un_dodge_double_backslash/;
 
 # code blocks
-use LatexIndent::Verbatim qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands  find_verbatim_special verbatim_common_tasks/;
+use LatexIndent::Verbatim qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands  find_verbatim_special verbatim_common_tasks %verbatimStorage/;
 use LatexIndent::Environment qw/find_environments $environmentBasicRegExp construct_environments_regexp/;
 use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/;
 use LatexIndent::Else qw/check_for_else_statement/;
@@ -95,6 +95,8 @@
         $self->remove_trailing_comments;
         $self->find_verbatim_environments;
         $self->find_verbatim_special;
+        $logger->trace("*Verbatim storage:") if $is_tt_switch_active;
+        $logger->trace(Dumper(\%verbatimStorage)) if $is_tt_switch_active;
         $self->verbatim_modify_line_breaks if $is_m_switch_active; 
         $self->make_replacements(when=>"before") if $is_rv_switch_active;
         $self->text_wrap if ($is_m_switch_active and !${$masterSettings{modifyLineBreaks}{textWrapOptions}}{perCodeBlockBasis} and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{columns}>1);
@@ -311,10 +313,14 @@
     # store children in special hash
     push(@{${$self}{children}},$latexIndentObject);
 
+    # possible alignment preparation for hidden children
+    $self->hidden_children_preparation_for_alignment($latexIndentObject) if(${$latexIndentObject}{lookForAlignDelims} and ${$latexIndentObject}{measureHiddenChildren});
+
     # possible decoration in log file 
     $logger->trace(${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace}) if ${$masterSettings{logFilePreferences}}{showDecorationFinishCodeBlockTrace};
 }
 
+
 sub tasks_common_to_each_object{
     my $self = shift;
 
@@ -358,7 +364,8 @@
     # text wrapping can make the ID split across lines
     ${$self}{idRegExp} = ${$self}{id};
 
-    if($is_m_switch_active){
+    if($is_m_switch_active
+        and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{huge} ne "overflow"){
         my $IDwithLineBreaks = join("\\R?\\h*",split(//,${$self}{id}));
         ${$self}{idRegExp} = qr/$IDwithLineBreaks/s;  
     }
@@ -371,10 +378,11 @@
     $self->adjust_replacement_text_line_breaks_at_end;
 
     # modify line breaks on body and end statements
-    $self->modify_line_breaks_body if ($is_m_switch_active and defined ${$self}{BodyStartsOnOwnLine});
+    $self->modify_line_breaks_body if ($is_m_switch_active and defined ${$self}{BodyStartsOnOwnLine} and ${$self}{BodyStartsOnOwnLine}!=0);
 
     # modify line breaks end statements
-    $self->modify_line_breaks_end if $is_m_switch_active;
+    $self->modify_line_breaks_end if ($is_m_switch_active and defined ${$self}{EndStartsOnOwnLine} and ${$self}{EndStartsOnOwnLine}!=0);
+    $self->modify_line_breaks_end_after if ($is_m_switch_active and defined ${$self}{EndFinishesWithLineBreak} and ${$self}{EndFinishesWithLineBreak}!=0);
 
     # check the body for current children
     $self->check_for_hidden_children if ${$self}{body} =~ m/$tokens{beginOfToken}/;
@@ -381,6 +389,10 @@
 
     # double back slash poly-switch check
     $self->double_back_slash_else if ($is_m_switch_active and ${$self}{lookForAlignDelims});
+    
+    # some objects can format their body to align at the & character
+    $self->align_at_ampersand if (${$self}{lookForAlignDelims} and !${$self}{measureHiddenChildren});
+
     return;
 }
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -121,6 +121,10 @@
     return q();
 }
 
+sub check_for_hidden_children{
+    return q();
+}
+
 sub create_unique_id{
     my $self = shift;
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -24,6 +24,7 @@
 use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
 use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
 use LatexIndent::Heading qw/$allHeadingsRegexp/;
+use LatexIndent::Verbatim qw/%verbatimStorage/;
 use Data::Dumper;
 use Exporter qw/import/;
 our @EXPORT_OK = qw/find_file_contents_environments_and_preamble/;
@@ -179,7 +180,7 @@
             # indentPreamble set to 0
             $logger->trace("NOT storing ${$preamble}{id} for indentation -- will store as VERBATIM object (because indentPreamble:0)") if $is_t_switch_active;
             $preamble->unprotect_blank_lines;
-            ${$self}{verbatim}{${$preamble}{id}} = $preamble;
+            $verbatimStorage{${$preamble}{id}} = $preamble;
         }
     } else {
         ${$self}{preamblePresent} = 0;
@@ -198,7 +199,7 @@
                 } else {
                     # indentPreamble set to 0
                     $logger->trace("Storing ${$_}{id} as a VERBATIM object (indentPreamble is 0)") if $is_t_switch_active;
-                    ${$self}{verbatim}{${$_}{id}}=$_;
+                    $verbatimStorage{${$_}{id}} = $_;
                 }
               } else {
                     $logger->trace("storing ${$_}{id} for indentation (${$_}{name} found outside of preamble)") if $is_t_switch_active;

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -21,7 +21,7 @@
 use LatexIndent::LogFile qw/$logger/;
 use Data::Dumper;
 use Exporter qw/import/;
-our @EXPORT_OK = qw/find_surrounding_indentation_for_children update_family_tree get_family_tree check_for_hidden_children %familyTree/;
+our @EXPORT_OK = qw/find_surrounding_indentation_for_children update_family_tree get_family_tree check_for_hidden_children %familyTree hidden_children_preparation_for_alignment unpack_children_into_body/;
 
 # hiddenChildren can be stored in a global array, it doesn't matter what level they're at
 our %familyTree;
@@ -173,7 +173,7 @@
     }
 
     # log file
-    $logger->trace("*Hidden children check") if $is_t_switch_active;
+    $logger->trace("*Hidden children check for ${$self}{name}") if $is_t_switch_active;
     $logger->trace(join("|", at matched)) if $is_t_switch_active;
 
     my $naturalAncestors = ${$self}{naturalAncestors}; 
@@ -180,6 +180,8 @@
 
     # loop through the hidden children
     foreach my $match (@matched){
+        next if $match =~ m/$tokens{verbatim}/;
+
         # update the family tree with ancestors of self
         if(${$self}{ancestors}){
             foreach(@{${$self}{ancestors}}){
@@ -197,9 +199,82 @@
                     my $type = ($naturalAncestors =~ m/${$self}{id}/ ) ? "natural" : "adopted";
                     $logger->trace("Adding ${$self}{id} to the $type family tree of hiddenChild $match") if($is_t_switch_active);
                     push(@{$familyTree{$match}{ancestors}},{ancestorID=>${$self}{id},ancestorIndentation=>${$self}{indentation},type=>$type});
+
+                    if(${$self}{lookForAlignDelims}){
+                        $logger->trace("$match needs measuring for ${$self}{name} (see lookForAlignDelims)") if($is_t_switch_active);
+                        push(@{${$self}{measureHiddenChildren}},$match);
+                    }
         }
     }
 
 }
 
+#
+# AlignmentAtAmpersand routine calculations are below
+#
+# PURPOSE:
+#
+# Consider the following example, which contains hidden children
+#
+#     \begin{align}
+#     	A & =\begin{array}{cc}      % <!--- Hidden child
+#     		     BBB & CCC \\       % <!--- Hidden child
+#     		     E   & F            % <!--- Hidden child
+#     	     \end{array} \\         % <!--- Hidden child
+#
+#     	Z & =\begin{array}{cc}      % <!--- Hidden child
+#     		     Y & X \\           % <!--- Hidden child
+#     		     W & V              % <!--- Hidden child
+#     	     \end{array}            % <!--- Hidden child
+#     \end{align}
+#
+# the approach that we adopt is:
+#
+#   1. for the *original* object  (align in the above), we loop through
+#       its hidden children (array in the above) and unpack their contents
+#       for measuring
+#
+#       see hidden_children_preparation_for_alignment
+#           unpack_children_into_body
+#
+#   2. we store the unpacked body in the familyTree hash, using 'bodyForMeasure'
+#
+#       see $familyTree{${$_}{id}}{bodyForMeasure} = $bodyForMeasure;
+#
+#   3. during the alignment routine, we use 'bodyForMeasure' for measuring the cells
+#
+sub hidden_children_preparation_for_alignment{
+
+    my $self = shift;
+    my $latexIndentObject = shift;
+    for my $hiddenChildToMeasure (@{${$latexIndentObject}{measureHiddenChildren}}){
+        for (@{${$self}{children}}){
+            if(${$_}{id} eq $hiddenChildToMeasure){
+
+                my $bodyForMeasure = ${$_}{begin}.${$_}{body}.${$_}{end};
+                for my $child (${$_}{children}){
+                    $bodyForMeasure = &unpack_children_into_body(\@{$child},$bodyForMeasure);
+                }
+                $familyTree{${$_}{id}}{bodyForMeasure} = $bodyForMeasure;
+            }
+        }
+    }
+    return;
+}
+
+sub unpack_children_into_body{
+    my $child = shift;
+    my $body  = shift;
+    for my $individualChild (@{$child}){
+          $body =~ s/${$individualChild}{id}/${$individualChild}{begin}${$individualChild}{body}${$individualChild}{end}/s;
+
+          if(${$individualChild}{children}){ 
+            for my $nextlevelchild (${$individualChild}{children}){
+                $body = &unpack_children_into_body(\@{$nextlevelchild},$body);
+            }
+          }
+    }
+    return $body;
+}
+
 1;

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Indent.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -118,7 +118,7 @@
     $self->check_for_blank_lines_at_beginning if $is_m_switch_active; 
 
     # some objects can format their body to align at the & character
-    $self->align_at_ampersand if ${$self}{lookForAlignDelims};
+    $self->align_at_ampersand if (${$self}{lookForAlignDelims} and !${$self}{dontMeasure});
 
     # grab the indentation of the object
     # NOTE: we need this here, as ${$self}{indentation} can be updated by the align_at_ampersand routine, 
@@ -324,7 +324,7 @@
                                                         :q();
 
                 # line break checks before <begin statement>
-                if(defined ${$child}{BeginStartsOnOwnLine}){
+                if(defined ${$child}{BeginStartsOnOwnLine} and ${$child}{BeginStartsOnOwnLine} !=0 ){
                     my $BeginStringLogFile = ${$child}{aliases}{BeginStartsOnOwnLine}||"BeginStartsOnOwnLine";
 
                     # 

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/ModifyLineBreaks.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -24,7 +24,8 @@
 use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
 use LatexIndent::Item qw/$listOfItems/;
 use LatexIndent::LogFile qw/$logger/;
-our @EXPORT_OK = qw/modify_line_breaks_body modify_line_breaks_end adjust_line_breaks_end_parent remove_line_breaks_begin text_wrap remove_paragraph_line_breaks construct_paragraph_reg_exp text_wrap_remove_paragraph_line_breaks verbatim_modify_line_breaks/;
+use LatexIndent::Verbatim qw/%verbatimStorage/;
+our @EXPORT_OK = qw/modify_line_breaks_body modify_line_breaks_end modify_line_breaks_end_after adjust_line_breaks_end_parent remove_line_breaks_begin text_wrap remove_paragraph_line_breaks construct_paragraph_reg_exp text_wrap_remove_paragraph_line_breaks verbatim_modify_line_breaks/;
 our $paragraphRegExp = q();
 
 sub modify_line_breaks_body{
@@ -105,7 +106,7 @@
     # switch EndStartsOnOwnLine back to 4
     #
     
-    my @polySwitchValues =(defined ${$self}{EndStartsOnOwnLine} and ${$self}{EndStartsOnOwnLine}==4) ?(-1,3):(${$self}{EndStartsOnOwnLine});
+    my @polySwitchValues =(${$self}{EndStartsOnOwnLine}==4) ?(-1,3):(${$self}{EndStartsOnOwnLine});
     foreach(@polySwitchValues){
         # possibly modify line break *before* \end{statement}
         if(defined ${$self}{EndStartsOnOwnLine}){
@@ -153,6 +154,10 @@
         }
     }
 
+  }
+
+sub modify_line_breaks_end_after{
+    my $self = shift;
     # 
     # Blank line poly-switch notes (==4)
     #
@@ -161,7 +166,7 @@
     #   temporarily change EndFinishesWithLineBreak to 3, make adjustments
     # switch EndFinishesWithLineBreak back to 4
     #
-    @polySwitchValues =(defined ${$self}{EndFinishesWithLineBreak} and ${$self}{EndFinishesWithLineBreak}==4) ?(-1,3):(${$self}{EndFinishesWithLineBreak});
+    my @polySwitchValues =(${$self}{EndFinishesWithLineBreak}==4) ?(-1,3):(${$self}{EndFinishesWithLineBreak});
     foreach(@polySwitchValues){
         last if !(defined $_);
         ${$self}{linebreaksAtEnd}{end} = 0 if($_==3 and (defined ${$self}{EndFinishesWithLineBreak} and ${$self}{EndFinishesWithLineBreak}==4));
@@ -242,7 +247,7 @@
     # verbatim modify line breaks are a bit special, as they happen before 
     # any of the main processes have been done
     my $self = shift;
-    while ( my ($key,$child)= each %{${$self}{verbatim}}){
+    while ( my ($key,$child)= each %verbatimStorage){
       if(defined ${$child}{BeginStartsOnOwnLine}){
         my $BeginStringLogFile = ${$child}{aliases}{BeginStartsOnOwnLine};
         $logger->trace("*$BeginStringLogFile is ${$child}{BeginStartsOnOwnLine} for ${$child}{name}") if $is_t_switch_active ;

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -22,9 +22,10 @@
 use LatexIndent::GetYamlSettings qw/%masterSettings/;
 use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
 use LatexIndent::LogFile qw/$logger/;
-our @EXPORT_OK = qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands find_verbatim_special verbatim_common_tasks/;
+our @EXPORT_OK = qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands find_verbatim_special verbatim_common_tasks %verbatimStorage/;
 our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
 our $verbatimCounter;
+our %verbatimStorage;
 
 sub find_noindent_block{
     my $self = shift;
@@ -111,7 +112,7 @@
           $noIndentBlockObj->create_unique_id;
 
           # verbatim children go in special hash
-          ${$self}{verbatim}{${$noIndentBlockObj}{id}}=$noIndentBlockObj;
+          $verbatimStorage{${$noIndentBlockObj}{id}}=$noIndentBlockObj;
 
           # log file output
           $logger->trace("NOINDENTBLOCK found: $noIndentBlock") if $is_t_switch_active;
@@ -180,7 +181,7 @@
               $verbatimBlock->verbatim_common_tasks;
               
               # verbatim children go in special hash
-              ${$self}{verbatim}{${$verbatimBlock}{id}}=$verbatimBlock;
+              $verbatimStorage{${$verbatimBlock}{id}}=$verbatimBlock;
 
               # log file output
               $logger->trace("*VERBATIM environment found: $verbEnv") if $is_t_switch_active;
@@ -269,7 +270,7 @@
               $logger->trace(Dumper($verbatimCommand),'ttrace') if($is_tt_switch_active);
 
               # verbatim children go in special hash
-              ${$self}{verbatim}{${$verbatimCommand}{id}}=$verbatimCommand;
+              $verbatimStorage{${$verbatimCommand}{id}}=$verbatimCommand;
 
               # log file output
               $logger->trace("*VERBATIM command found: $verbCommand") if $is_t_switch_active;
@@ -338,7 +339,7 @@
               $verbatimBlock->verbatim_common_tasks;
 
               # verbatim children go in special hash
-              ${$self}{verbatim}{${$verbatimBlock}{id}}=$verbatimBlock;
+              $verbatimStorage{${$verbatimBlock}{id}}=$verbatimBlock;
 
               # log file output
               $logger->trace("*VERBATIM special found: $specialName") if $is_t_switch_active;
@@ -359,29 +360,21 @@
     my $self = shift;
     my %input = @_;
 
-    # if there are no verbatim children, return
-    return unless(${$self}{verbatim});
-
     my $verbatimCount=0;
     my $toMatch = q();
     if($input{match} eq "everything-except-commands"){
         $toMatch = "noindentblockenvironmentspecial";
-
-        # count the number of non-command verbatim objects
-        while( my ($key,$child)= each %{${$self}{verbatim}}){
-            ${$child}{type} = "environment" if !(defined ${$child}{type});
-            $verbatimCount++ if($toMatch =~ m/${$child}{type}/);
-        }
-        return unless($verbatimCount>0);
     } else {
         $toMatch = "command";
-        # count the number of command verbatim objects
-        while( my ($key,$child)= each %{${$self}{verbatim}}){
-            ${$child}{type} = "environment" if !(defined ${$child}{type});
-            $verbatimCount++ if($toMatch =~ m/${$child}{type}/);
-        }
-        return unless($verbatimCount>0);
     }
+
+    # count the number of non-command verbatim objects
+    while( my ($key,$child)= each %verbatimStorage){
+        ${$child}{type} = "environment" if !(defined ${$child}{type});
+        $verbatimCount++ if($toMatch =~ m/${$child}{type}/);
+    }
+
+    return unless($verbatimCount>0);
     
     # search for environments/commands
     $logger->trace('*Putting verbatim back in') if $is_t_switch_active;
@@ -391,18 +384,18 @@
     # loop through document children hash
     my $verbatimFound=0;
     while($verbatimFound < $verbatimCount){
-        while( my ($key,$child)= each %{${$self}{verbatim}}){
+        while( my ($verbatimID,$child)= each %verbatimStorage){
           if($toMatch =~ m/${$child}{type}/){
-            if(${$self}{body} =~ m/${$child}{id}/mx){
+            if(${$self}{body} =~ m/$verbatimID/mx){
                 # possibly remove trailing line break
                 if(defined ${$child}{EndFinishesWithLineBreak} 
                     and ${$child}{EndFinishesWithLineBreak}==-1
-                    and ${$self}{body} =~ m/${$child}{id}\h*\R/s){
+                    and ${$self}{body} =~ m/$verbatimID\h*\R/s){
                     $logger->trace("m-switch active, removing trailing line breaks from ${$child}{name}") if $is_t_switch_active;
-                    ${$self}{body} =~ s/${$child}{id}(\h*)?(\R|\h)*/${$child}{id} /s;
+                    ${$self}{body} =~ s/$verbatimID(\h*)?(\R|\h)*/$verbatimID /s;
                 }
                 # replace ids with body
-                ${$self}{body} =~ s/${$child}{id}/${$child}{begin}${$child}{body}${$child}{end}/s;
+                ${$self}{body} =~ s/$verbatimID/${$child}{begin}${$child}{body}${$child}{end}/s;
 
                 # log file info
                 $logger->trace('Body now looks like:') if $is_tt_switch_active;
@@ -409,13 +402,16 @@
                 $logger->trace(${$self}{body},'ttrace') if($is_tt_switch_active);
 
                 # delete the child so it won't be operated upon again
-                delete ${$self}{verbatim}{${$child}{id}};
+                delete $verbatimStorage{$verbatimID};
                 $verbatimFound++;
-              } elsif ($is_m_switch_active and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{columns}>1 and ${$self}{body} !~ m/${$child}{id}/){
-                $logger->trace("${$child}{id} not found in body using /m matching, it may have been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active);
+              } elsif ($is_m_switch_active 
+                  and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{columns}>1 
+                  and ${$masterSettings{modifyLineBreaks}{textWrapOptions}}{huge} ne "overflow" 
+                  and ${$self}{body} !~ m/${$child}{id}/){
+                $logger->trace("$verbatimID not found in body using /m matching, it may have been split across line (see modifyLineBreaks: textWrapOptions)") if($is_t_switch_active);
 
                 # search for a version of the verbatim ID that may have line breaks 
-                my $verbatimIDwithLineBreaks = join("\\R?",split(//,${$child}{id}));
+                my $verbatimIDwithLineBreaks = join("\\R?",split(//,$verbatimID));
                 my $verbatimIDwithLineBreaksRegExp = qr/$verbatimIDwithLineBreaks/s;  
 
                 # replace the line-broken verbatim ID with a non-broken verbatim ID
@@ -452,7 +448,8 @@
     $self->adjust_replacement_text_line_breaks_at_end;
     
     # modify line breaks end statements
-    $self->modify_line_breaks_end if $is_m_switch_active;
+    $self->modify_line_breaks_end if ($is_m_switch_active and defined ${$self}{EndStartsOnOwnLine} and ${$self}{EndStartsOnOwnLine}!=0);
+    $self->modify_line_breaks_end_after if ($is_m_switch_active and defined ${$self}{EndFinishesWithLineBreak} and ${$self}{EndFinishesWithLineBreak}!=0);
 }
 
 sub create_unique_id{

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2021-07-24 20:49:14 UTC (rev 60045)
@@ -19,6 +19,6 @@
 use Exporter qw/import/;
 our @EXPORT_OK = qw/$versionNumber $versionDate/;
 
-our $versionNumber = '3.10';
-our $versionDate = '2021-06-19';
+our $versionNumber = '3.10.1';
+our $versionDate = '2021-07-23';
 1

Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2021-07-24 20:48:09 UTC (rev 60044)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2021-07-24 20:49:14 UTC (rev 60045)
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.10, 2021-06-19
+# defaultSettings.yaml for latexindent.pl, version 3.10.1, 2021-07-23
 #                      a script that aims to
 #                      beautify .tex, .sty, .cls files
 #
@@ -509,7 +509,7 @@
             other: 0
     textWrapOptions:
         columns: 0
-        # huge: overflow    # forbid mid-word line breaks
+        huge: overflow    # forbid mid-word line breaks
         separator: ""
         perCodeBlockBasis: 0
         all: 0

Modified: trunk/Master/texmf-dist/scripts/latexindent/latexindent.pl
===================================================================
(Binary files differ)



More information about the tex-live-commits mailing list.