texlive[63492] trunk: latexindent (5jun22)

commits+karl at tug.org commits+karl at tug.org
Sun Jun 5 23:03:31 CEST 2022


Revision: 63492
          http://tug.org/svn/texlive?view=revision&revision=63492
Author:   karl
Date:     2022-06-05 23:03:30 +0200 (Sun, 05 Jun 2022)
Log Message:
-----------
latexindent (5jun22)

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-yaml-schema.json
    trunk/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
    trunk/Master/texmf-dist/doc/support/latexindent/sec-appendices.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-conclusions-know-limitations.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex
    trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
    trunk/Master/texmf-dist/doc/support/latexindent/subsec-text-wrap.tex
    trunk/Master/texmf-dist/doc/support/latexindent/title.tex
    trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.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/win32/latexindent.exe
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/latexindent/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/README	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/README	2022-06-05 21:03:30 UTC (rev 63492)
@@ -1,5 +1,5 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    latexindent.pl, version 3.17.2, 2022-04-14
+    latexindent.pl, version 3.17.3, 2022-06-05
 
     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	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/latexindent-yaml-schema.json	2022-06-05 21:03:30 UTC (rev 63492)
@@ -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.17.2 2022-04-14",
+    "description": "latexindent.pl YAML schema helper, V3.17.3 2022-06-05",
     "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/sec-appendices.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-appendices.tex	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-appendices.tex	2022-06-05 21:03:30 UTC (rev 63492)
@@ -2,11 +2,17 @@
 \appendix
  \section{Required Perl modules}\label{sec:requiredmodules}
   If you intend to use \texttt{latexindent.pl} and \emph{not} one of the supplied
-  standalone executable files, then you will need a few standard Perl modules -- if you can
-  run the minimum code in \cref{lst:helloworld} (\texttt{perl helloworld.pl}) then you will
-  be able to run \texttt{latexindent.pl}, otherwise you may need to install the missing
-  modules -- see \cref{sec:module-installer,sec:manual-module-instal}.
+  standalone executable files (\texttt{latexindent.exe} is available for Windows users
+  without Perl, see \cref{subsubsec:latexindent:exe}), then you will need a few standard
+  Perl modules.
 
+  If you can run the minimum code in \cref{lst:helloworld} as in
+  \begin{commandshell}
+perl helloworld.pl
+  \end{commandshell}
+  then you will be able to run \texttt{latexindent.pl}, otherwise you may need to install
+  the missing modules; see \cref{sec:module-installer,sec:manual-module-instal}.
+
   \begin{cmhlistings}[style=tcblatex,language=Perl]{\texttt{helloworld.pl}}{lst:helloworld}
 #!/usr/bin/perl
 
@@ -137,6 +143,10 @@
 cpanm YAML::Tiny
 cpanm File::HomeDir
 \end{commandshell}
+  Alternatively,
+  \begin{commandshell}
+brew install latexindent  
+\end{commandshell}
 
  \subsubsection{Windows}
   Strawberry Perl users on Windows might use \texttt{CPAN client}. All of the modules are
@@ -595,8 +605,8 @@
 
  \section{Differences from Version 2.2 to 3.0}\label{app:differences}
   There are a few (small) changes to the interface when comparing Version 2.2 to Version
-  3.0. Explicitly, in previous versions you might have run, for example,
-  \index{switches!-o demonstration}
+  3.0. Explicitly, in previous versions you might have run, for example, \index{switches!-o
+  demonstration}
   \begin{commandshell}
 latexindent.pl -o myfile.tex outputfile.tex
 \end{commandshell}

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	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-conclusions-know-limitations.tex	2022-06-05 21:03:30 UTC (rev 63492)
@@ -1,7 +1,7 @@
 % arara: pdflatex: { files: [latexindent]}
 \section{Conclusions and known limitations}\label{sec:knownlimitations}
  There are a number of known limitations of the script, and almost certainly quite a few
- that are \emph{unknown}!  The known issues include:
+ that are \emph{unknown}! The known issues include:
  \begin{description}
   \item[multicolumn alignment] when working with code blocks in which multicolumn commands
    overlap, the algorithm can fail; see \vref{lst:tabular2-mod2}.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-fine-tuning.tex	2022-06-05 21:03:30 UTC (rev 63492)
@@ -24,7 +24,7 @@
  \end{warning}
 
  \begin{widepage}
-  \cmhlistingsfromfile[style=fineTuning]{../defaultSettings.yaml}[width=.95\linewidth,before=\centering,yaml-TCB]{\texttt{fineTuning}}{lst:fineTuning}
+  \cmhlistingsfromfile[style=fineTuning]{../defaultSettings.yaml}[width=.95\linewidth,before=\centering,enhanced jigsaw,breakable,yaml-TCB]{\texttt{fineTuning}}{lst:fineTuning}
  \end{widepage}
 
  The fields given in \cref{lst:fineTuning} are all \emph{regular expressions}. This manual

Modified: trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex	2022-06-05 21:03:30 UTC (rev 63492)
@@ -16,18 +16,26 @@
  respectively. We will discuss how to change the settings and behaviour of the script in
  \vref{sec:defuseloc}.
 
+\subsection{Requirements}
+\subsubsection{Perl users}
+ Perl users will need a few standard Perl modules -- see \vref{sec:requiredmodules} for
+ details; \announce{2018-01-13}{perl module installer helper script} in particular, note
+ that a module installer helper script is shipped with \texttt{latexindent.pl}.%
+
+\subsubsection{Windows users without perl}\label{subsubsec:latexindent:exe}
  \texttt{latexindent.pl} ships with \texttt{latexindent.exe} for Windows
- users, so that you can use the script with or without a Perl distribution. If you plan to
- use \texttt{latexindent.pl} (i.e, the original Perl script) then you will need a few
- standard Perl modules -- see \vref{sec:requiredmodules} for
- details;%
- \announce{2018-01-13}{perl module installer helper script} in particular, note that a module installer helper script is shipped with
- \texttt{latexindent.pl}.
+ users, so that you can use the script with or without a Perl distribution.
 
+ Users of \texttt{latexindent.exe} need only two files: \texttt{latexindent.exe} and
+ \texttt{defaultSettings.yaml}, both of which are available from \cite{latexindent-home}.
+
  MiKTeX users on Windows may like to see \cite{miktex-guide} for details of how to use
  \texttt{latexindent.exe} without a Perl installation. \index{MiKTeX}
- \index{latexindent.exe}
+ \index{latexindent.exe} \index{Windows}
 
+\subsubsection{conda users}
+ Users of \texttt{conda} should see the details given in \cref{sec:app:conda}.
+
 \subsection{From the command line}\label{sec:commandline}
  \texttt{latexindent.pl} has a number of different switches/flags/options, which
  can be combined in any way that you like, either in short or long form as detailed below.

Modified: trunk/Master/texmf-dist/doc/support/latexindent/subsec-text-wrap.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/subsec-text-wrap.tex	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/subsec-text-wrap.tex	2022-06-05 21:03:30 UTC (rev 63492)
@@ -30,7 +30,17 @@
   \item setting \texttt{columns} to $-1$ will \emph{only} remove line breaks within the text wrap
         block;
   \item by default, the text wrapping routine will remove line breaks within text blocks because
-        \texttt{removeBlockLineBreaks} is set to 1; switch it to 0 if you wish to change this.
+        \texttt{removeBlockLineBreaks} is set to 1; switch it to 0 if you wish to change this;
+  \item about trailing comments within text wrap blocks:
+        \begin{enumerate}
+         \item trailing comments that do \emph{not} have leading space instruct the text wrap routine to
+               connect the lines \emph{without} space (see \cref{lst:tw-tc2});
+         \item multiple trailing comments will be connected at the end of the text wrap block (see
+               \cref{lst:tw-tc4});
+         \item the number of spaces between the end of the text wrap block and the (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}
  \end{enumerate}
 
  We demonstrate this feature using a series of examples.
@@ -349,6 +359,101 @@
   Naturally, you should feel encouraged to customise this as you see fit.
  \end{example}
 
+\subsubsection{Text wrap: trailing comments and spaces}
+ We explore the behaviour of the text wrap routine in relation to trailing comments using
+ the following examples.
+
+ \begin{example}
+  The file in \cref{lst:tw-tc1} contains a trailing comment which \emph{does} have a space
+  infront of it.
+
+  Running the command
+  \begin{commandshell}
+latexindent.pl -m tw-tc1.tex -l textwrap1A.yaml -o=+-mod1 
+\end{commandshell}
+  gives the output given in \cref{lst:tw-tc1-mod1}.
+
+  \begin{cmhtcbraster}[raster column skip=.1\linewidth]
+   \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc1.tex}{\texttt{tw-tc1.tex}}{lst:tw-tc1}
+   \cmhlistingsfromfile*{demonstrations/tw-tc1-mod1.tex}{\texttt{tw-tc1-mod1.tex}}{lst:tw-tc1-mod1}
+  \end{cmhtcbraster}
+ \end{example}
+
+ \begin{example}
+  The file in \cref{lst:tw-tc2} contains a trailing comment which does \emph{not} have a
+  space infront of it.
+
+  Running the command
+  \begin{commandshell}
+latexindent.pl -m tw-tc2.tex -l textwrap1A.yaml -o=+-mod1 
+\end{commandshell}
+  gives the output in \cref{lst:tw-tc2-mod1}.
+  \begin{cmhtcbraster}[raster column skip=.1\linewidth]
+   \cmhlistingsfromfile*{demonstrations/tw-tc2.tex}{\texttt{tw-tc2.tex}}{lst:tw-tc2}
+   \cmhlistingsfromfile*{demonstrations/tw-tc2-mod1.tex}{\texttt{tw-tc2-mod1.tex}}{lst:tw-tc2-mod1}
+  \end{cmhtcbraster}
+  We note that, because there is \emph{not} a space before the trailing comment, that the
+  lines have been joined \emph{without} a space.
+ \end{example}
+
+ \begin{example}
+  The file in \cref{lst:tw-tc3} contains multiple trailing comments.
+
+  Running the command
+  \begin{commandshell}
+latexindent.pl -m tw-tc3.tex -l textwrap1A.yaml -o=+-mod1 
+\end{commandshell}
+  gives the output in \cref{lst:tw-tc3-mod1}.
+  \begin{cmhtcbraster}[raster column skip=.1\linewidth]
+   \cmhlistingsfromfile*{demonstrations/tw-tc3.tex}{\texttt{tw-tc3.tex}}{lst:tw-tc3}
+   \cmhlistingsfromfile*{demonstrations/tw-tc3-mod1.tex}{\texttt{tw-tc3-mod1.tex}}{lst:tw-tc3-mod1}
+  \end{cmhtcbraster}
+ \end{example}
+
+ \begin{example}
+  The file in \cref{lst:tw-tc4} contains multiple trailing comments.
+
+  Running the command
+  \begin{commandshell}
+latexindent.pl -m tw-tc4.tex -l textwrap1A.yaml -o=+-mod1 
+\end{commandshell}
+  gives the output in \cref{lst:tw-tc4-mod1}.
+  \begin{cmhtcbraster}[raster column skip=.1\linewidth]
+   \cmhlistingsfromfile*{demonstrations/tw-tc4.tex}{\texttt{tw-tc4.tex}}{lst:tw-tc4}
+   \cmhlistingsfromfile*{demonstrations/tw-tc4-mod1.tex}{\texttt{tw-tc4-mod1.tex}}{lst:tw-tc4-mod1}
+  \end{cmhtcbraster}
+ \end{example}
+
+ \begin{example}
+  The file in \cref{lst:tw-tc5} contains multiple trailing comments.
+
+  Running the command
+  \begin{commandshell}
+latexindent.pl -m tw-tc5.tex -l textwrap1A.yaml -o=+-mod1 
+\end{commandshell}
+  gives the output in \cref{lst:tw-tc5-mod1}.
+  \begin{cmhtcbraster}[raster column skip=.1\linewidth]
+   \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc5.tex}{\texttt{tw-tc5.tex}}{lst:tw-tc5}
+   \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc5-mod1.tex}{\texttt{tw-tc5-mod1.tex}}{lst:tw-tc5-mod1}
+  \end{cmhtcbraster}
+  The space at the end of the text block has been preserved.
+ \end{example}
+
+ \begin{example}
+  The file in \cref{lst:tw-tc6} contains multiple trailing comments.
+
+  Running the command
+  \begin{commandshell}
+latexindent.pl -m tw-tc6.tex -l textwrap1A.yaml -o=+-mod1 
+\end{commandshell}
+  gives the output in \cref{lst:tw-tc6-mod1}.
+  \begin{cmhtcbraster}[raster column skip=.1\linewidth]
+   \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc6.tex}{\texttt{tw-tc6.tex}}{lst:tw-tc6}
+   \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc6-mod1.tex}{\texttt{tw-tc6-mod1.tex}}{lst:tw-tc6-mod1}
+  \end{cmhtcbraster}
+  The space at the end of the text block has been preserved.
+ \end{example}
+
 \subsubsection{Text wrap: huge, tabstop and separator}
  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

Modified: trunk/Master/texmf-dist/doc/support/latexindent/title.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/latexindent/title.tex	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/doc/support/latexindent/title.tex	2022-06-05 21:03:30 UTC (rev 63492)
@@ -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.17.2
+		\centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.17.3
 	\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{2022-04-14}
+\date{2022-06-05}
 \maketitle
 \begin{adjustwidth}{1cm}{1cm}
 	\small
@@ -26,5 +26,5 @@
 	regex-based substitutions.
 	All user options are customisable via the switches and the YAML interface. 
 
-    A quick start guide is given in \vref{sec:quickstart}.
+    tl;dr, a quick start guide is given in \vref{sec:quickstart}.
 \end{adjustwidth}

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm	2022-06-05 21:03:30 UTC (rev 63492)
@@ -435,6 +435,13 @@
                     $logger->info(
                         "Not showing settings in the log file (see showEveryYamlRead and showAmalgamatedSettings).");
                 }
+
+                # warning to log file if modifyLineBreaks specified and m switch not active
+                if ( ${ $userSettings->[0] }{modifyLineBreaks} and !$is_m_switch_active ) {
+                    $logger->warn("*modifyLineBreaks specified and m switch is *not* active");
+                    $logger->warn("perhaps you intended to call");
+                    $logger->warn("     latexindent.pl -m -l $settings ${$self}{fileName}");
+                }
             }
             else {
                 # otherwise print a warning that we can not read userSettings.yaml

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm	2022-06-05 21:03:30 UTC (rev 63492)
@@ -20,6 +20,6 @@
 use Exporter qw/import/;
 our @EXPORT_OK = qw/$versionNumber $versionDate/;
 
-our $versionNumber = '3.17.2';
-our $versionDate   = '2022-04-14';
+our $versionNumber = '3.17.3';
+our $versionDate   = '2022-06-05';
 1

Modified: trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/scripts/latexindent/LatexIndent/Wrap.pm	2022-06-05 21:03:30 UTC (rev 63492)
@@ -249,12 +249,36 @@
             # initiate the trailing comments storage
             my $trailingComments = q();
 
-            # grab all *internal* trailing comments from the block
-            while ( $textWrapBlockStorageValue =~ m|$trailingCommentRegExp| ) {
-                $textWrapBlockStorageValue =~ s|(\h*$trailingCommentRegExp)||s;
-                $trailingComments .= $1;
+            # about trailing comments
+            #
+            #   - trailing comments that do *not* have leading space instruct the text
+            #     wrap routine to connect the lines *without* space
+            #
+            #   - multiple trailing comments will be connected at the end of the text wrap block
+            #
+            #   - the number of spaces between the end of the text wrap block and
+            #     the (possibly combined) trailing comments is determined by the
+            #     spaces (if any) at the end of the text wrap block
+
+            # for trailing comments that
+            #
+            #   do *NOT* have a leading space
+            #   do have a trailing line break
+            #
+            # then we *remove* the trailing line break
+            while ( $textWrapBlockStorageValue =~ m|\H$trailingCommentRegExp\h*\R|s ) {
+                $textWrapBlockStorageValue =~ s|(\H)($trailingCommentRegExp)\h*\R|$1$2|s;
             }
 
+            # now we put all of the trailing comments together
+            while ( $textWrapBlockStorageValue =~ m|$trailingCommentRegExp|s ) {
+                $textWrapBlockStorageValue =~ s|($trailingCommentRegExp)||s;
+                $trailingComments = $trailingComments . $1;
+            }
+
+            $trailingComments =~ s/\h{2,}/ /sg
+                if ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{multipleSpacesToSingle};
+
             # determine if text wrapping will remove paragraph line breaks
             my $removeBlockLineBreaks = ${ $mainSettings{modifyLineBreaks}{textWrapOptions} }{removeBlockLineBreaks};
 

Modified: trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
===================================================================
--- trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2022-06-05 21:02:04 UTC (rev 63491)
+++ trunk/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml	2022-06-05 21:03:30 UTC (rev 63492)
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.17.2, 2022-04-14
+# defaultSettings.yaml for latexindent.pl, version 3.17.3, 2022-06-05
 #                      a script that aims to
 #                      beautify .tex, .sty, .cls files
 #

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



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