summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/latexindent/LatexIndent/BackUpFileProcedure.pm9
-rw-r--r--support/latexindent/LatexIndent/Document.pm16
-rw-r--r--support/latexindent/LatexIndent/GetYamlSettings.pm3
-rw-r--r--support/latexindent/LatexIndent/Item.pm2
-rw-r--r--support/latexindent/LatexIndent/LogFile.pm4
-rw-r--r--support/latexindent/LatexIndent/Version.pm4
-rw-r--r--support/latexindent/README2
-rw-r--r--support/latexindent/bin/linux/latexindentbin6163721 -> 6163996 bytes
-rw-r--r--support/latexindent/bin/macos/latexindentbin6392927 -> 6393199 bytes
-rw-r--r--support/latexindent/defaultSettings.yaml2
-rw-r--r--support/latexindent/documentation/contributors.bib8
-rw-r--r--support/latexindent/documentation/latexindent-yaml-schema.json2
-rw-r--r--support/latexindent/documentation/latexindent.pdfbin1243932 -> 1243960 bytes
-rwxr-xr-xsupport/latexindent/latexindent.pl2
14 files changed, 42 insertions, 12 deletions
diff --git a/support/latexindent/LatexIndent/BackUpFileProcedure.pm b/support/latexindent/LatexIndent/BackUpFileProcedure.pm
index 82d1a81653..9f54207a57 100644
--- a/support/latexindent/LatexIndent/BackUpFileProcedure.pm
+++ b/support/latexindent/LatexIndent/BackUpFileProcedure.pm
@@ -23,6 +23,7 @@ use LatexIndent::LogFile qw/$logger/;
use File::Basename; # to get the filename and directory path
use File::Copy; # to copy the original file to backup (if overwrite option set)
use Exporter qw/import/;
+use Encode qw/decode/;
our @EXPORT_OK = qw/create_back_up_file check_if_different/;
# copy main file to a back up in the case of the overwrite switch being active
@@ -35,7 +36,7 @@ sub create_back_up_file {
# if we want to over write the current file create a backup first
$logger->info("*Backup procedure (-w flag active):");
- my $fileName = ${$self}{fileName};
+ my $fileName = decode( "utf-8", ${$self}{fileName} );
# grab the file extension preferences
my %fileExtensionPreference = %{ $mainSettings{fileExtensionPreference} };
@@ -48,7 +49,7 @@ sub create_back_up_file {
my $backupFile = basename( ${$self}{fileName}, @fileExtensions );
# add the user's backup directory to the backup path
- $backupFile = "${$self}{cruftDirectory}/$backupFile";
+ $backupFile = decode( "utf-8", "${$self}{cruftDirectory}/$backupFile" );
# local variables, determined from the YAML settings
my $onlyOneBackUp = $mainSettings{onlyOneBackUp};
@@ -103,9 +104,9 @@ sub create_back_up_file {
for ( my $i = 1; $i <= $maxNumberOfBackUps; $i++ ) {
# remove number from backUpFile
- my $oldBackupFile = $backupFile;
+ my $oldBackupFile = decode( "utf-8", $backupFile );
$oldBackupFile =~ s/$backupExtension.*/$backupExtension/;
- my $newBackupFile = $oldBackupFile;
+ my $newBackupFile = decode( "utf-8", $oldBackupFile );
# add numbers back on
$oldBackupFile .= $i;
diff --git a/support/latexindent/LatexIndent/Document.pm b/support/latexindent/LatexIndent/Document.pm
index d365388679..4a99721a34 100644
--- a/support/latexindent/LatexIndent/Document.pm
+++ b/support/latexindent/LatexIndent/Document.pm
@@ -20,6 +20,7 @@ use warnings;
use Data::Dumper;
use File::Basename; # to get the filename and directory path
use open ':std', ':encoding(UTF-8)';
+use Encode qw/decode/;
# gain access to subroutines in the following modules
use LatexIndent::Switches
@@ -97,7 +98,7 @@ sub latexindent {
# one-time operations
$self->store_switches;
- ${$self}{fileName} = $fileNames[0];
+ ${$self}{fileName} = decode( "utf-8", $fileNames[0] );
$self->process_switches( \@fileNames );
$self->yaml_read_settings;
@@ -228,13 +229,26 @@ sub output_indented_text {
# if -overwrite is active then output to original fileName
if ( ${$self}{overwrite} ) {
+
+ # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439)
+ ${$self}{fileName} = decode( "utf-8", ${$self}{fileName} );
+
$logger->info("Overwriting file ${$self}{fileName}");
open( OUTPUTFILE, ">", ${$self}{fileName} );
print OUTPUTFILE ${$self}{body};
close(OUTPUTFILE);
}
elsif ( $switches{outputToFile} ) {
+
+ # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439)
+ #
+ # note, related:
+ #
+ # git config --add core.quotePath false
+ ${$self}{outputToFile} = decode( "utf-8", ${$self}{outputToFile} );
+
$logger->info("Outputting to file ${$self}{outputToFile}");
+
open( OUTPUTFILE, ">", ${$self}{outputToFile} );
print OUTPUTFILE ${$self}{body};
close(OUTPUTFILE);
diff --git a/support/latexindent/LatexIndent/GetYamlSettings.pm b/support/latexindent/LatexIndent/GetYamlSettings.pm
index 85764353e8..440e2ef20b 100644
--- a/support/latexindent/LatexIndent/GetYamlSettings.pm
+++ b/support/latexindent/LatexIndent/GetYamlSettings.pm
@@ -341,6 +341,9 @@ sub yaml_read_settings {
}
}
+ # diacritics in YAML names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439)
+ $_ = decode( "utf-8", $_ );
+
# check for existence and non-emptiness
if ( ( -e $_ ) and !( -z $_ ) ) {
$logger->info("Adding $_ to YAML read paths");
diff --git a/support/latexindent/LatexIndent/Item.pm b/support/latexindent/LatexIndent/Item.pm
index 0e7201a800..8fe5045852 100644
--- a/support/latexindent/LatexIndent/Item.pm
+++ b/support/latexindent/LatexIndent/Item.pm
@@ -146,7 +146,7 @@ sub remove_line_breaks_begin {
# there is no white space
my $self = shift;
my $BodyStringLogFile = ${$self}{aliases}{BodyStartsOnOwnLine} || "BodyStartsOnOwnLine";
- $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)");
+ $logger->trace("Removing linebreak at the end of begin (see $BodyStringLogFile)") if $is_t_switch_active;
${$self}{begin} =~ s/\R*$//sx;
${$self}{begin} .= " "
unless ( ${$self}{begin} =~ m/\h$/s or ${$self}{body} =~ m/^\h/s or ${$self}{body} =~ m/^\R/s );
diff --git a/support/latexindent/LatexIndent/LogFile.pm b/support/latexindent/LatexIndent/LogFile.pm
index 809aa71d2d..93b6ad0930 100644
--- a/support/latexindent/LatexIndent/LogFile.pm
+++ b/support/latexindent/LatexIndent/LogFile.pm
@@ -22,6 +22,7 @@ use File::Basename; # to get the filename and directory path
use Exporter qw/import/;
use LatexIndent::Switches qw/%switches/;
use LatexIndent::Version qw/$versionNumber $versionDate/;
+use Encode qw/decode/;
our @EXPORT_OK = qw/process_switches $logger/;
our $logger;
@@ -128,6 +129,9 @@ ENDQUOTE
# cruft directory
${$self}{cruftDirectory} = $switches{cruftDirectory} || ( dirname ${$self}{fileName} );
+ # diacritics in cruft directory (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439)
+ ${$self}{cruftDirectory} = decode( "utf-8", ${$self}{cruftDirectory} );
+
# if cruft directory does not exist
if ( !( -d ${$self}{cruftDirectory} ) ) {
$logger->fatal("*Could not find directory ${$self}{cruftDirectory}");
diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm
index e05f59d6f9..457e9c83bf 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.20.4';
-our $versionDate = '2023-03-15';
+our $versionNumber = '3.20.5';
+our $versionDate = '2023-04-07';
1
diff --git a/support/latexindent/README b/support/latexindent/README
index 1a2f1058d3..4a3d96433c 100644
--- a/support/latexindent/README
+++ b/support/latexindent/README
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- latexindent.pl, version 3.20.4, 2023-03-15
+ latexindent.pl, version 3.20.5, 2023-04-07
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
index 71fff30129..3941080085 100644
--- a/support/latexindent/bin/linux/latexindent
+++ b/support/latexindent/bin/linux/latexindent
Binary files differ
diff --git a/support/latexindent/bin/macos/latexindent b/support/latexindent/bin/macos/latexindent
index 8037f1b4b5..ef6d8e84b2 100644
--- a/support/latexindent/bin/macos/latexindent
+++ b/support/latexindent/bin/macos/latexindent
Binary files differ
diff --git a/support/latexindent/defaultSettings.yaml b/support/latexindent/defaultSettings.yaml
index 2dc3f22667..51a8b22229 100644
--- a/support/latexindent/defaultSettings.yaml
+++ b/support/latexindent/defaultSettings.yaml
@@ -1,5 +1,5 @@
#
-# latexindent.pl, version 3.20.4, 2023-03-15
+# latexindent.pl, version 3.20.5, 2023-04-07
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
diff --git a/support/latexindent/documentation/contributors.bib b/support/latexindent/documentation/contributors.bib
index 5dc370f187..3e6147f157 100644
--- a/support/latexindent/documentation/contributors.bib
+++ b/support/latexindent/documentation/contributors.bib
@@ -192,3 +192,11 @@
author = "Henrik Sloot",
urldate = {2023-02-15},
keywords = {contributor},}
+
+@online{valtterikantanen,
+ title = "fix: decode the name of the backup file",
+ url = "https://github.com/cmhughes/latexindent.pl/pull/439",
+ date = {2023-04-07},
+ author = "valtterikantanen",
+ urldate = {2023-04-07},
+ keywords = {contributor},}
diff --git a/support/latexindent/documentation/latexindent-yaml-schema.json b/support/latexindent/documentation/latexindent-yaml-schema.json
index 3c21407f7a..f2089565dc 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.20.4 2023-03-15",
+ "description": "latexindent.pl YAML schema helper, V3.20.5 2023-04-07",
"type": "object",
"properties": {
"fileExtensionPreference": {
diff --git a/support/latexindent/documentation/latexindent.pdf b/support/latexindent/documentation/latexindent.pdf
index 7bf086b16d..e6d1ead45d 100644
--- a/support/latexindent/documentation/latexindent.pdf
+++ b/support/latexindent/documentation/latexindent.pdf
Binary files differ
diff --git a/support/latexindent/latexindent.pl b/support/latexindent/latexindent.pl
index 4553e6dd7b..90e9408b0a 100755
--- a/support/latexindent/latexindent.pl
+++ b/support/latexindent/latexindent.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# latexindent.pl, version 3.20.4, 2023-03-15
+# latexindent.pl, version 3.20.5, 2023-04-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