texlive[69269] trunk: latexindent (1jan24)

commits+karl at tug.org commits+karl at tug.org
Mon Jan 1 21:51:03 CET 2024


Revision: 69269
          https://tug.org/svn/texlive?view=revision&revision=69269
Author:   karl
Date:     2024-01-01 21:51:03 +0100 (Mon, 01 Jan 2024)
Log Message:
-----------
latexindent (1jan24)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
    trunk/Master/bin/windows/latexindent.exe
    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/Replacement.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.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/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README	2024-01-01 20:51:03 UTC (rev 69269)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    latexindent.pl, version 3.23.4, 2023-11-19
+    latexindent.pl, version 3.23.5, 2024-01-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	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json	2024-01-01 20:51:03 UTC (rev 69269)
@@ -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.23.4 2023-11-19",
+  "description": "latexindent.pl YAML schema helper, V3.23.5 2024-01-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	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent.tex	2024-01-01 20:51:03 UTC (rev 69269)
@@ -3216,7 +3216,7 @@
  \end{itemize}
  \end{example}
 
- You can,optionally, specify \announce{2018-04-27}{update to specialBeginEnd} the
+ You can, optionally, specify \announce{2018-04-27}{update to specialBeginEnd} the
  \texttt{middle} field for anything that you specify in \texttt{specialBeginEnd}.
 
  \begin{example}
@@ -3258,6 +3258,30 @@
  \end{itemize}
  \end{example}
 
+ You may need these fields in your own YAML files (see \vref{sec:localsettings}), if you
+ use popular algorithm packages such as algorithms, algorithm2e or algpseudocode, etc.
+
+ \begin{example}
+ For example, let’s consider the \texttt{.tex} file in \cref{lst:specialAlgo}.
+ \index{specialBeginEnd!middle} \index{specialBeginEnd!Algorithms example}
+
+ \cmhlistingsfromfile*[basicstyle=\tiny]{demonstrations/specialAlgo.tex}[enhanced jigsaw,breakable]{\texttt{specialAlgo.tex}}{lst:specialAlgo}
+
+ Upon saving the YAML settings in \cref{lst:algo-yaml} and running the command
+ \index{switches!-l demonstration}
+
+ \begin{commandshell}
+latexindent.pl -l=algo.yaml specialAlgo.tex
+ \end{commandshell}
+
+ then we obtain the output given in \cref{lst:specialAlgo-mod1}.
+
+ \begin{cmhtcbraster}
+  \cmhlistingsfromfile*[basicstyle=\tiny]{demonstrations/specialAlgo-mod1.tex}{\texttt{specialAlgo.tex} using \cref{lst:algo-yaml}}{lst:specialAlgo-mod1}
+  \cmhlistingsfromfile*[style=yaml-LST,basicstyle=\tiny,commentstyle=\color{blue}\ttfamily\tiny]{demonstrations/algo.yaml}[yaml-TCB]{\texttt{algo.yaml}}{lst:algo-yaml}
+ \end{cmhtcbraster}
+ \end{example}
+
  You may \announce{2018-08-13}{specialBeginEnd verbatim} specify fields in
  \texttt{specialBeginEnd} to be treated as verbatim code blocks by changing
  \texttt{lookForThis} to be \texttt{verbatim}. \index{verbatim!specialBeginEnd}%

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Replacement.pm	2024-01-01 20:51:03 UTC (rev 69269)
@@ -66,21 +66,17 @@
                 if ( ${$_}{this} and ${$_}{substitution} );
             if ( ${$_}{this} ) {
 
+                #
                 # *string* replacement
-                # *string* replacement
-                # *string* replacement
-                my $this        = qq{${$_}{this}};
-                my $that        = ( defined ${$_}{that} ) ? qq{${$_}{that}} : q();
-                my $index_match = index( ${$self}{body}, $this );
-                while ( $index_match != -1 ) {
-                    substr( ${$self}{body}, $index_match, length($this), $that );
-                    $index_match = index( ${$self}{body}, $this );
-                }
+                #
+                my $this = quotemeta( ${$_}{this} );
+                my $that = ( defined ${$_}{that} ) ? qq{${$_}{that}} : q();
+                ${$self}{body} = join( $that, split( $this, ${$self}{body} ) );
             }
             else {
+                #
                 # *regex* replacement
-                # *regex* replacement
-                # *regex* replacement
+                #
 
 # https://stackoverflow.com/questions/12423337/how-to-pass-a-replacing-regex-as-a-command-line-argument-to-a-perl-script
                 my $body = ${$self}{body};

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2024-01-01 20:51:03 UTC (rev 69269)
@@ -20,6 +20,6 @@
 use Exporter qw/import/;
 our @EXPORT_OK = qw/$versionNumber $versionDate/;
 
-our $versionNumber = '3.23.4';
-our $versionDate   = '2023-11-19';
+our $versionNumber = '3.23.5';
+our $versionDate   = '2024-01-01';
 1

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm	2024-01-01 20:51:03 UTC (rev 69269)
@@ -340,6 +340,7 @@
                         $thingToMeasure =~ s/$tokens{verbatim}\d+$tokens{endOfToken}//;
                         $thingToMeasure =~ s/$trailingCommentRegExp//;
                         $thingToMeasure =~ s/$headingsRegEx//;
+                        $thingToMeasure =~ s/\\end\{[^}]+?\}//;
 
                         $subsequentSpace = (
                             $textWrapBlockCount == 0

Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2024-01-01 20:50:44 UTC (rev 69268)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2024-01-01 20:51:03 UTC (rev 69269)
@@ -1,5 +1,5 @@
 #
-# latexindent.pl, version 3.23.4, 2023-11-19
+# latexindent.pl, version 3.23.5, 2024-01-01
 #
 # defaultSettings.yaml, the default settings for latexindent.pl
 #

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



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