diff options
author | Norbert Preining <norbert@preining.info> | 2023-06-07 03:04:09 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-06-07 03:04:09 +0000 |
commit | 5c99135c06494b236cce7fd76e346851cf8c4408 (patch) | |
tree | ddae5aa8cd5c5ebbd4bb7518958532bdf817125f /support/latexindent | |
parent | 81c6e34f9b4e2191ee45a1e3236d77914a7af519 (diff) |
CTAN sync 202306070304
Diffstat (limited to 'support/latexindent')
-rw-r--r-- | support/latexindent/LatexIndent/TrailingComments.pm | 10 | ||||
-rw-r--r-- | support/latexindent/LatexIndent/Version.pm | 4 | ||||
-rw-r--r-- | support/latexindent/README | 2 | ||||
-rw-r--r-- | support/latexindent/bin/linux/latexindent | bin | 6165455 -> 6165486 bytes | |||
-rw-r--r-- | support/latexindent/bin/macos/latexindent | bin | 6394677 -> 6394708 bytes | |||
-rw-r--r-- | support/latexindent/defaultSettings.yaml | 5 | ||||
-rw-r--r-- | support/latexindent/documentation/contributors.bib | 17 | ||||
-rw-r--r-- | support/latexindent/documentation/latexindent-yaml-schema.json | 2 | ||||
-rw-r--r-- | support/latexindent/documentation/latexindent.pdf | bin | 1246969 -> 1250364 bytes | |||
-rw-r--r-- | support/latexindent/documentation/latexindent.tex | 59 | ||||
-rwxr-xr-x | support/latexindent/latexindent.pl | 3 |
11 files changed, 75 insertions, 27 deletions
diff --git a/support/latexindent/LatexIndent/TrailingComments.pm b/support/latexindent/LatexIndent/TrailingComments.pm index bbae745d94..748d005f98 100644 --- a/support/latexindent/LatexIndent/TrailingComments.pm +++ b/support/latexindent/LatexIndent/TrailingComments.pm @@ -67,16 +67,16 @@ sub remove_trailing_comments { $logger->trace("*Storing trailing comments") if $is_t_switch_active; my $notPreceededBy = qr/${${$mainSettings{fineTuning}}{trailingComments}}{notPreceededBy}/; + my $afterComment = qr/${${$mainSettings{fineTuning}}{trailingComments}}{afterComment}/; # perform the substitution ${$self}{body} =~ s/ - $notPreceededBy # not preceded by a \ - % # % + $notPreceededBy # not preceded by a \ + % # % ( - \h*? # followed by possible horizontal space - .*? # and anything else + $afterComment # anything else ) - $ # up to the end of a line + $ # up to the end of a line / # increment comment counter and store comment $commentCounter++; diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm index 59ed17e3e0..f7ed57cf8d 100644 --- a/support/latexindent/LatexIndent/Version.pm +++ b/support/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.21.1'; -our $versionDate = '2023-05-20'; +our $versionNumber = '3.22'; +our $versionDate = '2023-06-01'; 1 diff --git a/support/latexindent/README b/support/latexindent/README index 88398cdba9..df74dc160c 100644 --- a/support/latexindent/README +++ b/support/latexindent/README @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - latexindent.pl, version 3.21.1, 2023-05-20 + latexindent.pl, version 3.22, 2023-06-01 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/support/latexindent/bin/linux/latexindent b/support/latexindent/bin/linux/latexindent Binary files differindex 449615d057..a41e6ae191 100644 --- a/support/latexindent/bin/linux/latexindent +++ b/support/latexindent/bin/linux/latexindent diff --git a/support/latexindent/bin/macos/latexindent b/support/latexindent/bin/macos/latexindent Binary files differindex c77592e6f6..acc4fe2571 100644 --- a/support/latexindent/bin/macos/latexindent +++ b/support/latexindent/bin/macos/latexindent diff --git a/support/latexindent/defaultSettings.yaml b/support/latexindent/defaultSettings.yaml index a3582b934b..9d16992e36 100644 --- a/support/latexindent/defaultSettings.yaml +++ b/support/latexindent/defaultSettings.yaml @@ -1,5 +1,5 @@ # -# latexindent.pl, version 3.21.1, 2023-05-20 +# latexindent.pl, version 3.22, 2023-06-01 # # defaultSettings.yaml, the default settings for latexindent.pl # @@ -648,6 +648,7 @@ fineTuning: between: _|\^|\* trailingComments: notPreceededBy: (?<!\\) + afterComment: .*? modifyLineBreaks: doubleBackSlash: \\\\(?:\h*\[\h*\d+\h*[a-zA-Z]+\h*\])? comma: ',' @@ -666,6 +667,8 @@ fineTuning: (?:[iI]\.[eE]) # i.e OR I.e OR i.E OR I.E | # (?:etc) # etc + | # + (?:[wW]\.[rR]\.[tT]) # w.r.t OR W.r.t OR w.R.t OR w.r.T OR W.R.t OR W.r.T OR w.R.T OR W.R.T ) # ) # ) # diff --git a/support/latexindent/documentation/contributors.bib b/support/latexindent/documentation/contributors.bib index 3e6147f157..50a10e9118 100644 --- a/support/latexindent/documentation/contributors.bib +++ b/support/latexindent/documentation/contributors.bib @@ -200,3 +200,20 @@ author = "valtterikantanen", urldate = {2023-04-07}, keywords = {contributor},} + +@online{hslootgithubspaces, + title = "feat: add devcontainer configuration", + url = "https://github.com/cmhughes/latexindent.pl/pull/443", + date = {2023-05-20}, + author = "Henrik Sloot", + urldate = {2023-05-20}, + keywords = {contributor},} + +@online{qiaojunfeng, + title = "Add w.r.t to betterFullStop", + url = "https://github.com/cmhughes/latexindent.pl/pull/447", + date = {2023-05-25}, + author = "Junfeng Qiao", + urldate = {2023-05-25}, + keywords = {contributor},} + diff --git a/support/latexindent/documentation/latexindent-yaml-schema.json b/support/latexindent/documentation/latexindent-yaml-schema.json index 4084168a8b..cf707723a9 100644 --- a/support/latexindent/documentation/latexindent-yaml-schema.json +++ b/support/latexindent/documentation/latexindent-yaml-schema.json @@ -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.21.1 2023-05-20", + "description": "latexindent.pl YAML schema helper, V3.22 2023-06-01", "type": "object", "properties": { "fileExtensionPreference": { diff --git a/support/latexindent/documentation/latexindent.pdf b/support/latexindent/documentation/latexindent.pdf Binary files differindex a853ce27c9..fb04afb06c 100644 --- a/support/latexindent/documentation/latexindent.pdf +++ b/support/latexindent/documentation/latexindent.pdf diff --git a/support/latexindent/documentation/latexindent.tex b/support/latexindent/documentation/latexindent.tex index 618b49cad1..70c2be9805 100644 --- a/support/latexindent/documentation/latexindent.tex +++ b/support/latexindent/documentation/latexindent.tex @@ -523,7 +523,7 @@ \lstdefinestyle{fineTuning}{ style=yaml-LST, - firstnumber=629,linerange={629-681}, + firstnumber=629,linerange={629-684}, numbers=left, } @@ -2461,11 +2461,11 @@ latexindent.pl tabular1.tex \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}; - \item \announce*{2023-05-01}{alignContentAfterDoubleBackSlash feature} + \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} + \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 @@ -3047,17 +3047,16 @@ latexindent.pl tabular-DM-1.tex -l=dontMeasure1a.yaml -o=+-mod1a \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}. + 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} + \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 @@ -3071,15 +3070,15 @@ latexindent.pl -s tabular5.tex -l alignContentAfterDBS1 -o=+-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} + \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 + \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 @@ -3094,8 +3093,8 @@ latexindent.pl -s tabular5.tex -l alignContentAfterDBS2 -o=+-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} + \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} @@ -6737,9 +6736,9 @@ latexindent.pl -s -m -l alignContentAfterDBS2.yaml,DBS1.yaml tabular6.tex -o=+-m 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} + \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} @@ -8254,6 +8253,34 @@ latexindent.pl bib2.bib -l bibsettings1.yaml,bibsettings2.yaml -o=+-mod2 been adjusted so that \texttt{=} symbols are used as the delimiter, but only when they are \emph{not preceded} by either \texttt{v} or \texttt{spfreload}. \end{example} + + \begin{example} + We can use the \texttt{fineTuning} settings to tweak how \texttt{latexindent.pl} finds + trailing comments. \announce*{2023-06-01}{fine tuning trailing comments demonstration} + + We begin with the file in \cref{lst:finetuning5} + + \cmhlistingsfromfile*{demonstrations/finetuning5.tex}{\texttt{finetuning5.tex}}{lst:finetuning5} + + Using the settings in \cref{lst:fine-tuning3} and running the command + + \begin{commandshell} +latexindent.pl finetuning5.tex -l=fine-tuning3.yaml +\end{commandshell} + + gives the output in \cref{lst:finetuning5-mod1}. + + \begin{cmhtcbraster}[raster column skip=.01\linewidth] + \cmhlistingsfromfile*{demonstrations/finetuning5-mod1.tex}{\texttt{finetuning5-mod1.tex}}{lst:finetuning5-mod1} + \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/fine-tuning3.yaml}[yaml-TCB]{\texttt{finetuning3.yaml}}{lst:fine-tuning3} + \end{cmhtcbraster} + + The settings in \cref{lst:fine-tuning3} detail that trailing comments can \emph{not} be + followed by a single space, and then the text `end'. This means that the + \texttt{specialBeginEnd} routine will be able to find the pattern \lstinline!% end! as + the \texttt{end} part. The trailing comments \texttt{123} and \texttt{456} are still + treated as trailing comments. + \end{example} % 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 diff --git a/support/latexindent/latexindent.pl b/support/latexindent/latexindent.pl index 4b8e2b7527..5dacf0bc84 100755 --- a/support/latexindent/latexindent.pl +++ b/support/latexindent/latexindent.pl @@ -1,5 +1,6 @@ #!/usr/bin/env perl -# latexindent.pl, version 3.21.1, 2023-05-20 +# +# latexindent.pl, version 3.22, 2023-06-01 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |