summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/latexindent/latexindent.pl2
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl21
-rwxr-xr-xMaster/bin/win32/latexindent.exebin11455448 -> 11456282 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexindent/README2
-rw-r--r--Master/texmf-dist/doc/support/latexindent/appendices.tex46
-rw-r--r--Master/texmf-dist/doc/support/latexindent/cmhlistings.tex6
-rw-r--r--Master/texmf-dist/doc/support/latexindent/latexindent.pdfbin690820 -> 690838 bytes
-rw-r--r--Master/texmf-dist/doc/support/latexindent/latexindent.tex52
-rw-r--r--Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex15
-rw-r--r--Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex21
-rw-r--r--Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex2
-rw-r--r--Master/texmf-dist/doc/support/latexindent/title.tex2
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm3
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm32
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm9
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm18
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm12
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm5
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm5
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm3
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm6
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm11
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm2
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm6
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm6
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm11
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm9
-rw-r--r--Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm4
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/defaultSettings.yaml23
-rwxr-xr-xMaster/texmf-dist/scripts/latexindent/latexindent.pl2
30 files changed, 170 insertions, 166 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl b/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
index b49b2a009cc..c9835ccbe37 100755
--- a/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
+++ b/Build/source/texk/texlive/linked_scripts/latexindent/latexindent.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# latexindent.pl, version 3.4.2, 2018-04-27
+# latexindent.pl, version 3.4.3, 2018-06-08
#
# 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
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 375d62c6ef5..ed5b3f0cd35 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,12 +1,12 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 47935 2018-06-05 22:36:22Z karl $
+# $Id: tlmgr.pl 47951 2018-06-07 05:55:43Z preining $
#
# Copyright 2008-2018 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
-my $svnrev = '$Revision: 47935 $';
-my $datrev = '$Date: 2018-06-06 00:36:22 +0200 (Wed, 06 Jun 2018) $';
+my $svnrev = '$Revision: 47951 $';
+my $datrev = '$Date: 2018-06-07 07:55:43 +0200 (Thu, 07 Jun 2018) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
@@ -7261,22 +7261,23 @@ sub clear_old_backups {
my @dirents = readdir (DIR);
closedir (DIR) || warn "closedir($backupdir) failed: $!";
my @backups;
+ my $extre = "(" . join("|", map { $CompressorExtension{$_} } @AcceptedCompressors) . ")";
for my $dirent (@dirents) {
next if (-d $dirent);
- next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.xz$/);
- push @backups, $1;
+ next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.$extre$/);
+ push @backups, [ $1, $dirent ] ;
}
my $i = 1;
- for my $e (reverse sort {$a <=> $b} @backups) {
+ for my $e (reverse sort {$a->[0] <=> $b->[0]} @backups) {
if ($i > $autobackup) {
# only echo out if explicitly asked for verbose which is done
# in the backup --clean action
if ($verb) {
- info ("Removing backup $backupdir/$pkg.r$e.tar.xz\n");
+ info ("Removing backup $backupdir/$e->[1]\n");
} else {
- debug ("Removing backup $backupdir/$pkg.r$e.tar.xz\n");
+ debug ("Removing backup $backupdir/$e->[1]\n");
}
- unlink("$backupdir/$pkg.r$e.tar.xz") unless $dryrun;
+ unlink("$backupdir/$e->[1]") unless $dryrun;
}
$i++;
}
@@ -9694,7 +9695,7 @@ This script and its documentation were written for the TeX Live
distribution (L<http://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
-$Id: tlmgr.pl 47935 2018-06-05 22:36:22Z karl $
+$Id: tlmgr.pl 47951 2018-06-07 05:55:43Z preining $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
diff --git a/Master/bin/win32/latexindent.exe b/Master/bin/win32/latexindent.exe
index 6df981cb13d..f35c0e80f37 100755
--- a/Master/bin/win32/latexindent.exe
+++ b/Master/bin/win32/latexindent.exe
Binary files differ
diff --git a/Master/texmf-dist/doc/support/latexindent/README b/Master/texmf-dist/doc/support/latexindent/README
index dfa09652e65..0ffb2810068 100644
--- a/Master/texmf-dist/doc/support/latexindent/README
+++ b/Master/texmf-dist/doc/support/latexindent/README
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- latexindent.pl, version 3.4.2, 2018-04-27
+ latexindent.pl, version 3.4.3, 2018-06-08
PERL script to indent code within environments, and align delimited
environments in .tex files.
diff --git a/Master/texmf-dist/doc/support/latexindent/appendices.tex b/Master/texmf-dist/doc/support/latexindent/appendices.tex
index ed93148521b..3a54a950389 100644
--- a/Master/texmf-dist/doc/support/latexindent/appendices.tex
+++ b/Master/texmf-dist/doc/support/latexindent/appendices.tex
@@ -109,7 +109,7 @@ ls /usr/local/bin
\end{enumerate}
To \emph{remove} the files, run
\begin{commandshell}
-sudo make uninstall}.
+sudo make uninstall
\end{commandshell}
\subsection{Add to path for Windows}
To add \texttt{latexindent.exe} to the path for Windows, follow these steps:
@@ -185,34 +185,17 @@ latexindent.pl myfile.tex -outputfile outputfile.tex
The fields given in \cref{lst:obsoleteYaml} are \emph{obsolete} from Version 3.0
onwards.
- \begin{yaml}[style=yaml-LST,numbers=none]{Obsolete YAML fields from Version 3.0}[colframe=white!25!red,colbacktitle=white!75!red,colback=white!90!red,]{lst:obsoleteYaml}
-alwaysLookforSplitBrackets
-alwaysLookforSplitBrackets
-checkunmatched
-checkunmatchedELSE
-checkunmatchedbracket
-constructIfElseFi
-\end{yaml}
+ \cmhlistingsfromfile{demonstrations/obsolete.yaml}[yaml-obsolete]{Obsolete YAML fields from Version 3.0}{lst:obsoleteYaml}
There is a slight difference when specifying indentation after headings; specifically,
we now write \texttt{indentAfterThisHeading} instead of \texttt{indent}. See \cref{lst:indentAfterThisHeadingOld,lst:indentAfterThisHeadingNew}
\begin{minipage}{.45\textwidth}
- \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld}
-indentAfterHeadings:
- part:
- indent: 0
- level: 1
-\end{yaml}
+ \cmhlistingsfromfile{demonstrations/indentAfterThisHeadingOld.yaml}[yaml-TCB]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew}
-indentAfterHeadings:
- part:
- indentAfterThisHeading: 0
- level: 1
-\end{yaml}
+ \cmhlistingsfromfile{demonstrations/indentAfterThisHeadingNew.yaml}[yaml-TCB]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew}
\end{minipage}%
To specify \texttt{noAdditionalIndent} for display-math environments in Version 2.2, you would write YAML
@@ -220,26 +203,13 @@ indentAfterHeadings:
or, if you're using \texttt{-m} switch, \cref{lst:indentAfterThisHeadingNew2}.
\begin{minipage}{.45\textwidth}
- \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld}
-noAdditionalIndent:
- \[: 0
- \]: 0
-\end{yaml}
+ \cmhlistingsfromfile{demonstrations/noAddtionalIndentOld.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld}
\end{minipage}%
\hfill
\begin{minipage}{.45\textwidth}
- \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1}
-specialBeginEnd:
- displayMath:
- begin: '\\\['
- end: '\\\]'
- lookForThis: 0
-\end{yaml}
-
- \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew2}
-noAdditionalIndent:
- displayMath: 1
-\end{yaml}
+ \cmhlistingsfromfile{demonstrations/noAddtionalIndentNew.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1}
+
+ \cmhlistingsfromfile{demonstrations/noAddtionalIndentNew1.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew2}
\end{minipage}%
\mbox{}\hfill \begin{minipage}{.25\textwidth}
diff --git a/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex b/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex
index b056bd23f79..85aff0881cd 100644
--- a/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex
+++ b/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex
@@ -1,10 +1,12 @@
-\newcommand{\cmhlistingsfromfile}[3]{
+\newcommand{\cmhlistingsfromfile}[4]{
.. literalinclude:: #1^^J
+^^I:class: .#4^^J
^^I:caption: #2^^J
^^I:name: #3^^J
}
-\newcommand{\cmhlistingsfromfilefour}[5]{
+\newcommand{\cmhlistingsfromfilefour}[6]{
.. literalinclude:: #3^^J
+^^I:class: .#6^^J
^^I:caption: #4^^J
^^I:name: #5^^J
^^I:lines: #1-#2^^J
diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
index 9cc5c3332f9..be0c9f8d6fa 100644
--- a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
+++ b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.tex b/Master/texmf-dist/doc/support/latexindent/latexindent.tex
index 3462790e824..eb089d0418f 100644
--- a/Master/texmf-dist/doc/support/latexindent/latexindent.tex
+++ b/Master/texmf-dist/doc/support/latexindent/latexindent.tex
@@ -175,6 +175,20 @@
enhanced,
overlay={\node[anchor=north east,outer sep=2pt,draw=cmhgold,very thick,double,fill=harvestgold,font =\small] at ([yshift=-3mm]frame.north east) {\texttt{-m}}; }
},
+ yaml-obsolete/.style={
+ listing only,
+ listing engine=listings,
+ left=0cm,
+ boxrule=0pt,
+ %leftrule=3pt,
+ sharp corners,
+ center title,
+ toprule=2pt,
+ titlerule=2pt,
+ colframe=white!25!red,
+ colbacktitle=white!75!red,
+ colback=white!90!red,
+ },
new-to-this-version/.style={
enhanced,
overlay app={\node at ([yshift=0mm,xshift=0mm]frame.north east) {\stardemo[scale=1.2]}; },
@@ -332,115 +346,115 @@
\lstdefinestyle{indentAfterItems}{
style=yaml-LST,
- firstnumber=183,linerange={183-187},
+ firstnumber=182,linerange={182-186},
numbers=left,
}
\lstdefinestyle{itemNames}{
style=yaml-LST,
- firstnumber=193,linerange={193-195},
+ firstnumber=192,linerange={192-194},
numbers=left,
}
\lstdefinestyle{specialBeginEnd}{
style=yaml-LST,
- firstnumber=199,linerange={199-212},
+ firstnumber=198,linerange={198-211},
numbers=left,
}
\lstdefinestyle{indentAfterHeadings}{
style=yaml-LST,
- firstnumber=222,linerange={222-231},
+ firstnumber=221,linerange={221-230},
numbers=left,
}
\lstdefinestyle{noAdditionalIndentGlobalEnv}{
style=yaml-LST,
- firstnumber=280,linerange={280-281},
+ firstnumber=279,linerange={279-280},
numbers=left,
}
\lstdefinestyle{noAdditionalIndentGlobal}{
style=yaml-LST,
- firstnumber=280,linerange={280-292},
+ firstnumber=279,linerange={279-291},
numbers=left,
}
\lstdefinestyle{indentRulesGlobalEnv}{
style=yaml-LST,
- firstnumber=296,linerange={296-297},
+ firstnumber=295,linerange={295-296},
numbers=left,
}
\lstdefinestyle{indentRulesGlobal}{
style=yaml-LST,
- firstnumber=296,linerange={296-308},
+ firstnumber=295,linerange={295-307},
numbers=left,
}
\lstdefinestyle{commandCodeBlocks}{
style=yaml-LST,
- firstnumber=311,linerange={311-325},
+ firstnumber=310,linerange={310-324},
numbers=left,
}
\lstdefinestyle{modifylinebreaks}{
style=yaml-LST,
- firstnumber=395,linerange={395-397},
+ firstnumber=394,linerange={394-396},
numbers=left,
}
\lstdefinestyle{textWrapOptions}{
style=yaml-LST,
- firstnumber=398,linerange={398-399},
+ firstnumber=397,linerange={397-398},
numbers=left,
}
\lstdefinestyle{textWrapOptionsAll}{
style=yaml-LST,
- firstnumber=398,linerange={398-400},
+ firstnumber=397,linerange={397-399},
numbers=left,
}
\lstdefinestyle{removeParagraphLineBreaks}{
style=yaml-LST,
- firstnumber=423,linerange={423-435},
+ firstnumber=422,linerange={422-434},
numbers=left,
}
\lstdefinestyle{paragraphsStopAt}{
style=yaml-LST,
- firstnumber=436,linerange={436-444},
+ firstnumber=435,linerange={435-443},
numbers=left,
}
\lstdefinestyle{oneSentencePerLine}{
style=yaml-LST,
- firstnumber=401,linerange={401-422},
+ firstnumber=400,linerange={400-421},
numbers=left,
}
\lstdefinestyle{sentencesFollow}{
style=yaml-LST,
- firstnumber=404,linerange={404-412},
+ firstnumber=403,linerange={403-411},
numbers=left,
}
\lstdefinestyle{sentencesBeginWith}{
style=yaml-LST,
- firstnumber=413,linerange={413-416},
+ firstnumber=412,linerange={412-415},
numbers=left,
}
\lstdefinestyle{sentencesEndWith}{
style=yaml-LST,
- firstnumber=417,linerange={417-422},
+ firstnumber=416,linerange={416-421},
numbers=left,
}
\lstdefinestyle{modifylinebreaksEnv}{
style=yaml-LST,
- firstnumber=445,linerange={445-454},
+ firstnumber=444,linerange={444-453},
numbers=left,
}
diff --git a/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex b/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
index 77e85e16af8..165cccf4724 100644
--- a/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
+++ b/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex
@@ -339,19 +339,8 @@ latexindent.pl
You can use the rule in any of the ways described in \cref{lst:arara} (or combinations thereof).
In fact, \texttt{arara} allows yet greater flexibility -- you can use \texttt{yes/no}, \texttt{true/false}, or \texttt{on/off} to toggle the various options.
- \begin{cmhlistings}[style=demo,escapeinside={(*@}{@*)}]{\texttt{arara} sample usage}{lst:arara}
-%(*@@*) arara: indent
-%(*@@*) arara: indent: {overwrite: yes}
-%(*@@*) arara: indent: {output: myfile.tex}
-%(*@@*) arara: indent: {silent: yes}
-%(*@@*) arara: indent: {trace: yes}
-%(*@@*) arara: indent: {localSettings: yes}
-%(*@@*) arara: indent: {onlyDefault: on}
-%(*@@*) arara: indent: { cruft: /home/cmhughes/Desktop }
-\documentclass{article}
-...
-\end{cmhlistings}
- %(*@@*) arara: indent: { modifylinebreaks: yes }
+
+ \cmhlistingsfromfile{demonstrations/arara-demo.tex}{\texttt{arara} sample usage}{lst:arara}
Hopefully the use of these rules is fairly self-explanatory, but for completeness
\cref{tab:orbsandswitches} shows the relationship between \texttt{arara} directive arguments and the
diff --git a/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex b/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
index 2b10438eb09..caed7644c67 100644
--- a/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
+++ b/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex
@@ -356,10 +356,11 @@ latexindent.pl url -m -l=manipulate-sentences.yaml
it to \texttt{0}, and you can experiment with the \texttt{other} field.
The \texttt{basicFullStop} routine should probably be avoided in most situations, as it does not accomodate the specifications
- above. For example, using the YAML in \cref{lst:alt-full-stop1-yaml} gives the output from the following command in \cref{lst:url-mod2}.
+ above. For example, using the following command
\begin{commandshell}
latexindent.pl url -m -l=alt-full-stop1.yaml
\end{commandshell}
+ and the YAML in \cref{lst:alt-full-stop1-yaml} gives the output in \cref{lst:url-mod2}.
\begin{adjustwidth}{-3.5cm}{-1.5cm}
\begin{minipage}{.6\linewidth}
@@ -1031,17 +1032,17 @@ latexindent.pl -m env-mlb7.tex -l env-mlb13.yaml,env-mlb14.yaml,UnpreserveBlankL
\toprule
Code block & Sample & \multicolumn{2}{c}{Poly-switch mapping} \\
\midrule
- 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! & & \\
+ 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! & & \\
\cmidrule{2-4}
- ifelsefi & \verb!before words!$\BeginStartsOnOwnLine$ & $\BeginStartsOnOwnLine$ & IfStartsOnOwnLine \\
- & \verb!\if...!$\BodyStartsOnOwnLine$ & $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\
- & \verb!body of if/or statement!$\OrStartsOnOwnLine$ & $\OrStartsOnOwnLine$ & OrStartsOnOwnLine %
+ 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 polyswitches} \\
- & \verb!\or!$\OrFinishesWithLineBreak$ & $\OrFinishesWithLineBreak$ & OrFinishesWithLineBreak \\
+ & \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 \\
diff --git a/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex b/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex
index 32292cfbfc5..2f4412faffd 100644
--- a/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex
+++ b/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex
@@ -201,7 +201,7 @@ latexindent.pl for-each.tex -l foreach.yaml
There are some special command names%
\announce*{2018-04-27}*{commandNameSpecial} that do not fit within the names recognized by \texttt{latexindent.pl},
the first one of which is \lstinline!\@ifnextchar[!. From the perspective of \texttt{latexindent.pl}, the whole of the
- text \lstinline!\@ifnextchar[! is is a command, because it is
+ text \lstinline!\@ifnextchar[! is a command, because it is
immediately followed by sets of mandatory arguments. However, without the \texttt{commandNameSpecial} field, \texttt{latexindent.pl}
would not be able to label it as such, because the \lstinline![! is, necessarily, not matched by a closing \lstinline!]!.
diff --git a/Master/texmf-dist/doc/support/latexindent/title.tex b/Master/texmf-dist/doc/support/latexindent/title.tex
index fec997546f6..1e0596c4df6 100644
--- a/Master/texmf-dist/doc/support/latexindent/title.tex
+++ b/Master/texmf-dist/doc/support/latexindent/title.tex
@@ -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.4.2
+ \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4.3
\end{tcolorbox}
}
\author{Chris Hughes \thanks{and contributors!
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm
index b1c8fc47555..4861dd1f6a6 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Braces.pm
@@ -26,8 +26,9 @@ use LatexIndent::LogFile qw/$logger/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_commands_or_key_equals_values_braces/;
+our @EXPORT_OK = qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/;
our $commandCounter;
+our $braceBracketRegExpBasic = qr/\{|\[/;
sub find_commands_or_key_equals_values_braces{
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
index 03817c8d7cf..48d93c622d5 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm
@@ -38,21 +38,21 @@ use LatexIndent::DoubleBackSlash qw/dodge_double_backslash un_dodge_double_backs
# code blocks
use LatexIndent::Verbatim qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands put_verbatim_commands_back_in/;
-use LatexIndent::Environment qw/find_environments/;
-use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp/;
+use LatexIndent::Environment qw/find_environments $environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/;
use LatexIndent::Else qw/check_for_else_statement/;
use LatexIndent::Arguments qw/get_arguments_regexp find_opt_mand_arguments get_numbered_arg_regexp construct_arguments_regexp/;
use LatexIndent::OptionalArgument qw/find_optional_arguments/;
use LatexIndent::MandatoryArgument qw/find_mandatory_arguments get_mand_arg_reg_exp/;
use LatexIndent::RoundBrackets qw/find_round_brackets/;
use LatexIndent::Item qw/find_items construct_list_of_items/;
-use LatexIndent::Braces qw/find_commands_or_key_equals_values_braces/;
+use LatexIndent::Braces qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/;
use LatexIndent::Command qw/construct_command_regexp/;
use LatexIndent::KeyEqualsValuesBraces qw/construct_key_equals_values_regexp/;
use LatexIndent::NamedGroupingBracesBrackets qw/construct_grouping_braces_brackets_regexp/;
use LatexIndent::UnNamedGroupingBracesBrackets qw/construct_unnamed_grouping_braces_brackets_regexp/;
-use LatexIndent::Special qw/find_special construct_special_begin/;
-use LatexIndent::Heading qw/find_heading construct_headings_levels/;
+use LatexIndent::Special qw/find_special construct_special_begin $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/;
+use LatexIndent::Heading qw/find_heading construct_headings_levels $allHeadingsRegexp/;
use LatexIndent::FileContents qw/find_file_contents_environments_and_preamble/;
use LatexIndent::Preamble;
@@ -181,18 +181,18 @@ sub find_objects{
# search for environments
$logger->trace('looking for ENVIRONMENTS') if $is_t_switch_active;
- $self->find_environments;
+ $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s;
# search for ifElseFi blocks
$logger->trace('looking for IFELSEFI') if $is_t_switch_active;
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
# search for headings (part, chapter, section, setc)
$logger->trace('looking for HEADINGS (chapter, section, part, etc)') if $is_t_switch_active;
- $self->find_heading;
+ $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
# the ordering of finding commands and special code blocks can change
- $self->find_commands_or_key_equals_values_braces_and_special;
+ $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
# documents without preamble need a manual call to the paragraph_one_line routine
if ($is_m_switch_active and !${$self}{preamblePresent}){
@@ -222,19 +222,19 @@ sub find_commands_or_key_equals_values_braces_and_special{
if(${$masterSettings{specialBeginEnd}}{specialBeforeCommand}){
# search for special begin/end
$logger->trace('looking for SPECIAL begin/end *before* looking for commands (see specialBeforeCommand)') if $is_t_switch_active;
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
# search for commands with arguments
$logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active;
- $self->find_commands_or_key_equals_values_braces;
+ $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
} else {
# search for commands with arguments
$logger->trace('looking for COMMANDS and key = {value}') if $is_t_switch_active;
- $self->find_commands_or_key_equals_values_braces;
+ $self->find_commands_or_key_equals_values_braces if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
# search for special begin/end
$logger->trace('looking for SPECIAL begin/end') if $is_t_switch_active;
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
}
return;
}
@@ -311,13 +311,13 @@ sub tasks_common_to_each_object{
$self->adjust_replacement_text_line_breaks_at_end;
# modify line breaks on body and end statements
- $self->modify_line_breaks_body;
+ $self->modify_line_breaks_body if $is_m_switch_active;
# modify line breaks end statements
- $self->modify_line_breaks_end;
+ $self->modify_line_breaks_end if $is_m_switch_active;
# check the body for current children
- $self->check_for_hidden_children;
+ $self->check_for_hidden_children if ${$self}{body} =~ m/$tokens{beginOfToken}/;
return;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
index 0403de6adb2..698fc6c1b90 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Else.pm
@@ -20,6 +20,9 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Braces qw/$braceBracketRegExpBasic/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -99,13 +102,13 @@ sub tasks_particular_to_each_object{
my $self = shift;
# search for headings (important to do this before looking for commands!)
- $self->find_heading;
+ $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
# search for commands and special code blocks
- $self->find_commands_or_key_equals_values_braces_and_special;
+ $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
# search for arguments
- $self->find_opt_mand_arguments;
+ $self->find_opt_mand_arguments if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
return;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm
index b3b5b431855..2ecaf6d4e36 100755
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Environment.pm
@@ -18,13 +18,19 @@ use strict;
use warnings;
use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
+use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Braces qw/$braceBracketRegExpBasic/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_environments/;
+our @EXPORT_OK = qw/find_environments $environmentBasicRegExp/;
our $environmentCounter;
+our $environmentBasicRegExp = qr/\\begin\{/;
# store the regular expresssion for matching and replacing the \begin{}...\end{} statements
our $environmentRegExp = qr/
@@ -99,19 +105,19 @@ sub tasks_particular_to_each_object{
}
# search for items as the first order of business
- $self->find_items;
+ $self->find_items if ${$masterSettings{indentAfterItems}}{${$self}{name}};
# search for headings (important to do this before looking for commands!)
- $self->find_heading;
+ $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
# search for commands and special code blocks
- $self->find_commands_or_key_equals_values_braces_and_special;
+ $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
# search for arguments
- $self->find_opt_mand_arguments;
+ $self->find_opt_mand_arguments if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
# search for ifElseFi blocks
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
index 5ef487f9866..f3fba5fab75 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileContents.pm
@@ -20,6 +20,10 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Environment qw/$environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
use Data::Dumper;
use Exporter qw/import/;
our @EXPORT_OK = qw/find_file_contents_environments_and_preamble/;
@@ -216,16 +220,16 @@ sub tasks_particular_to_each_object{
my $self = shift;
# search for environments
- $self->find_environments;
+ $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s;
# search for ifElseFi blocks
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
# search for headings (part, chapter, section, setc)
- $self->find_heading;
+ $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
# search for commands and special code blocks
- $self->find_commands_or_key_equals_values_braces_and_special;
+ $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
}
1;
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
index 8fb07087c35..00af6ab2ae4 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm
@@ -455,7 +455,7 @@ sub get_indentation_settings_for_this_object{
$self->alignment_at_ampersand_settings;
# check for line break settings
- $self->modify_line_breaks_settings;
+ $self->modify_line_breaks_settings if $is_m_switch_active;
# store the settings
%{${previouslyFoundSettings}{$storageName}} = (
@@ -535,9 +535,6 @@ sub alignment_at_ampersand_settings{
}
sub modify_line_breaks_settings{
- # return with undefined values unless the -m switch is active
- return unless $is_m_switch_active;
-
my $self = shift;
# grab the logging object
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm
index 3dca1b7eefb..82957e182f1 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Heading.pm
@@ -21,10 +21,11 @@ use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_swit
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_heading construct_headings_levels/;
+our @EXPORT_OK = qw/find_heading construct_headings_levels $allHeadingsRegexp/;
our $headingCounter;
our @headingsRegexpArray;
our $allHeadingsRegexp = q();
@@ -226,7 +227,7 @@ sub tasks_particular_to_each_object{
}
# search for special begin/end
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
return;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
index 768ec1651f9..1ddfa1bb537 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/HiddenChildren.pm
@@ -156,9 +156,6 @@ sub check_for_hidden_children{
my $self = shift;
- # if there are no hidden children, then exit
- return if ${$self}{body} !~ m/$tokens{beginOfToken}/;
-
# grab the matches
my @matched = (${$self}{body} =~ /((?:$tokens{ifelsefiSpecial})?$tokens{beginOfToken}.[-a-z0-9]+?$tokens{endOfToken})/ig);
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm
index ecceb00fec6..29a0065bfe6 100755
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/IfElseFi.pm
@@ -20,12 +20,14 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_ifelsefi construct_ifelsefi_regexp/;
+our @EXPORT_OK = qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/;
our $ifElseFiCounter;
our $ifElseFiRegExp;
+our $ifElseFiBasicRegExp = qr/\\if/;
# store the regular expresssion for matching and replacing the \if...\else...\fi statements
# note: we search for \else separately in an attempt to keep this regexp a little more managable
@@ -148,7 +150,7 @@ sub tasks_particular_to_each_object{
);
# search for headings (important to do this before looking for commands!)
- $self->find_heading;
+ $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
# search for commands and special code blocks
$self->find_commands_or_key_equals_values_braces_and_special;
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm
index 8a72257e70d..f9fbf8dd4b6 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Item.pm
@@ -21,6 +21,9 @@ use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -66,8 +69,6 @@ sub find_items{
my $self = shift;
- return unless ${$masterSettings{indentAfterItems}}{${$self}{name}};
-
# otherwise loop through the item names
$logger->trace("Searching for items (see itemNames) in ${$self}{name} (see indentAfterItems)") if $is_t_switch_active;
$logger->trace(Dumper(\%{$masterSettings{itemNames}})) if $is_tt_switch_active;
@@ -123,13 +124,13 @@ sub tasks_particular_to_each_object{
${${$self}{linebreaksAtEnd}}{body}=1 if(${$self}{body} =~ m/\R+$/s );
# search for ifElseFi blocks
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
# search for headings (part, chapter, section, setc)
- $self->find_heading;
+ $self->find_heading if ${$self}{body} =~ m/$allHeadingsRegexp/s;
# search for commands and special code blocks
- $self->find_commands_or_key_equals_values_braces_and_special;
+ $self->find_commands_or_key_equals_values_braces_and_special if ${$self}{body} =~ m/$specialBeginAndBracesBracketsBasicRegExp/s;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
index ff118352762..8f3dee24066 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm
@@ -159,6 +159,8 @@ ENDQUOTE
$logger->info("Filename: ${$self}{fileName}");
} else {
$logger->info("Reading input from STDIN");
+ my $buttonText = ($FindBin::Script eq 'latexindent.exe') ? 'CTRL+Z followed by ENTER':'CTRL+D';
+ print "Please enter text to be indented: (press $buttonText when finished)\n";
}
# log the switches from the user
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm
index 51fc9e64d39..ba6e220d09e 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/MandatoryArgument.pm
@@ -20,6 +20,8 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_mandatory_arguments get_mand_arg_reg_exp/;
@@ -121,10 +123,10 @@ sub tasks_particular_to_each_object{
my $self = shift;
# search for ifElseFi blocks
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
# search for special begin/end
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm
index 2b18f3c966b..f98acac4874 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/OptionalArgument.pm
@@ -20,6 +20,8 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_optional_arguments/;
@@ -106,10 +108,10 @@ sub tasks_particular_to_each_object{
my $self = shift;
# search for ifElseFi blocks
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
# search for special begin/end
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm
index fea38af0b64..306b423e5a9 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Preamble.pm
@@ -20,6 +20,9 @@ use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::Switches qw/$is_t_switch_active/;
use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Environment qw/$environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our $preambleCounter;
@@ -49,14 +52,14 @@ sub tasks_particular_to_each_object{
my $self = shift;
# search for environments
- $self->find_environments;
+ $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/;
# search for ifElseFi blocks
- $self->find_ifelsefi;
+ $self->find_ifelsefi if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
if(${$masterSettings{specialBeginEnd}}{specialBeforeCommand}){
# search for special begin/end
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
# search for commands with arguments
$self->find_commands_or_key_equals_values_braces if(!$masterSettings{preambleCommandsBeforeEnvironments});
@@ -65,7 +68,7 @@ sub tasks_particular_to_each_object{
$self->find_commands_or_key_equals_values_braces if(!$masterSettings{preambleCommandsBeforeEnvironments});
# search for special begin/end
- $self->find_special;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
}
}
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
index 45dd4c3ec16..aa17f24df13 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Special.pm
@@ -21,14 +21,17 @@ use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
use LatexIndent::GetYamlSettings qw/%masterSettings/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
-our @EXPORT_OK = qw/find_special construct_special_begin/;
+our @EXPORT_OK = qw/find_special construct_special_begin $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/;
our $specialCounter;
our $specialBegins = q();
our $specialAllMatchesRegExp = q();
our %individualSpecialRegExps;
+our $specialBeginAndBracesBracketsBasicRegExp;
+our $specialBeginBasicRegExp;
sub construct_special_begin{
my $self = shift;
@@ -102,6 +105,10 @@ sub construct_special_begin{
$logger->trace("*The overall special regexp is: (see specialBeginEnd)") if $is_tt_switch_active;
$logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active;
+ # basic special begin regexp
+ $specialBeginBasicRegExp = qr/$specialBegins/;
+ $specialBeginAndBracesBracketsBasicRegExp = $specialBegins."|\\{|\\[";
+ $specialBeginAndBracesBracketsBasicRegExp = qr/$specialBeginAndBracesBracketsBasicRegExp/;
}
sub find_special{
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
index c048b649a66..bfec70b7942 100644
--- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
+++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm
@@ -19,6 +19,6 @@ use warnings;
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;
-our $versionNumber = '3.4.2';
-our $versionDate = '2018-04-27';
+our $versionNumber = '3.4.3';
+our $versionDate = '2018-06-08';
1
diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
index 4fa5eed5cc1..785b805eed7 100755
--- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
+++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.4.2, 2018-04-27
+# defaultSettings.yaml for latexindent.pl, version 3.4.3, 2018-06-08
# a script that aims to
# beautify .tex, .sty, .cls files
#
@@ -23,8 +23,8 @@
# You're welcome to change anything you like in here, but
# it would probably be better to have your own user settings
-# files somewhere else- remember that this file may be overwritten
-# anytime that you update your distribution. Please see the manual
+# files somewhere else - remember that this file may be overwritten
+# when you update your distribution. Please see the manual
# for details of how to setup your own settings files.
#
# Please read the manual first to understand what each switch does.
@@ -49,9 +49,9 @@ fileExtensionPreference:
# myfileBACKUP.bak
backupExtension: .bak
-# only one backup per file; if onlyOneBackUp is 0 then the
-# number on the extension increments by 1 each time
-# (this is in place as a safety measure) myfile.bak0, myfile.bak1, myfile.bak2
+# only one backup per file; if onlyOneBackUp is 0 then, as a safety measure,
+# the number on the extension increments by 1 each time:
+# myfile.bak0, myfile.bak1, myfile.bak2
#
# if you set onlyOnebackUp to 1, then the backup file will
# be overwritten each time (not recommended until you trust the script)
@@ -88,8 +88,8 @@ logFilePreferences:
trace: "%A%n"
ttrace: "%A%n"
-# verbatim environments- environments specified
-# in this hash table will not be changed at all!
+# verbatim environments specified
+# in this field will not be changed at all!
verbatimEnvironments:
verbatim: 1
lstlisting: 1
@@ -139,8 +139,7 @@ preambleCommandsBeforeEnvironments: 0
# Default value of indentation
defaultIndent: "\t"
-# environments that have tab delimiters, add more
-# as needed
+# name of code blocks that should have their body aligned at ampersand delimiters
lookForAlignDelims:
tabular:
delims: 1
@@ -187,7 +186,7 @@ indentAfterItems:
list: 1
# if you want to use other names for your items (such as, for example, part)
-# then populate them here- note that you can trick latexindent.pl
+# then populate them here; note that you can trick latexindent.pl
# into indenting all kinds of commands (within environments specified in
# indentAfterItems) using this technique.
itemNames:
@@ -250,7 +249,7 @@ maximumIndentation: -1
# if you don't want to have additional indentation
# in an environment put it in this hash table; note that
-# environments in this hash table will inherit
+# environments in this field will inherit
# the *current* level of indentation they just won't
# get any *additional*.
noAdditionalIndent:
diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl
index b49b2a009cc..c9835ccbe37 100755
--- a/Master/texmf-dist/scripts/latexindent/latexindent.pl
+++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# latexindent.pl, version 3.4.2, 2018-04-27
+# latexindent.pl, version 3.4.3, 2018-06-08
#
# 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