texlive[66981] trunk: latexindent (1may23)

commits+karl at tug.org commits+karl at tug.org
Mon May 1 22:28:05 CEST 2023


Revision: 66981
          http://tug.org/svn/texlive?view=revision&revision=66981
Author:   karl
Date:     2023-05-01 22:28:03 +0200 (Mon, 01 May 2023)
Log Message:
-----------
latexindent (1may23)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
    trunk/Master/bin/windows/latexindent.exe
    trunk/Master/bin/x86_64-linux/luahbtex
    trunk/Master/bin/x86_64-linux/luajithbtex
    trunk/Master/bin/x86_64-linux/luajittex
    trunk/Master/bin/x86_64-linux/luatex
    trunk/Master/texmf-dist/doc/support/latexindent/README
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.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/windows/latexindent.exe
===================================================================
(Binary files differ)

Modified: trunk/Master/bin/x86_64-linux/luahbtex
===================================================================
(Binary files differ)

Modified: trunk/Master/bin/x86_64-linux/luajithbtex
===================================================================
(Binary files differ)

Modified: trunk/Master/bin/x86_64-linux/luajittex
===================================================================
(Binary files differ)

Modified: trunk/Master/bin/x86_64-linux/luatex
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README	2023-05-01 20:28:03 UTC (rev 66981)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    latexindent.pl, version 3.20.6, 2023-04-11
+    latexindent.pl, version 3.21, 2023-05-01
 
     PERL script to indent code within environments, and align delimited 
     environments in .tex files.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json	2023-05-01 20:28:03 UTC (rev 66981)
@@ -2,7 +2,7 @@
     "$schema": "http://json-schema.org/schema",
     "$id": "latexindent-yaml-schema.json",
     "title": "latexindent.pl YAML schema",
-    "description": "latexindent.pl YAML schema helper, V3.20.6 2023-04-11",
+    "description": "latexindent.pl YAML schema helper, V3.21 2023-05-01",
     "type": "object",
     "properties": {
       "fileExtensionPreference": {

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

Modified: trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2023-05-01 20:28:03 UTC (rev 66981)
@@ -409,121 +409,121 @@
 
 \lstdefinestyle{lookForAlignDelims}{
  style=yaml-LST,
- firstnumber=158,linerange={158-174},
+ firstnumber=158,linerange={158-176},
  numbers=left,
 }
 
 \lstdefinestyle{indentAfterItems}{
  style=yaml-LST,
- firstnumber=237,linerange={237-244},
+ firstnumber=239,linerange={239-246},
  numbers=left,
 }
 
 \lstdefinestyle{itemNames}{
  style=yaml-LST,
- firstnumber=250,linerange={250-252},
+ firstnumber=252,linerange={252-254},
  numbers=left,
 }
 
 \lstdefinestyle{specialBeginEnd}{
  style=yaml-LST,
- firstnumber=256,linerange={256-269},
+ firstnumber=258,linerange={258-271},
  numbers=left,
 }
 
 \lstdefinestyle{indentAfterHeadings}{
  style=yaml-LST,
- firstnumber=279,linerange={279-288},
+ firstnumber=281,linerange={281-290},
  numbers=left,
 }
 
 \lstdefinestyle{noAdditionalIndentGlobalEnv}{
  style=yaml-LST,
- firstnumber=337,linerange={337-338},
+ firstnumber=339,linerange={339-340},
  numbers=left,
 }
 
 \lstdefinestyle{noAdditionalIndentGlobal}{
  style=yaml-LST,
- firstnumber=337,linerange={337-349},
+ firstnumber=339,linerange={339-351},
  numbers=left,
 }
 
 \lstdefinestyle{indentRulesGlobalEnv}{
  style=yaml-LST,
- firstnumber=353,linerange={353-354},
+ firstnumber=355,linerange={355-356},
  numbers=left,
 }
 
 \lstdefinestyle{indentRulesGlobal}{
  style=yaml-LST,
- firstnumber=353,linerange={353-365},
+ firstnumber=355,linerange={355-367},
  numbers=left,
 }
 
 \lstdefinestyle{commandCodeBlocks}{
  style=yaml-LST,
- firstnumber=368,linerange={368-383},
+ firstnumber=370,linerange={370-385},
  numbers=left,
 }
 
 \lstdefinestyle{modifylinebreaks}{
  style=yaml-LST,
- firstnumber=498,linerange={498-500},
+ firstnumber=500,linerange={500-502},
  numbers=left,
 }
 
 \lstdefinestyle{textWrapOptions}{
  style=yaml-LST,
- firstnumber=526,linerange={526-527},
+ firstnumber=528,linerange={528-529},
  numbers=left,
 }
 
 \lstdefinestyle{textWrapOptionsAll}{
  style=yaml-LST,
- firstnumber=526,linerange={526-553},
+ firstnumber=528,linerange={528-555},
  numbers=left,
 }
 
 \lstdefinestyle{oneSentencePerLine}{
  style=yaml-LST,
- firstnumber=501,linerange={501-525},
+ firstnumber=503,linerange={503-527},
  numbers=left,
 }
 
 \lstdefinestyle{sentencesFollow}{
  style=yaml-LST,
- firstnumber=507,linerange={507-515},
+ firstnumber=509,linerange={509-517},
  numbers=left,
 }
 
 \lstdefinestyle{sentencesBeginWith}{
  style=yaml-LST,
- firstnumber=516,linerange={516-519},
+ firstnumber=518,linerange={518-521},
  numbers=left,
 }
 
 \lstdefinestyle{sentencesEndWith}{
  style=yaml-LST,
- firstnumber=520,linerange={520-525},
+ firstnumber=522,linerange={522-527},
  numbers=left,
 }
 
 \lstdefinestyle{modifylinebreaksEnv}{
  style=yaml-LST,
- firstnumber=555,linerange={555-564},
+ firstnumber=557,linerange={557-566},
  numbers=left,
 }
 
 \lstdefinestyle{replacements}{
  style=yaml-LST,
- firstnumber=616,linerange={616-624},
+ firstnumber=618,linerange={618-626},
  numbers=left,
 }
 
 \lstdefinestyle{fineTuning}{
  style=yaml-LST,
- firstnumber=627,linerange={627-679},
+ firstnumber=629,linerange={629-681},
  numbers=left,
 }
 
@@ -1000,8 +1000,8 @@
  gives \cref{lst:quick-start-mod8}; note that the \emph{preamble} has been indented.
 
  \begin{cmhtcbraster}
-  \cmhlistingsfromfile*{demonstrations/quick-start-mod8.tex}{\texttt{quick-start-mod8.tex}}{lst:quick-start-mod8}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/quick-start8.yaml}[yaml-TCB]{\texttt{quick-start8.yaml}}{lst:quick-start8yaml}
+  \cmhlistingsfromfile{demonstrations/quick-start-mod8.tex}{\texttt{quick-start-mod8.tex}}{lst:quick-start-mod8}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/quick-start8.yaml}[yaml-TCB]{\texttt{quick-start8.yaml}}{lst:quick-start8yaml}
  \end{cmhtcbraster}
 
  See \cref{subsec:filecontents:preamble}.
@@ -1018,8 +1018,8 @@
  gives \cref{lst:quick-start-mod9}.
 
  \begin{cmhtcbraster}
-  \cmhlistingsfromfile*{demonstrations/quick-start-mod9.tex}{\texttt{quick-start-mod9.tex}}{lst:quick-start-mod9}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/quick-start9.yaml}[yaml-TCB]{\texttt{quick-start9.yaml}}{lst:quick-start9yaml}
+  \cmhlistingsfromfile{demonstrations/quick-start-mod9.tex}{\texttt{quick-start-mod9.tex}}{lst:quick-start-mod9}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/quick-start9.yaml}[yaml-TCB]{\texttt{quick-start9.yaml}}{lst:quick-start9yaml}
  \end{cmhtcbraster}
 
  See \cref{sec:noadd-indent-rules}.
@@ -1793,7 +1793,7 @@
  to load your own settings files.
 
  We focus our discussion on \texttt{indentconfig.yaml}, but there are other options which
- are detailed in \cref{app:indentconfig:options}. \announce*{2023-01-01}{indentconfig
+ are detailed in \cref{app:indentconfig:options}. \announce{2023-01-01}{indentconfig
  location options}
 
 \subsection{indentconfig.yaml and .indentconfig.yaml}
@@ -2460,7 +2460,16 @@
         the same column, discussed in \cref{sec:delimiter-reg-ex};
   \item \announce{2021-12-13}{lookForChildCodeBlocks feature}{lookForChildCodeBlocks}
         optionally instructs \texttt{latexindent.pl} to search for child code blocks or
-        not (default: 1), discussed in \cref{sec:lookForChildCodeBlocks}.
+        not (default: 1), discussed in \cref{sec:lookForChildCodeBlocks};
+  \item \announce*{2023-05-01}{alignContentAfterDoubleBackSlash feature}
+        alignContentAfterDoubleBackSlash optionally instructs \texttt{latexindent.pl} to
+        align content \emph{after} double back slash (default: 0), discussed in
+        \cref{sec:alignContentAfterDoubleBackSlash};
+  \item \announce*{2023-05-01}{spacesAfterDoubleBackSlash feature}
+        spacesAfterDoubleBackSlash optionally specifies the number (integer $\geq$ 0) of
+        spaces to be placed \emph{after} the double back slash \emph{when
+        alignContentAfterDoubleBackSlash is active}; demonstrated in
+        \cref{sec:alignContentAfterDoubleBackSlash}.
  \end{itemize}
 
  \begin{example}
@@ -3037,6 +3046,59 @@
  \end{cmhtcbraster}
  \end{example}
 
+\subsubsection{lookForAlignDelims: alignContentAfterDoubleBackSlash}\label{sec:alignContentAfterDoubleBackSlash}
+ You can instruct \texttt{latexindent} to align \announce*{2023-05-01}{align content
+ after double back slash} content after the double back slash. See also
+ \vref{subsec:dbs}.
+
+ \begin{example}
+ We consider the file in \cref{lst:tabular5}, and the default output given in
+ \cref{lst:tabular5-default}.
+
+ \begin{cmhtcbraster}
+  \cmhlistingsfromfile*{demonstrations/tabular5.tex}{\texttt{tabular5.tex}}{lst:tabular5}
+  \cmhlistingsfromfile*{demonstrations/tabular5-default.tex}{\texttt{tabular5-default.tex}}{lst:tabular5-default}
+ \end{cmhtcbraster}
+
+ Using the settings given in \cref{lst:alignContentAfterDBS1} and running
+
+ \begin{commandshell}
+latexindent.pl -s tabular5.tex -l alignContentAfterDBS1 -o=+-mod1
+\end{commandshell}
+
+ gives the output in \cref{lst:tabular5-mod1}.
+
+ \begin{cmhtcbraster}[raster columns=2,
+   raster left skip=-2.5cm,
+   raster column skip=.03\linewidth]
+  \cmhlistingsfromfile*{demonstrations/tabular5-mod1.tex}{\texttt{tabular5-mod1.tex}}{lst:tabular5-mod1}
+  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/alignContentAfterDBS1.yaml}[yaml-TCB]{\texttt{alignContentAfterDBS1.yaml}}{lst:alignContentAfterDBS1}
+ \end{cmhtcbraster}
+ \end{example}
+
+ \begin{example}
+ When using the \texttt{alignContentAfterDoubleBackSlash} feature, then you can also
+ specify how many spaces to insert after the double backslash; the default is 1.
+ \announce*{2023-05-01}{specify number of spaces after double back slash when aligning
+ content after double back slash}
+
+ Starting from \cref{lst:tabular5} and using the the settings given in
+ \cref{lst:alignContentAfterDBS2}
+
+ \begin{commandshell}
+latexindent.pl -s tabular5.tex -l alignContentAfterDBS2 -o=+-mod2
+\end{commandshell}
+
+ gives the output in \cref{lst:tabular5-mod2}.
+
+ \begin{cmhtcbraster}[raster columns=2,
+   raster left skip=-2.5cm,
+   raster column skip=.03\linewidth]
+  \cmhlistingsfromfile*{demonstrations/tabular5-mod2.tex}{\texttt{tabular5-mod2.tex}}{lst:tabular5-mod2}
+  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/alignContentAfterDBS2.yaml}[yaml-TCB]{\texttt{alignContentAfterDBS2.yaml}}{lst:alignContentAfterDBS2}
+ \end{cmhtcbraster}
+ \end{example}
+
 \subsection{Indent after items, specials and headings}
 \yamltitle{indentAfterItems}*{fields}
  The environment names specified in \texttt{indentAfterItems} tell
@@ -4699,7 +4761,7 @@
   \item it happens \emph{after} verbatim blocks have been found;
   \item it happens \emph{after} the oneSentencePerLine routine (see
         \cref{sec:onesentenceperline});
-  \item it can happen \emph{before} or \emph{after} \announce*{2023-01-01}{text wrap:
+  \item it can happen \emph{before} or \emph{after} \announce{2023-01-01}{text wrap:
         before/after} all of the other code blocks are found and does \emph{not} operate
         on a per-code-block basis; when using \texttt{before} this means that, including
         indentation, you may receive a column width wider than that which you specify in
@@ -4730,7 +4792,7 @@
                (possibly combined) trailing comments is determined by the spaces (if any)
                at the end of the text wrap block (see \cref{lst:tw-tc5});
         \end{enumerate}
-  \item trailing comments can receive text wrapping \announce*{2023-01-01}{text wrap
+  \item trailing comments can receive text wrapping \announce{2023-01-01}{text wrap
         trailing comments}; examples are shown in \cref{subsubsec:tw:comments} and
         \cref{subsubsec:ospl:tw:comments}.
  \end{enumerate}
@@ -5196,7 +5258,7 @@
 
 \subsubsection{Text wrap: when before/after}\label{subsubsec:tw:before:after}
  The text wrapping routine operates, by default, \texttt{before} the
- \announce*{2023-01-01}{text wrap: before/after details} code blocks have been found, but
+ \announce{2023-01-01}{text wrap: before/after details} code blocks have been found, but
  this can be changed to \texttt{after}:
  \begin{itemize}
   \item \texttt{before} means it is likely that the columns of wrapped text may \emph{exceed} the
@@ -5210,7 +5272,7 @@
  \begin{example}
  Let's begin with the file in \cref{lst:textwrap8}.
 
- \cmhlistingsfromfile*{demonstrations/textwrap8.tex}{\texttt{textwrap8.tex}}{lst:textwrap8}
+ \cmhlistingsfromfile{demonstrations/textwrap8.tex}{\texttt{textwrap8.tex}}{lst:textwrap8}
 
  Using the settings given in \cref{lst:tw-before1} and running the command
 
@@ -5224,8 +5286,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/textwrap8-mod1.tex}{\texttt{textwrap8-mod1.tex}}{lst:textwrap8-mod1}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/tw-before1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{tw-before1.yaml}}{lst:tw-before1}
+  \cmhlistingsfromfile{demonstrations/textwrap8-mod1.tex}{\texttt{textwrap8-mod1.tex}}{lst:textwrap8-mod1}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tw-before1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{tw-before1.yaml}}{lst:tw-before1}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:textwrap8-mod1}, that the wrapped text has \emph{exceeded}
@@ -5248,8 +5310,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/textwrap8-mod2.tex}{\texttt{textwrap8-mod2.tex}}{lst:textwrap8-mod2}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/tw-after1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{tw-after1.yaml}}{lst:tw-after1}
+  \cmhlistingsfromfile{demonstrations/textwrap8-mod2.tex}{\texttt{textwrap8-mod2.tex}}{lst:textwrap8-mod2}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/tw-after1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{tw-after1.yaml}}{lst:tw-after1}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:textwrap8-mod2}, that the wrapped text has \emph{obeyed} the
@@ -5258,7 +5320,7 @@
 
 \subsubsection{Text wrap: wrapping comments}\label{subsubsec:tw:comments}
  You can instruct \texttt{latexindent.pl} to apply text wrapping to comments
- \announce*{2023-01-01}{text wrap trailing comments}; we demonstrate this with examples,
+ \announce{2023-01-01}{text wrap trailing comments}; we demonstrate this with examples,
  see also \cref{subsubsec:ospl:tw:comments}. \index{comments!text wrap} \index{text
  wrap!comments}
 
@@ -5265,7 +5327,7 @@
  \begin{example}
  We use the file in \cref{lst:textwrap9} which contains a trailing comment block.
 
- \cmhlistingsfromfile*{demonstrations/textwrap9.tex}{\texttt{textwrap9.tex}}{lst:textwrap9}
+ \cmhlistingsfromfile{demonstrations/textwrap9.tex}{\texttt{textwrap9.tex}}{lst:textwrap9}
 
  Using the settings given in \cref{lst:wrap-comments1} and running the command
 
@@ -5279,8 +5341,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/textwrap9-mod1.tex}{\texttt{textwrap9-mod1.tex}}{lst:textwrap9-mod1}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/wrap-comments1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{wrap-comments1.yaml}}{lst:wrap-comments1}
+  \cmhlistingsfromfile{demonstrations/textwrap9-mod1.tex}{\texttt{textwrap9-mod1.tex}}{lst:textwrap9-mod1}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/wrap-comments1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{wrap-comments1.yaml}}{lst:wrap-comments1}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:textwrap9-mod1}, that the comments have been \emph{combined
@@ -5290,7 +5352,7 @@
  \begin{example}
  We use the file in \cref{lst:textwrap10} which contains a trailing comment block.
 
- \cmhlistingsfromfile*{demonstrations/textwrap10.tex}{\texttt{textwrap10.tex}}{lst:textwrap10}
+ \cmhlistingsfromfile{demonstrations/textwrap10.tex}{\texttt{textwrap10.tex}}{lst:textwrap10}
 
  Using the settings given in \cref{lst:wrap-comments1:repeat} and running the command
 
@@ -5304,8 +5366,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/textwrap10-mod1.tex}{\texttt{textwrap10-mod1.tex}}{lst:textwrap10-mod1}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/wrap-comments1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{wrap-comments1.yaml}}{lst:wrap-comments1:repeat}
+  \cmhlistingsfromfile{demonstrations/textwrap10-mod1.tex}{\texttt{textwrap10-mod1.tex}}{lst:textwrap10-mod1}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/wrap-comments1.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{wrap-comments1.yaml}}{lst:wrap-comments1:repeat}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:textwrap10-mod1}, that the comments have been \emph{combined
@@ -5329,8 +5391,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/textwrap10-mod2.tex}{\texttt{textwrap10-mod2.tex}}{lst:textwrap10-mod2}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/wrap-comments2.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{wrap-comments2.yaml}}{lst:wrap-comments2}
+  \cmhlistingsfromfile{demonstrations/textwrap10-mod2.tex}{\texttt{textwrap10-mod2.tex}}{lst:textwrap10-mod2}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/wrap-comments2.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{wrap-comments2.yaml}}{lst:wrap-comments2}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:textwrap10-mod2}, that the comments have been \emph{combined
@@ -5881,7 +5943,7 @@
 
 \subsubsection{oneSentencePerLine: text wrapping and indenting sentences, when before/after}\label{subsubsec:ospl:before:after}
  The text wrapping routine operates, by default, \texttt{before} the
- \announce*{2023-01-01}{text wrap: before/after details} code blocks have been found, but
+ \announce{2023-01-01}{text wrap: before/after details} code blocks have been found, but
  this can be changed to \texttt{after}:
  \begin{itemize}
   \item \texttt{before} means it is likely that the columns of wrapped text may \emph{exceed} the
@@ -5895,7 +5957,7 @@
  \begin{example}
  Let's begin with the file in \cref{lst:multiple-sentences8}.
 
- \cmhlistingsfromfile*{demonstrations/multiple-sentences8.tex}{\texttt{multiple-sentences8.tex}}{lst:multiple-sentences8}
+ \cmhlistingsfromfile{demonstrations/multiple-sentences8.tex}{\texttt{multiple-sentences8.tex}}{lst:multiple-sentences8}
 
  Using the settings given in \cref{lst:sentence-wrap2} and running the command
 
@@ -5909,8 +5971,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/multiple-sentences8-mod1.tex}{\texttt{multiple-sentences8-mod1.tex}}{lst:multiple-sentences8-mod1}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/sentence-wrap2.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{sentence-wrap2.yaml}}{lst:sentence-wrap2}
+  \cmhlistingsfromfile{demonstrations/multiple-sentences8-mod1.tex}{\texttt{multiple-sentences8-mod1.tex}}{lst:multiple-sentences8-mod1}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/sentence-wrap2.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{sentence-wrap2.yaml}}{lst:sentence-wrap2}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:multiple-sentences8-mod1}, that the wrapped text has
@@ -5934,8 +5996,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/multiple-sentences8-mod2.tex}{\texttt{multiple-sentences8-mod2.tex}}{lst:multiple-sentences8-mod2}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/sentence-wrap3.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{sentence-wrap3.yaml}}{lst:sentence-wrap3}
+  \cmhlistingsfromfile{demonstrations/multiple-sentences8-mod2.tex}{\texttt{multiple-sentences8-mod2.tex}}{lst:multiple-sentences8-mod2}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/sentence-wrap3.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{sentence-wrap3.yaml}}{lst:sentence-wrap3}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:multiple-sentences8-mod2}, that the wrapped text has
@@ -5951,7 +6013,7 @@
  \begin{example}
  Let's begin with the file in \cref{lst:multiple-sentences9}.
 
- \cmhlistingsfromfile*{demonstrations/multiple-sentences9.tex}{\texttt{multiple-sentences9.tex}}{lst:multiple-sentences9}
+ \cmhlistingsfromfile{demonstrations/multiple-sentences9.tex}{\texttt{multiple-sentences9.tex}}{lst:multiple-sentences9}
 
  Using the settings given in \cref{lst:sentence-wrap4} and running the command
 
@@ -5965,8 +6027,8 @@
    raster left skip=-1.5cm,
    raster right skip=-0cm,
    raster column skip=.06\linewidth]
-  \cmhlistingsfromfile*{demonstrations/multiple-sentences9-mod1.tex}{\texttt{multiple-sentences9-mod1.tex}}{lst:multiple-sentences9-mod1}
-  \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/sentence-wrap4.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{sentence-wrap4.yaml}}{lst:sentence-wrap4}
+  \cmhlistingsfromfile{demonstrations/multiple-sentences9-mod1.tex}{\texttt{multiple-sentences9-mod1.tex}}{lst:multiple-sentences9-mod1}
+  \cmhlistingsfromfile[style=yaml-LST]{demonstrations/sentence-wrap4.yaml}[MLB-TCB,width=0.4\linewidth]{\texttt{sentence-wrap4.yaml}}{lst:sentence-wrap4}
  \end{cmhtcbraster}
 
  We note that, in \cref{lst:multiple-sentences9-mod1}, that the sentences have been
@@ -6591,7 +6653,7 @@
  (\vref{lst:tabularafter:basic}), commands (\vref{lst:matrixafter}), or special code
  blocks (\vref{lst:specialafter}). \footnote{There is no longer any need for the code
  block to be specified within \texttt{lookForAlignDelims} for DBS poly-switches to
- activate. \announce*{2023-01-01}*{DBS poly-switches no need to specify
+ activate. \announce{2023-01-01}*{DBS poly-switches no need to specify
  lookForAlignDelims}} \index{delimiters!poly-switches for double backslash}
  \index{modifying linebreaks! surrounding double backslash} \index{poly-switches!for
  double back slash (delimiters)}%
@@ -6654,6 +6716,39 @@
   \end{itemize}
   \end{example}
 
+  \begin{example}
+  We can combine DBS poly-switches with, for example, the
+  \texttt{alignContentAfterDoubleBackSlash} in
+  \vref{sec:alignContentAfterDoubleBackSlash}.
+
+  For example, starting with the file \cref{lst:tabular6}, and using the settings in
+  \vref{lst:alignContentAfterDBS1,lst:alignContentAfterDBS2} and running
+  \begin{widepage}
+
+   \begin{commandshell}
+latexindent.pl -s -m -l alignContentAfterDBS1.yaml,DBS1.yaml tabular6.tex -o=+-mod1
+latexindent.pl -s -m -l alignContentAfterDBS2.yaml,DBS1.yaml tabular6.tex -o=+-mod2
+\end{commandshell}
+
+  \end{widepage}
+  gives the respective outputs shown in \cref{lst:tabular6-mod1,lst:tabular6-mod2}.
+  \begin{cmhtcbraster}[raster columns=3,
+    raster left skip=-3.5cm,
+    raster right skip=-2cm,
+    raster column skip=.03\linewidth]
+   \cmhlistingsfromfile*{demonstrations/tabular6.tex}{\texttt{tabular6.tex}}{lst:tabular6}
+   \cmhlistingsfromfile*{demonstrations/tabular6-mod1.tex}{\texttt{tabular6-mod1.tex}}{lst:tabular6-mod1}
+   \cmhlistingsfromfile*{demonstrations/tabular6-mod2.tex}{\texttt{tabular6-mod2.tex}}{lst:tabular6-mod2}
+  \end{cmhtcbraster}
+  We note that:
+  \begin{itemize}
+   \item in \cref{lst:tabular6-mod1} the content \emph{after} the double back slash has
+         been aligned;
+   \item in \cref{lst:tabular6-mod2} we see that 3 spaces have been added after the
+         double back slash.
+  \end{itemize}
+  \end{example}
+
  \paragraph{Double backslash finishes with line break}
   \begin{example}
   Let's now explore \texttt{DBSFinishesWithLineBreak} ($\ElseFinishesWithLineBreak$ in
@@ -8888,7 +8983,7 @@
  \section{indentconfig options}\label{app:indentconfig:options}
   This section describes the possible locations for the main configuration file,
   discussed in \cref{sec:indentconfig}. Thank you to \cite{nehctargl} for this
-  contribution. \announce*{2023-01-01}{indentconfig location options}
+  contribution. \announce{2023-01-01}{indentconfig location options}
 
   The possible locations of \texttt{indentconfig.yaml} are read one after the other, and
   reading stops when a valid file is found in one of the paths.

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/AlignmentAtAmpersand.pm	2023-05-01 20:28:03 UTC (rev 66981)
@@ -132,7 +132,9 @@
 }
 
 sub align_at_ampersand {
-    my $self = shift;
+    my $self  = shift;
+    my %input = @_;
+
     return if ( ${$self}{bodyLineBreaks} == 0 );
 
     # some blocks may contain verbatim to be measured
@@ -286,10 +288,26 @@
                     colSpan         => ".",
                     delimiter       => "",
                     delimiterLength => 0,
-                    measureThis     => ( $numberOfAmpersands > 0 ? ${$self}{measureRow} : 0 )
+                    measureThis     => ( $numberOfAmpersands > 0 ? ${$self}{measureRow} : 0 ),
+                    DBSpadding      => 0,
                 }
             );
 
+            #
+            # if content is to be aligned after \\
+            # (using alignContentAfterDoubleBackSlash) then we need to
+            # adjust the width of the first cell
+            #
+            if ( defined $input{beforeDBSlengths} and $columnCounter == 0 ) {
+                my $currentRowDBSlength = ${ $input{beforeDBSlengths} }[ $rowCounter + 1 ];
+                ${ $cellStorage[$rowCounter][$columnCounter] }{width}
+                    += $currentRowDBSlength + ( $input{maxDBSlength} - $currentRowDBSlength );
+
+                ${ $cellStorage[$rowCounter][$columnCounter] }{DBSpadding}
+                    = ( $input{maxDBSlength} - $currentRowDBSlength );
+
+            }
+
             # possible hidden children, see https://github.com/cmhughes/latexindent.pl/issues/85
             if ( ( ${$self}{measureHiddenChildren} or ${$self}{measureVerbatim} )
                 and $column =~ m/.*?$tokens{beginOfToken}/s )
@@ -329,6 +347,7 @@
                             colSpan           => ".",
                             delimiter         => "",
                             delimiterLength   => 0,
+                            DBSpadding        => 0,
                             measureThis       => 0
                         }
                     );
@@ -380,7 +399,7 @@
             for (
             "entry",       "type",               "colSpan",           "width",
             "measureThis", "maximumColumnWidth", "individualPadding", "groupPadding",
-            "delimiter",   "delimiterLength"
+            "delimiter",   "delimiterLength",    "DBSpadding"
             );
     }
 
@@ -387,6 +406,17 @@
     # main formatting loop
     $self->main_formatting;
 
+    if ( defined $input{measure_after_DBS} ) {
+
+        # delete the original body
+        ${$self}{body} = q();
+
+        # update the body
+        ${$self}{body} .= ${$_}{row} . "\n" for @formattedBody;
+
+        return;
+    }
+
     #
     # final \\ loop
     #
@@ -447,6 +477,49 @@
         }
     }
 
+    #
+    # put original body and 'after DBS body' together
+    #
+    if ( ${$self}{alignContentAfterDoubleBackSlash} ) {
+
+        # check that spacesAfterDoubleBackSlash>=0
+        ${$self}{spacesAfterDoubleBackSlash} = max( ${$self}{spacesAfterDoubleBackSlash}, 0 );
+
+        my @beforeDBSlengths      = q();
+        my @originalFormattedBody = @formattedBody;
+        my $afterDBSbody          = q();
+        my $maxDBSlength          = 0;
+        foreach (@originalFormattedBody) {
+            ${$_}{row} =~ s/(.*?)(${${$mainSettings{fineTuning}}{modifyLineBreaks}}{doubleBackSlash})\h*//s;
+            ${$_}{beforeDBS} = ( $1 ? $1 : q() );
+            ${$_}{DBS}       = ( $2 ? $2 : q() );
+            ${$_}{DBS} .= " " x ( ${$self}{spacesAfterDoubleBackSlash} ) if ( ${$_}{DBS} ne '' );
+            $afterDBSbody .= ${$_}{row} . "\n";
+            push( @beforeDBSlengths, &get_column_width( ${$_}{beforeDBS} . ${$_}{DBS} ) );
+            $maxDBSlength = max( $maxDBSlength, &get_column_width( ${$_}{beforeDBS} . ${$_}{DBS} ) );
+        }
+
+        ${$self}{body} = $afterDBSbody;
+        $self->align_at_ampersand(
+            measure_after_DBS => 1,
+            beforeDBSlengths  => \@beforeDBSlengths,
+            maxDBSlength      => $maxDBSlength
+        );
+
+        # create new afterDBSbody
+        my @afterDBSbody = split( "\n", ${$self}{body} );
+
+        # combine ORIGINAL body and ENDPIECE body
+        my $index = -1;
+        foreach (@originalFormattedBody) {
+            $index++;
+            ${$_}{row} = ${$_}{beforeDBS} . ${$_}{DBS};
+            ${$_}{row} .= $afterDBSbody[$index];
+        }
+
+        @formattedBody = @originalFormattedBody;
+    }
+
     # delete the original body
     ${$self}{body} = q();
 
@@ -533,6 +606,12 @@
                 next;
             }
 
+            # alignment *after* double back slash, see
+            #
+            #   test-cases/alignment/issue-393.tex
+            #
+            $tmpRow .= " " x ${$cell}{DBSpadding};
+
             # the placement of the padding is dependent on the value of justification
             if ( ${$self}{justification} eq "left" ) {
 
@@ -899,6 +978,7 @@
                         colSpan           => ".",
                         delimiter         => "",
                         delimiterLength   => 0,
+                        DBSpadding        => 0,
                     }
                 );
             }

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2023-05-01 20:28:03 UTC (rev 66981)
@@ -39,20 +39,22 @@
 
 # default values for align at ampersand routine
 our @alignAtAmpersandInformation = (
-    { name => "lookForAlignDelims",          yamlname => "delims", default => 1 },
-    { name => "alignDoubleBackSlash",        default  => 1 },
-    { name => "spacesBeforeDoubleBackSlash", default  => 1 },
-    { name => "multiColumnGrouping",         default  => 0 },
-    { name => "alignRowsWithoutMaxDelims",   default  => 1 },
-    { name => "spacesBeforeAmpersand",       default  => 1 },
-    { name => "spacesAfterAmpersand",        default  => 1 },
-    { name => "justification",               default  => "left" },
-    { name => "alignFinalDoubleBackSlash",   default  => 0 },
-    { name => "dontMeasure",                 default  => 0 },
-    { name => "delimiterRegEx",              default  => "(?<!\\\\)(&)" },
-    { name => "delimiterJustification",      default  => "left" },
-    { name => "leadingBlankColumn",          default  => -1 },
-    { name => "lookForChildCodeBlocks",      default  => 1 },
+    { name => "lookForAlignDelims",               yamlname => "delims", default => 1 },
+    { name => "alignDoubleBackSlash",             default  => 1 },
+    { name => "spacesBeforeDoubleBackSlash",      default  => 1 },
+    { name => "multiColumnGrouping",              default  => 0 },
+    { name => "alignRowsWithoutMaxDelims",        default  => 1 },
+    { name => "spacesBeforeAmpersand",            default  => 1 },
+    { name => "spacesAfterAmpersand",             default  => 1 },
+    { name => "justification",                    default  => "left" },
+    { name => "alignFinalDoubleBackSlash",        default  => 0 },
+    { name => "dontMeasure",                      default  => 0 },
+    { name => "delimiterRegEx",                   default  => "(?<!\\\\)(&)" },
+    { name => "delimiterJustification",           default  => "left" },
+    { name => "leadingBlankColumn",               default  => -1 },
+    { name => "lookForChildCodeBlocks",           default  => 1 },
+    { name => "alignContentAfterDoubleBackSlash", default  => 0 },
+    { name => "spacesAfterDoubleBackSlash",       default  => 1 },
 );
 
 sub yaml_read_settings {

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2023-05-01 20:28:03 UTC (rev 66981)
@@ -20,6 +20,6 @@
 use Exporter qw/import/;
 our @EXPORT_OK = qw/$versionNumber $versionDate/;
 
-our $versionNumber = '3.20.6';
-our $versionDate   = '2023-04-11';
+our $versionNumber = '3.21';
+our $versionDate   = '2023-05-01';
 1

Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2023-05-01 20:27:26 UTC (rev 66980)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2023-05-01 20:28:03 UTC (rev 66981)
@@ -1,5 +1,5 @@
 #
-# latexindent.pl, version 3.20.6, 2023-04-11
+# latexindent.pl, version 3.21, 2023-05-01
 #
 # defaultSettings.yaml, the default settings for latexindent.pl
 # 
@@ -170,6 +170,8 @@
       delimiterRegEx: (?<!\\)(&)
       delimiterJustification: left
       lookForChildCodeBlocks: 1
+      alignContentAfterDoubleBackSlash: 0
+      spacesAfterDoubleBackSlash: 1
    tabularx:
       delims: 1
    longtable: 1

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



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