summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-08 03:01:09 +0000
committerNorbert Preining <norbert@preining.info>2021-05-08 03:01:09 +0000
commit0f8acc6eb1940c147de1fb17b307dad849cb3915 (patch)
tree396fc6150b43761431485f4e19ee22d376b72922 /support
parentc92d9953347e3bdebc5243c67cf012a2f7a60fb6 (diff)
CTAN sync 202105080301
Diffstat (limited to 'support')
-rw-r--r--support/latexindent/LatexIndent/Document.pm32
-rw-r--r--support/latexindent/LatexIndent/FileExtension.pm10
-rw-r--r--support/latexindent/LatexIndent/Logger.pm14
-rw-r--r--support/latexindent/LatexIndent/Version.pm4
-rw-r--r--support/latexindent/README2
-rw-r--r--support/latexindent/defaultSettings.yaml2
-rw-r--r--support/latexindent/documentation/latexindent.pdfbin898429 -> 898994 bytes
-rw-r--r--support/latexindent/documentation/sec-default-user-local.tex3
-rw-r--r--support/latexindent/documentation/sec-how-to-use.tex7
-rw-r--r--support/latexindent/documentation/sec-the-m-switch.tex18
-rw-r--r--support/latexindent/documentation/title.tex4
-rwxr-xr-xsupport/latexindent/latexindent.pl2
12 files changed, 67 insertions, 31 deletions
diff --git a/support/latexindent/LatexIndent/Document.pm b/support/latexindent/LatexIndent/Document.pm
index 0b3ea9b254..863d4d7d00 100644
--- a/support/latexindent/LatexIndent/Document.pm
+++ b/support/latexindent/LatexIndent/Document.pm
@@ -153,6 +153,19 @@ sub output_indented_text{
$logger->info("Not outputting to file; see -w and -o switches for more options.");
}
+ # output the log file information
+ $self->output_logfile();
+
+ # output to screen, unless silent mode
+ print ${$self}{body} unless $switches{silentMode};
+
+ return;
+}
+
+sub output_logfile{
+
+ my $self = shift;
+ #
# put the final line in the logfile
$logger->info("${$masterSettings{logFilePreferences}}{endLogFileWith}") if ${$masterSettings{logFilePreferences}}{endLogFileWith};
@@ -162,19 +175,18 @@ sub output_indented_text{
# open log file
my $logfileName = $switches{logFileName}||"indent.log";
my $logfile;
- open($logfile,">","${$self}{cruftDirectory}/$logfileName") or die "Can't open $logfileName";
+ my $logfilePossible = 1;
+ open($logfile,">","${$self}{cruftDirectory}/$logfileName") or $logfilePossible =0;
- foreach my $line (@{LatexIndent::Logger::logFileLines}){
- print $logfile $line,"\n";
- }
+ if($logfilePossible){
+ foreach my $line (@{LatexIndent::Logger::logFileLines}){
+ print $logfile $line,"\n";
+ }
- # close log file
- close($logfile);
-
- # output to screen, unless silent mode
- print ${$self}{body} unless $switches{silentMode};
+ # close log file
+ close($logfile);
+ }
- return;
}
sub process_body_of_text{
diff --git a/support/latexindent/LatexIndent/FileExtension.pm b/support/latexindent/LatexIndent/FileExtension.pm
index 499ca9f65a..6902b0f48c 100644
--- a/support/latexindent/LatexIndent/FileExtension.pm
+++ b/support/latexindent/LatexIndent/FileExtension.pm
@@ -48,8 +48,8 @@ sub file_extension_check{
if ($fileName ne "-"){
if (!$ext) {
$logger->info("*File extension work:");
- $logger->info("latexindent called to act upon $fileName without a file extension;\nsearching for file with an extension in the following order (see fileExtensionPreference):");
- $logger->info(join("\n",@fileExtensions));
+ $logger->info("latexindent called to act upon $fileName without a file extension;\nsearching for files in the following order (see fileExtensionPreference):");
+ $logger->info($fileName.join("\n$fileName",@fileExtensions));
my $fileFound = 0;
# loop through the known file extensions (see @fileExtensions)
@@ -70,13 +70,15 @@ sub file_extension_check{
$logger->fatal("I searched for $fileName$_");
}
$logger->fatal("but couldn't find any of them.\nConsider updating fileExtensionPreference.\nExiting, no indendation done.");
- die "I couldn't find a match for $fileName in fileExtensionPreference.\nExiting, no indendation done.";
+ $self->output_logfile();
+ die "ERROR: I couldn't find any of the following files: ".$fileName.join(", $fileName",@fileExtensions)." (see fileExtensionPreference)\nExiting, no indendation done.";
}
} else {
# if the file has a recognised extension, check that the file exists
unless( -e $fileName ){
- my $message = "I couldn't find $fileName, are you sure it exists?.\nNo indentation done.\nExiting.";
+ my $message = "ERROR: I couldn't find $fileName, are you sure it exists?\nNo indentation done.\nExiting.";
$logger->fatal("*$message");
+ $self->output_logfile();
die $message;
}
}
diff --git a/support/latexindent/LatexIndent/Logger.pm b/support/latexindent/LatexIndent/Logger.pm
index 02bcd23dd7..35ff428eab 100644
--- a/support/latexindent/LatexIndent/Logger.pm
+++ b/support/latexindent/LatexIndent/Logger.pm
@@ -49,6 +49,20 @@ sub warn{
print $logfileline,"\n" if $switches{screenlog};
}
+sub fatal{
+ my $self = shift;
+ my $logfileline = shift;
+ if ($logfileline =~ m/^\*/s){
+ $logfileline =~ s/^\*/FATAL /s;
+ $logfileline =~ s/^/ /mg;
+ $logfileline =~ s/^\h+FATAL/FATAL/s;
+ } else {
+ $logfileline =~ s/^/ /mg;
+ }
+ push(@logFileLines,$logfileline);
+ print $logfileline,"\n" if $switches{screenlog};
+}
+
sub trace{
my $self = shift;
my $logfileline = shift;
diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm
index 3751a17adb..20cbab2672 100644
--- a/support/latexindent/LatexIndent/Version.pm
+++ b/support/latexindent/LatexIndent/Version.pm
@@ -19,6 +19,6 @@ use warnings;
use Exporter qw/import/;
our @EXPORT_OK = qw/$versionNumber $versionDate/;
-our $versionNumber = '3.9.2';
-our $versionDate = '2021-04-06';
+our $versionNumber = '3.9.3';
+our $versionDate = '2021-05-07';
1
diff --git a/support/latexindent/README b/support/latexindent/README
index 3d68267b28..225e4ba5f3 100644
--- a/support/latexindent/README
+++ b/support/latexindent/README
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- latexindent.pl, version 3.9.2, 2021-04-06
+ latexindent.pl, version 3.9.3, 2021-05-07
PERL script to indent code within environments, and align delimited
environments in .tex files.
diff --git a/support/latexindent/defaultSettings.yaml b/support/latexindent/defaultSettings.yaml
index a102896111..2a927de535 100644
--- a/support/latexindent/defaultSettings.yaml
+++ b/support/latexindent/defaultSettings.yaml
@@ -1,4 +1,4 @@
-# defaultSettings.yaml for latexindent.pl, version 3.9.2, 2021-04-06
+# defaultSettings.yaml for latexindent.pl, version 3.9.3, 2021-05-07
# a script that aims to
# beautify .tex, .sty, .cls files
#
diff --git a/support/latexindent/documentation/latexindent.pdf b/support/latexindent/documentation/latexindent.pdf
index 9aff38414b..a6d1c74fa5 100644
--- a/support/latexindent/documentation/latexindent.pdf
+++ b/support/latexindent/documentation/latexindent.pdf
Binary files differ
diff --git a/support/latexindent/documentation/sec-default-user-local.tex b/support/latexindent/documentation/sec-default-user-local.tex
index 5e04637ea3..2e5afbcdae 100644
--- a/support/latexindent/documentation/sec-default-user-local.tex
+++ b/support/latexindent/documentation/sec-default-user-local.tex
@@ -152,7 +152,8 @@ copy myfile.bak4 to myfile.bak3
%(*@@*)\end{noindent}
\end{cmhlistings}
- Important note: it is assumed that the \texttt{noindent} block statements appear on their own line.
+ Important note: it is assumed that the \texttt{noindent} block statements appear on
+ their own line.
\yamltitle{removeTrailingWhitespace}*{fields}\label{yaml:removeTrailingWhitespace}
diff --git a/support/latexindent/documentation/sec-how-to-use.tex b/support/latexindent/documentation/sec-how-to-use.tex
index 8c7d9b9556..0760d467ef 100644
--- a/support/latexindent/documentation/sec-how-to-use.tex
+++ b/support/latexindent/documentation/sec-how-to-use.tex
@@ -317,6 +317,13 @@ latexindent.pl myfile.tex -g other.log
if you wish to change the name of this file, simply call the script with your chosen name
after the \texttt{-g} switch as demonstrated above.
+ \announce*{2021-05-07}{log file creation updated} If \texttt{latexindent.pl} can not open the log file that you
+ specify, then the script will operate, and no log file will be produced; this might be
+ helpful to users who wish to specify the following, for example
+ \begin{commandshell}
+latexindent.pl -g /dev/null myfile.tex
+\end{commandshell}
+
\flagbox{-sl, --screenlog}
\index{switches!-sl, --screenlog definition and details}
\begin{commandshell}
diff --git a/support/latexindent/documentation/sec-the-m-switch.tex b/support/latexindent/documentation/sec-the-m-switch.tex
index c77ed24ec4..13ee49d1b4 100644
--- a/support/latexindent/documentation/sec-the-m-switch.tex
+++ b/support/latexindent/documentation/sec-the-m-switch.tex
@@ -1901,17 +1901,17 @@ latexindent.pl -m pmatrix3.tex -l DBS3.yaml
\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 poly-switches} \\
- & \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/support/latexindent/documentation/title.tex b/support/latexindent/documentation/title.tex
index cd892f1348..7545c5d493 100644
--- a/support/latexindent/documentation/title.tex
+++ b/support/latexindent/documentation/title.tex
@@ -8,14 +8,14 @@
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.9.2
+ \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.9.3
\end{tcolorbox}
}
\author{Chris Hughes \thanks{and contributors!
See \vref{sec:contributors}.
For
all communication, please visit \cite{latexindent-home}.}}
-\date{2021-04-06}
+\date{2021-05-07}
\maketitle
\begin{adjustwidth}{1cm}{1cm}
\small
diff --git a/support/latexindent/latexindent.pl b/support/latexindent/latexindent.pl
index f339ec591b..ef24db27b2 100755
--- a/support/latexindent/latexindent.pl
+++ b/support/latexindent/latexindent.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# latexindent.pl, version 3.9.2, 2021-04-06
+# latexindent.pl, version 3.9.3, 2021-05-07
#
# 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