summaryrefslogtreecommitdiff
path: root/support/latexindent
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-09-10 03:01:10 +0000
committerNorbert Preining <norbert@preining.info>2023-09-10 03:01:10 +0000
commit5aeceaafdf41d8bd02ef1521380f21cbb163bd69 (patch)
tree6fc5a25e0ff30a802239a964357bb419c42f526a /support/latexindent
parent802cff464fb0c30783078dd27c9615c8b3500af3 (diff)
CTAN sync 202309100301
Diffstat (limited to 'support/latexindent')
-rw-r--r--support/latexindent/LatexIndent/AlignmentAtAmpersand.pm18
-rw-r--r--support/latexindent/LatexIndent/Arguments.pm10
-rw-r--r--support/latexindent/LatexIndent/BackUpFileProcedure.pm6
-rw-r--r--support/latexindent/LatexIndent/BlankLines.pm8
-rw-r--r--support/latexindent/LatexIndent/Braces.pm4
-rw-r--r--support/latexindent/LatexIndent/Check.pm8
-rw-r--r--support/latexindent/LatexIndent/Command.pm8
-rw-r--r--support/latexindent/LatexIndent/Document.pm54
-rw-r--r--support/latexindent/LatexIndent/DoubleBackSlash.pm4
-rw-r--r--support/latexindent/LatexIndent/Else.pm14
-rw-r--r--support/latexindent/LatexIndent/Environment.pm20
-rw-r--r--support/latexindent/LatexIndent/FileContents.pm16
-rw-r--r--support/latexindent/LatexIndent/FileExtension.pm8
-rw-r--r--support/latexindent/LatexIndent/GetYamlSettings.pm4
-rw-r--r--support/latexindent/LatexIndent/Heading.pm14
-rw-r--r--support/latexindent/LatexIndent/HiddenChildren.pm12
-rw-r--r--support/latexindent/LatexIndent/HorizontalWhiteSpace.pm6
-rw-r--r--support/latexindent/LatexIndent/IfElseFi.pm14
-rw-r--r--support/latexindent/LatexIndent/Indent.pm18
-rw-r--r--support/latexindent/LatexIndent/Item.pm24
-rw-r--r--support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm10
-rw-r--r--support/latexindent/LatexIndent/Lines.pm6
-rw-r--r--support/latexindent/LatexIndent/LogFile.pm8
-rw-r--r--support/latexindent/LatexIndent/MandatoryArgument.pm14
-rw-r--r--support/latexindent/LatexIndent/ModifyLineBreaks.pm14
-rw-r--r--support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm10
-rw-r--r--support/latexindent/LatexIndent/OptionalArgument.pm14
-rw-r--r--support/latexindent/LatexIndent/Preamble.pm12
-rw-r--r--support/latexindent/LatexIndent/Replacement.pm10
-rw-r--r--support/latexindent/LatexIndent/RoundBrackets.pm6
-rw-r--r--support/latexindent/LatexIndent/Sentence.pm73
-rw-r--r--support/latexindent/LatexIndent/Special.pm16
-rw-r--r--support/latexindent/LatexIndent/Switches.pm2
-rw-r--r--support/latexindent/LatexIndent/Tokens.pm4
-rw-r--r--support/latexindent/LatexIndent/TrailingComments.pm8
-rw-r--r--support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm10
-rw-r--r--support/latexindent/LatexIndent/Verbatim.pm20
-rw-r--r--support/latexindent/LatexIndent/Version.pm4
-rw-r--r--support/latexindent/LatexIndent/Wrap.pm14
-rw-r--r--support/latexindent/README2
-rw-r--r--support/latexindent/bin/linux/latexindentbin6172794 -> 6173320 bytes
-rw-r--r--support/latexindent/bin/macos/latexindentbin6402020 -> 6402551 bytes
-rw-r--r--support/latexindent/defaultSettings.yaml32
-rw-r--r--support/latexindent/documentation/latexindent-yaml-schema.json2
-rw-r--r--support/latexindent/documentation/latexindent.pdfbin1250829 -> 1259686 bytes
-rw-r--r--support/latexindent/documentation/latexindent.tex174
-rwxr-xr-xsupport/latexindent/latexindent.pl2
47 files changed, 416 insertions, 321 deletions
diff --git a/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm b/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm
index 16603094a9..3cffb4ddac 100644
--- a/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm
+++ b/support/latexindent/LatexIndent/AlignmentAtAmpersand.pm
@@ -18,15 +18,15 @@ package LatexIndent::AlignmentAtAmpersand;
use strict;
use warnings;
use Data::Dumper;
-use Exporter qw/import/;
-use List::Util qw/max min sum/;
+use Exporter qw/import/;
+use List::Util qw/max min sum/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active %switches/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::HiddenChildren qw/%familyTree/;
-use LatexIndent::Verbatim qw/%verbatimStorage/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active %switches/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::HiddenChildren qw/%familyTree/;
+use LatexIndent::Verbatim qw/%verbatimStorage/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK
= qw/align_at_ampersand find_aligned_block double_back_slash_else main_formatting individual_padding multicolumn_padding multicolumn_pre_check multicolumn_post_check dont_measure hidden_child_cell_row_width hidden_child_row_width get_column_width/;
@@ -719,7 +719,7 @@ sub dont_measure {
${ $cellStorage[ $input{row} ][ $input{column} ] }{width} )
if ($is_t_switch_active);
$logger->trace( "entry: ", ${ $cellStorage[ $input{row} ][ $input{column} ] }{entry} ) if ($is_t_switch_active);
- $logger->trace("--------------------------") if ($is_t_switch_active);
+ $logger->trace("--------------------------") if ($is_t_switch_active);
${ $cellStorage[ $input{row} ][ $input{column} ] }{measureThis} = 0;
${ $cellStorage[ $input{row} ][ $input{column} ] }{type} = "X";
}
diff --git a/support/latexindent/LatexIndent/Arguments.pm b/support/latexindent/LatexIndent/Arguments.pm
index e70fd57fb5..69bb6026a2 100644
--- a/support/latexindent/LatexIndent/Arguments.pm
+++ b/support/latexindent/LatexIndent/Arguments.pm
@@ -17,11 +17,11 @@ package LatexIndent::Arguments;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+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::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::LogFile qw/$logger/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -263,7 +263,7 @@ sub find_opt_mand_arguments {
# delete the regexp, as there's no need for it
delete ${ ${ ${$self}{children} }[-1] }{regexp};
- $logger->trace( Dumper( \%{$arguments} ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%{$arguments} ) ) if ($is_tt_switch_active);
$logger->trace("replaced with ID: ${$arguments}{id}") if $is_tt_switch_active;
}
else {
diff --git a/support/latexindent/LatexIndent/BackUpFileProcedure.pm b/support/latexindent/LatexIndent/BackUpFileProcedure.pm
index 9f54207a57..1fc5bbb28c 100644
--- a/support/latexindent/LatexIndent/BackUpFileProcedure.pm
+++ b/support/latexindent/LatexIndent/BackUpFileProcedure.pm
@@ -18,12 +18,12 @@ package LatexIndent::BackUpFileProcedure;
use strict;
use warnings;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/%switches/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Switches qw/%switches/;
+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/;
+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
diff --git a/support/latexindent/LatexIndent/BlankLines.pm b/support/latexindent/LatexIndent/BlankLines.pm
index d0fee3cbe6..c2ad537feb 100644
--- a/support/latexindent/LatexIndent/BlankLines.pm
+++ b/support/latexindent/LatexIndent/BlankLines.pm
@@ -17,11 +17,11 @@ package LatexIndent::BlankLines;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
our @EXPORT_OK = qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/;
sub protect_blank_lines {
diff --git a/support/latexindent/LatexIndent/Braces.pm b/support/latexindent/LatexIndent/Braces.pm
index 80efc02e52..abddc45ccb 100644
--- a/support/latexindent/LatexIndent/Braces.pm
+++ b/support/latexindent/LatexIndent/Braces.pm
@@ -25,10 +25,10 @@ use LatexIndent::NamedGroupingBracesBrackets qw/$grouping_braces_regexp $groupin
use LatexIndent::UnNamedGroupingBracesBrackets
qw/$un_named_grouping_braces_RegExp $un_named_grouping_braces_RegExp_trailing_comment/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::LogFile qw/$logger/;
use Data::Dumper;
use Exporter qw/import/;
-our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
+our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_commands_or_key_equals_values_braces $braceBracketRegExpBasic/;
our $commandCounter;
our $braceBracketRegExpBasic = qr/\{|\[/;
diff --git a/support/latexindent/LatexIndent/Check.pm b/support/latexindent/LatexIndent/Check.pm
index 76d75cc989..e983e9f3a1 100644
--- a/support/latexindent/LatexIndent/Check.pm
+++ b/support/latexindent/LatexIndent/Check.pm
@@ -17,8 +17,8 @@ package LatexIndent::Check;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use Exporter qw/import/;
-use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
+use LatexIndent::LogFile qw/$logger/;
use LatexIndent::Switches qw/$is_m_switch_active $is_check_verbose_switch_active/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/simple_diff/;
@@ -113,8 +113,8 @@ sub simple_diff {
}
);
- $tmpOldBody = '-' . ${ $diff[$i] }{old} if defined ${ $diff[$i] }{old};
- $tmpNewBody = '+' . ${ $diff[$i] }{new} if defined ${ $diff[$i] }{new};
+ $tmpOldBody = '-' . ${ $diff[$i] }{old} if defined ${ $diff[$i] }{old};
+ $tmpNewBody = '+' . ${ $diff[$i] }{new} if defined ${ $diff[$i] }{new};
$diffChunkFirstLineNumber = $currentLineNumber;
}
else {
diff --git a/support/latexindent/LatexIndent/Command.pm b/support/latexindent/LatexIndent/Command.pm
index 9e2a677a1b..3ed17900c9 100644
--- a/support/latexindent/LatexIndent/Command.pm
+++ b/support/latexindent/LatexIndent/Command.pm
@@ -17,11 +17,11 @@ package LatexIndent::Command;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::LogFile qw/$logger/;
use Data::Dumper;
use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
diff --git a/support/latexindent/LatexIndent/Document.pm b/support/latexindent/LatexIndent/Document.pm
index 59188a7234..04c8e638dc 100644
--- a/support/latexindent/LatexIndent/Document.pm
+++ b/support/latexindent/LatexIndent/Document.pm
@@ -25,20 +25,20 @@ use Encode qw/decode/;
# gain access to subroutines in the following modules
use LatexIndent::Switches
qw/store_switches %switches $is_m_switch_active $is_t_switch_active $is_tt_switch_active $is_r_switch_active $is_rr_switch_active $is_rv_switch_active $is_check_switch_active/;
-use LatexIndent::LogFile qw/process_switches $logger/;
-use LatexIndent::Logger qw/@logFileLines/;
-use LatexIndent::Check qw/simple_diff/;
-use LatexIndent::Lines qw/lines_body_selected_lines lines_verbatim_create_line_block/;
+use LatexIndent::LogFile qw/process_switches $logger/;
+use LatexIndent::Logger qw/@logFileLines/;
+use LatexIndent::Check qw/simple_diff/;
+use LatexIndent::Lines qw/lines_body_selected_lines lines_verbatim_create_line_block/;
use LatexIndent::Replacement qw/make_replacements/;
use LatexIndent::GetYamlSettings
qw/yaml_read_settings yaml_modify_line_breaks_settings yaml_get_indentation_settings_for_this_object yaml_poly_switch_get_every_or_custom_value yaml_get_indentation_information yaml_get_object_attribute_for_indentation_settings yaml_alignment_at_ampersand_settings %mainSettings /;
-use LatexIndent::FileExtension qw/file_extension_check/;
+use LatexIndent::FileExtension qw/file_extension_check/;
use LatexIndent::BackUpFileProcedure qw/create_back_up_file check_if_different/;
-use LatexIndent::BlankLines qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/;
+use LatexIndent::BlankLines qw/protect_blank_lines unprotect_blank_lines condense_blank_lines/;
use LatexIndent::ModifyLineBreaks
qw/modify_line_breaks_body modify_line_breaks_end modify_line_breaks_end_after remove_line_breaks_begin adjust_line_breaks_end_parent verbatim_modify_line_breaks/;
use LatexIndent::Sentence qw/one_sentence_per_line/;
-use LatexIndent::Wrap qw/text_wrap text_wrap_comment_blocks/;
+use LatexIndent::Wrap qw/text_wrap text_wrap_comment_blocks/;
use LatexIndent::TrailingComments
qw/remove_trailing_comments put_trailing_comments_back_in add_comment_symbol construct_trailing_comment_regexp/;
use LatexIndent::HorizontalWhiteSpace qw/remove_trailing_whitespace remove_leading_space/;
@@ -55,21 +55,21 @@ use LatexIndent::DoubleBackSlash qw/dodge_double_backslash un_dodge_double_backs
use LatexIndent::Verbatim
qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands find_verbatim_special verbatim_common_tasks %verbatimStorage/;
use LatexIndent::Environment qw/find_environments $environmentBasicRegExp construct_environments_regexp/;
-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 construct_arguments_regexp comma_else/;
-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 $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::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 construct_arguments_regexp comma_else/;
+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 $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 $specialBeginAndBracesBracketsBasicRegExp $specialBeginBasicRegExp/;
-use LatexIndent::Heading qw/find_heading construct_headings_levels $allHeadingsRegexp/;
+use LatexIndent::Heading qw/find_heading construct_headings_levels $allHeadingsRegexp/;
use LatexIndent::FileContents qw/find_file_contents_environments_and_preamble/;
use LatexIndent::Preamble;
@@ -369,15 +369,15 @@ sub find_objects {
# search for environments
$logger->trace('*looking for ENVIRONMENTS') if $is_t_switch_active;
- $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s;
+ $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 if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
+ $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 if ${$self}{body} =~ m/$allHeadingsRegexp/s;
+ $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
@@ -412,16 +412,16 @@ sub find_commands_or_key_equals_values_braces_and_special {
# 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 if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
+ $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 if ${$self}{body} =~ m/$braceBracketRegExpBasic/s;
+ $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 if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
+ $self->find_special if ${$self}{body} =~ m/$specialBeginBasicRegExp/s;
}
return;
}
@@ -540,7 +540,7 @@ sub tasks_common_to_each_object {
if (
$is_m_switch_active
and ( ${$self}{lookForAlignDelims}
- or ( defined ${$self}{DBSStartsOnOwnLine} and ${$self}{DBSStartsOnOwnLine} != 0 )
+ or ( defined ${$self}{DBSStartsOnOwnLine} and ${$self}{DBSStartsOnOwnLine} != 0 )
or ( defined ${$self}{DBSFinishesWithLineBreak} and ${$self}{DBSFinishesWithLineBreak} != 0 ) )
);
@@ -596,7 +596,7 @@ sub wrap_up_tasks {
# check if the last object was the last thing in the body, and if it has adjusted linebreaks
$self->adjust_line_breaks_end_parent if $is_m_switch_active;
- $logger->trace( Dumper( \%{$child} ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%{$child} ) ) if ($is_tt_switch_active);
$logger->trace("replaced with ID: ${$child}{id}") if $is_t_switch_active;
}
diff --git a/support/latexindent/LatexIndent/DoubleBackSlash.pm b/support/latexindent/LatexIndent/DoubleBackSlash.pm
index 1c483b6865..10c484935f 100644
--- a/support/latexindent/LatexIndent/DoubleBackSlash.pm
+++ b/support/latexindent/LatexIndent/DoubleBackSlash.pm
@@ -18,8 +18,8 @@ package LatexIndent::DoubleBackSlash;
use strict;
use warnings;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::Tokens qw/%tokens/;
-use Exporter qw/import/;
+use LatexIndent::Tokens qw/%tokens/;
+use Exporter qw/import/;
our @EXPORT_OK = qw/dodge_double_backslash un_dodge_double_backslash/;
# some code can contain, e.g
diff --git a/support/latexindent/LatexIndent/Else.pm b/support/latexindent/LatexIndent/Else.pm
index e78aa6b8b5..cb8a29d743 100644
--- a/support/latexindent/LatexIndent/Else.pm
+++ b/support/latexindent/LatexIndent/Else.pm
@@ -17,14 +17,14 @@ package LatexIndent::Else;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+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 Exporter qw/import/;
+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 Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/check_for_else_statement/;
our $elseCounter;
diff --git a/support/latexindent/LatexIndent/Environment.pm b/support/latexindent/LatexIndent/Environment.pm
index 9d2c34d1bd..c9a456fa1a 100644
--- a/support/latexindent/LatexIndent/Environment.pm
+++ b/support/latexindent/LatexIndent/Environment.pm
@@ -17,17 +17,17 @@ package LatexIndent::Environment;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_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 Exporter qw/import/;
-our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_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 Exporter qw/import/;
+our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_environments $environmentBasicRegExp construct_environments_regexp/;
our $environmentCounter;
our $environmentBasicRegExp = qr/\\begin\{/;
diff --git a/support/latexindent/LatexIndent/FileContents.pm b/support/latexindent/LatexIndent/FileContents.pm
index 5093458ee6..730858094b 100644
--- a/support/latexindent/LatexIndent/FileContents.pm
+++ b/support/latexindent/LatexIndent/FileContents.pm
@@ -17,15 +17,15 @@ package LatexIndent::FileContents;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_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 LatexIndent::Verbatim qw/%verbatimStorage/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_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 LatexIndent::Verbatim qw/%verbatimStorage/;
use Data::Dumper;
use Exporter qw/import/;
our @EXPORT_OK = qw/find_file_contents_environments_and_preamble/;
diff --git a/support/latexindent/LatexIndent/FileExtension.pm b/support/latexindent/LatexIndent/FileExtension.pm
index b61ffc1bb4..bd909b2f60 100644
--- a/support/latexindent/LatexIndent/FileExtension.pm
+++ b/support/latexindent/LatexIndent/FileExtension.pm
@@ -20,11 +20,11 @@ use warnings;
use PerlIO::encoding;
use open ':std', ':encoding(UTF-8)';
use File::Basename; # to get the filename and directory path
-use Exporter qw/import/;
-use Encode qw/decode/;
+use Exporter qw/import/;
+use Encode qw/decode/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/%switches $is_check_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Switches qw/%switches $is_check_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
our @EXPORT_OK = qw/file_extension_check/;
sub file_extension_check {
diff --git a/support/latexindent/LatexIndent/GetYamlSettings.pm b/support/latexindent/LatexIndent/GetYamlSettings.pm
index 6b97e61737..7f3f507076 100644
--- a/support/latexindent/LatexIndent/GetYamlSettings.pm
+++ b/support/latexindent/LatexIndent/GetYamlSettings.pm
@@ -23,7 +23,7 @@ use YAML::Tiny; # interpret defaultSettings.yaml and other potential sett
use File::Basename; # to get the filename and directory path
use File::HomeDir;
use Cwd;
-use Exporter qw/import/;
+use Exporter qw/import/;
use LatexIndent::LogFile qw/$logger/;
our @EXPORT_OK
= qw/yaml_read_settings yaml_modify_line_breaks_settings yaml_get_indentation_settings_for_this_object yaml_poly_switch_get_every_or_custom_value yaml_get_indentation_information yaml_get_object_attribute_for_indentation_settings yaml_alignment_at_ampersand_settings %mainSettings %previouslyFoundSettings/;
@@ -839,7 +839,7 @@ sub yaml_get_indentation_settings_for_this_object {
}
# log file information
- $logger->trace("Settings for $name (stored for future use):") if $is_tt_switch_active;
+ $logger->trace("Settings for $name (stored for future use):") if $is_tt_switch_active;
$logger->trace( Dump \%{ ${previouslyFoundSettings}{$storageName} } ) if $is_tt_switch_active;
}
diff --git a/support/latexindent/LatexIndent/Heading.pm b/support/latexindent/LatexIndent/Heading.pm
index 0a6366f8fa..999fffb8ee 100644
--- a/support/latexindent/LatexIndent/Heading.pm
+++ b/support/latexindent/LatexIndent/Heading.pm
@@ -17,14 +17,14 @@ package LatexIndent::Heading;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::Special qw/$specialBeginBasicRegExp/;
-use Exporter qw/import/;
-our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Special qw/$specialBeginBasicRegExp/;
+use Exporter qw/import/;
+our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_heading construct_headings_levels $allHeadingsRegexp/;
our $headingCounter;
our @headingsRegexpArray;
diff --git a/support/latexindent/LatexIndent/HiddenChildren.pm b/support/latexindent/LatexIndent/HiddenChildren.pm
index aec7cd365e..5f7264a308 100644
--- a/support/latexindent/LatexIndent/HiddenChildren.pm
+++ b/support/latexindent/LatexIndent/HiddenChildren.pm
@@ -17,9 +17,9 @@ package LatexIndent::HiddenChildren;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::LogFile qw/$logger/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
use Data::Dumper;
use Exporter qw/import/;
@@ -75,14 +75,14 @@ sub find_surrounding_indentation_for_children {
# output to logfile
$logger->trace("*FamilyTree before update:") if $is_tt_switch_active;
- $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active);
# update the family tree with ancestors
$self->update_family_tree;
# output information to the logfile
$logger->trace("*FamilyTree after update:") if $is_tt_switch_active;
- $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%familyTree ) ) if ($is_tt_switch_active);
while ( my ( $idToSearch, $ancestorToSearch ) = each %familyTree ) {
$logger->trace("*Hidden child ID: ,$idToSearch, here are its ancestors:") if $is_t_switch_active;
@@ -204,7 +204,7 @@ sub check_for_hidden_children {
# log file
$logger->trace("*Hidden children check for ${$self}{name}") if $is_t_switch_active;
- $logger->trace( join( "|", @matched ) ) if $is_t_switch_active;
+ $logger->trace( join( "|", @matched ) ) if $is_t_switch_active;
my $naturalAncestors = ${$self}{naturalAncestors};
diff --git a/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm b/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm
index 9582eeb6c5..a81405c184 100644
--- a/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm
+++ b/support/latexindent/LatexIndent/HorizontalWhiteSpace.pm
@@ -18,9 +18,9 @@ package LatexIndent::HorizontalWhiteSpace;
use strict;
use warnings;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
our @EXPORT_OK = qw/remove_trailing_whitespace remove_leading_space/;
sub remove_trailing_whitespace {
diff --git a/support/latexindent/LatexIndent/IfElseFi.pm b/support/latexindent/LatexIndent/IfElseFi.pm
index ad7237240b..453d000689 100644
--- a/support/latexindent/LatexIndent/IfElseFi.pm
+++ b/support/latexindent/LatexIndent/IfElseFi.pm
@@ -17,14 +17,14 @@ package LatexIndent::IfElseFi;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
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 Exporter qw/import/;
-our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
+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 Exporter qw/import/;
+our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_ifelsefi construct_ifelsefi_regexp $ifElseFiBasicRegExp/;
our $ifElseFiCounter;
our $ifElseFiRegExp;
diff --git a/support/latexindent/LatexIndent/Indent.pm b/support/latexindent/LatexIndent/Indent.pm
index 23968069b0..e852600bae 100644
--- a/support/latexindent/LatexIndent/Indent.pm
+++ b/support/latexindent/LatexIndent/Indent.pm
@@ -17,11 +17,11 @@ package LatexIndent::Indent;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::HiddenChildren qw/%familyTree/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::HiddenChildren qw/%familyTree/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::LogFile qw/$logger/;
use Text::Tabs;
use Data::Dumper;
use Exporter qw/import/;
@@ -94,8 +94,8 @@ sub get_surrounding_indentation {
$logger->trace(
"ancestor ID: $newAncestorId, adding indentation of $newAncestorId to surroundingIndentation of ${$self}{id}"
) if ($is_t_switch_active);
- $surroundingIndentation .=
- ref( ${$_}{ancestorIndentation} ) eq 'SCALAR'
+ $surroundingIndentation
+ .= ref( ${$_}{ancestorIndentation} ) eq 'SCALAR'
? ( ${ ${$_}{ancestorIndentation} } ? ${ ${$_}{ancestorIndentation} } : q() )
: ( ${$_}{ancestorIndentation} ? ${$_}{ancestorIndentation} : q() );
}
@@ -158,7 +158,7 @@ sub indent_body {
{
my $bodyFirstLine = $1;
my $remainingBody = $2;
- $logger->trace("first line of body: $bodyFirstLine") if $is_tt_switch_active;
+ $logger->trace("first line of body: $bodyFirstLine") if $is_tt_switch_active;
$logger->trace("remaining body (before indentation):\n'$remainingBody'") if ($is_tt_switch_active);
# add the indentation to all the body except first line
@@ -292,7 +292,7 @@ sub indent_children_recursively {
}
$logger->trace('Pre-processed body:') if $is_tt_switch_active;
- $logger->trace( ${$self}{body} ) if ($is_tt_switch_active);
+ $logger->trace( ${$self}{body} ) if ($is_tt_switch_active);
# send the children through this indentation routine recursively
if ( defined ${$self}{children} ) {
@@ -471,7 +471,7 @@ sub replace_id_with_begin_body_end {
# log file info
$logger->trace("Body (${$self}{name}) now looks like:") if $is_tt_switch_active;
- $logger->trace( ${$self}{body} ) if ($is_tt_switch_active);
+ $logger->trace( ${$self}{body} ) if ($is_tt_switch_active);
# remove element from array: http://stackoverflow.com/questions/174292/what-is-the-best-way-to-delete-a-value-from-an-array-in-perl
splice( @{ ${$self}{children} }, $index, 1 );
diff --git a/support/latexindent/LatexIndent/Item.pm b/support/latexindent/LatexIndent/Item.pm
index 8fe5045852..458cb5bdd4 100644
--- a/support/latexindent/LatexIndent/Item.pm
+++ b/support/latexindent/LatexIndent/Item.pm
@@ -17,14 +17,14 @@ package LatexIndent::Item;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-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 LatexIndent::GetYamlSettings qw/%mainSettings/;
+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
@@ -32,6 +32,7 @@ our @EXPORT_OK = qw/find_items construct_list_of_items $listOfItems/;
our $itemCounter;
our $listOfItems = q();
our $itemRegExp;
+our $itemCanBeFollowedBy;
sub construct_list_of_items {
my $self = shift;
@@ -46,18 +47,18 @@ sub construct_list_of_items {
# detail items in the log
$logger->trace("*List of items: $listOfItems (see itemNames)") if $is_t_switch_active;
- my $itemCanBeFollowedBy = qr/${${$mainSettings{fineTuning}}{items}}{canBeFollowedBy}/;
+ $itemCanBeFollowedBy = qr/${${$mainSettings{fineTuning}}{items}}{canBeFollowedBy}/;
$itemRegExp = qr/
(
- \\((?:$listOfItems)(?:$itemCanBeFollowedBy)?(?!\S))
+ \\((?:$listOfItems)(?:$itemCanBeFollowedBy)?(?![a-zA-Z0-9]))
\h*
(\R*)?
)
(
(?: # cluster-only (), don't capture
(?!
- (?:\\(?:(?:$listOfItems)(?:$itemCanBeFollowedBy)?(?!\S))) # cluster-only (), don't capture
+ (?:\\(?:(?:$listOfItems)(?:$itemCanBeFollowedBy)?(?![a-zA-Z0-9]))) # cluster-only (), don't capture
). # any character, but not \\$item
)*
)
@@ -106,10 +107,11 @@ sub find_items {
endImmediatelyFollowedByComment=>$5?0:($7?1:0),
);
+ ${$itemObject}{name} =~ s@$itemCanBeFollowedBy@@s;
# the settings and storage of most objects has a lot in common
$self->get_settings_and_store_new_object($itemObject);
${@{${$self}{children}}[-1]}{replacementText}.($6?$6:q()).($7?$7:q());
- /xseg;
+ /xse;
}
}
diff --git a/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm b/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm
index 873a04adbe..86846d8580 100644
--- a/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm
+++ b/support/latexindent/LatexIndent/KeyEqualsValuesBraces.pm
@@ -17,12 +17,12 @@ package LatexIndent::KeyEqualsValuesBraces;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
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 Exporter qw/import/;
+use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK
= qw/construct_key_equals_values_regexp $key_equals_values_bracesRegExp $key_equals_values_bracesRegExpTrailingComment/;
diff --git a/support/latexindent/LatexIndent/Lines.pm b/support/latexindent/LatexIndent/Lines.pm
index f0510cac1f..7827181147 100644
--- a/support/latexindent/LatexIndent/Lines.pm
+++ b/support/latexindent/LatexIndent/Lines.pm
@@ -17,11 +17,11 @@ package LatexIndent::Lines;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use Exporter qw/import/;
-use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
+use LatexIndent::LogFile qw/$logger/;
use LatexIndent::Switches qw/%switches/;
use LatexIndent::Verbatim qw/%verbatimStorage/;
-our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
+our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/lines_body_selected_lines lines_verbatim_create_line_block/;
sub lines_body_selected_lines {
diff --git a/support/latexindent/LatexIndent/LogFile.pm b/support/latexindent/LatexIndent/LogFile.pm
index 4e9064c937..b72655b686 100644
--- a/support/latexindent/LatexIndent/LogFile.pm
+++ b/support/latexindent/LatexIndent/LogFile.pm
@@ -19,11 +19,11 @@ use strict;
use warnings;
use FindBin;
use File::Basename; # to get the filename and directory path
-use File::Path qw(make_path);
-use Exporter qw/import/;
+use File::Path qw(make_path);
+use Exporter qw/import/;
use LatexIndent::Switches qw/%switches/;
-use LatexIndent::Version qw/$versionNumber $versionDate/;
-use Encode qw/decode/;
+use LatexIndent::Version qw/$versionNumber $versionDate/;
+use Encode qw/decode/;
our @EXPORT_OK = qw/process_switches $logger/;
our $logger;
diff --git a/support/latexindent/LatexIndent/MandatoryArgument.pm b/support/latexindent/LatexIndent/MandatoryArgument.pm
index 65982ba7b5..64ed21fa14 100644
--- a/support/latexindent/LatexIndent/MandatoryArgument.pm
+++ b/support/latexindent/LatexIndent/MandatoryArgument.pm
@@ -17,13 +17,13 @@ package LatexIndent::MandatoryArgument;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
-use LatexIndent::Special qw/$specialBeginBasicRegExp/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_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/;
our $mandatoryArgumentCounter;
@@ -38,7 +38,7 @@ sub find_mandatory_arguments {
# log file output
$logger->trace("*Mandatory argument found, body in ${$self}{name}") if $is_t_switch_active;
- $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active );
+ $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active );
${$self}{body} =~ s/
$mandArgRegExp(\h*)($trailingCommentRegExp)*(.*)
diff --git a/support/latexindent/LatexIndent/ModifyLineBreaks.pm b/support/latexindent/LatexIndent/ModifyLineBreaks.pm
index 35cb04d35a..62737cc144 100644
--- a/support/latexindent/LatexIndent/ModifyLineBreaks.pm
+++ b/support/latexindent/LatexIndent/ModifyLineBreaks.pm
@@ -17,14 +17,14 @@ package LatexIndent::ModifyLineBreaks;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use Exporter qw/import/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Tokens qw/%tokens/;
+use Exporter qw/import/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+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::Item qw/$listOfItems/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::Verbatim qw/%verbatimStorage/;
+use LatexIndent::Switches qw/$is_m_switch_active $is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::Item qw/$listOfItems/;
+use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Verbatim qw/%verbatimStorage/;
our @EXPORT_OK
= qw/modify_line_breaks_body modify_line_breaks_end modify_line_breaks_end_after adjust_line_breaks_end_parent remove_line_breaks_begin verbatim_modify_line_breaks/;
our $paragraphRegExp = q();
diff --git a/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm b/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm
index 3d6dd70af6..fccf4b2022 100644
--- a/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm
+++ b/support/latexindent/LatexIndent/NamedGroupingBracesBrackets.pm
@@ -17,12 +17,12 @@ package LatexIndent::NamedGroupingBracesBrackets;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK
= qw/construct_grouping_braces_brackets_regexp $grouping_braces_regexp $grouping_braces_regexpTrailingComment/;
diff --git a/support/latexindent/LatexIndent/OptionalArgument.pm b/support/latexindent/LatexIndent/OptionalArgument.pm
index 90dba063b9..877a5e97a7 100644
--- a/support/latexindent/LatexIndent/OptionalArgument.pm
+++ b/support/latexindent/LatexIndent/OptionalArgument.pm
@@ -17,13 +17,13 @@ package LatexIndent::OptionalArgument;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active /;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
-use LatexIndent::Special qw/$specialBeginBasicRegExp/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_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/;
our $optionalArgumentCounter;
@@ -52,7 +52,7 @@ sub find_optional_arguments {
# log file output
$logger->trace("*Optional argument found, body in ${$self}{name}") if $is_t_switch_active;
- $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active );
+ $logger->trace("(last argument)") if ( $9 eq '' and $is_t_switch_active );
${$self}{body} =~ s/
$optArgRegExp(\h*)($trailingCommentRegExp)*(.*)
diff --git a/support/latexindent/LatexIndent/Preamble.pm b/support/latexindent/LatexIndent/Preamble.pm
index 7f835e6d0d..69bad5535e 100644
--- a/support/latexindent/LatexIndent/Preamble.pm
+++ b/support/latexindent/LatexIndent/Preamble.pm
@@ -17,13 +17,13 @@ package LatexIndent::Preamble;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_m_switch_active/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_m_switch_active/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::Environment qw/$environmentBasicRegExp/;
-use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
-use LatexIndent::Special qw/$specialBeginBasicRegExp/;
+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;
diff --git a/support/latexindent/LatexIndent/Replacement.pm b/support/latexindent/LatexIndent/Replacement.pm
index 707010e966..e864a96895 100644
--- a/support/latexindent/LatexIndent/Replacement.pm
+++ b/support/latexindent/LatexIndent/Replacement.pm
@@ -17,12 +17,12 @@ package LatexIndent::Replacement;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_rr_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use Exporter qw/import/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_rr_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/make_replacements/;
diff --git a/support/latexindent/LatexIndent/RoundBrackets.pm b/support/latexindent/LatexIndent/RoundBrackets.pm
index 9b6f4aa8dd..9870fb948b 100644
--- a/support/latexindent/LatexIndent/RoundBrackets.pm
+++ b/support/latexindent/LatexIndent/RoundBrackets.pm
@@ -17,10 +17,10 @@ package LatexIndent::RoundBrackets;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/find_round_brackets/;
our $roundBracketCounter;
diff --git a/support/latexindent/LatexIndent/Sentence.pm b/support/latexindent/LatexIndent/Sentence.pm
index 3447d975c3..9a7f32e7db 100644
--- a/support/latexindent/LatexIndent/Sentence.pm
+++ b/support/latexindent/LatexIndent/Sentence.pm
@@ -17,16 +17,16 @@ package LatexIndent::Sentence;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::Environment qw/$environmentBasicRegExp/;
-use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
-use LatexIndent::Heading qw/$allHeadingsRegexp/;
-use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
-use Exporter qw/import/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Environment qw/$environmentBasicRegExp/;
+use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::Heading qw/$allHeadingsRegexp/;
+use LatexIndent::Special qw/$specialBeginAndBracesBracketsBasicRegExp/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/one_sentence_per_line/;
our $sentenceCounter;
@@ -104,7 +104,7 @@ sub one_sentence_per_line {
}
$logger->trace("Sentences follow regexp:") if $is_tt_switch_active;
- $logger->trace($sentencesFollow) if $is_tt_switch_active;
+ $logger->trace($sentencesFollow) if $is_tt_switch_active;
#
# sentences BEGIN with
@@ -186,7 +186,7 @@ sub one_sentence_per_line {
# the OVERALL sentence regexp
#
$logger->trace("Overall sentences end with regexp:") if $is_tt_switch_active;
- $logger->trace($sentencesEndWith) if $is_tt_switch_active;
+ $logger->trace($sentencesEndWith) if $is_tt_switch_active;
$logger->trace("Finding sentences...") if $is_t_switch_active;
@@ -210,11 +210,8 @@ sub one_sentence_per_line {
$notWithinSentence .= "|" . qr/(?:\R?\\par)/s;
}
- # initiate the sentence counter
- my @sentenceStorage;
-
- # make the sentence manipulation
- ${$self}{body} =~ s/((?:$sentencesFollow))
+ my $sentenceRegEx = qr/
+ ((?:$sentencesFollow))
(\h*)
(?!$notWithinSentence)
((?:$sentencesBeginWith).*?)
@@ -222,7 +219,39 @@ sub one_sentence_per_line {
(\h*)? # possibly followed by horizontal space
(\R)? # possibly followed by a line break
($trailingCommentRegExp)? # possibly followed by trailing comments
- /
+ /sx;
+
+ if ( ref ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesDoNOTcontain} eq 'HASH'
+ and defined ${ ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesDoNOTcontain} }{other} )
+ {
+ my $sentencesDoNOTcontain
+ = qr/${${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentencesDoNOTcontain}}{other}/;
+
+ $sentenceRegEx = qr/
+ ((?:$sentencesFollow))
+ (\h*)
+ (?!$notWithinSentence)
+ (
+ (?:$sentencesBeginWith)
+ (?:
+ (?!
+ $sentencesDoNOTcontain
+ ).
+ )
+ *?
+ )
+ ($sentencesEndWith)
+ (\h*)? # possibly followed by horizontal space
+ (\R)? # possibly followed by a line break
+ ($trailingCommentRegExp)? # possibly followed by trailing comments
+ /sx;
+ }
+
+ # initiate the sentence counter
+ my @sentenceStorage;
+
+ # make the sentence manipulation
+ ${$self}{body} =~ s/$sentenceRegEx/
my $beginning = $1;
my $h_space = ($2?$2:q());
my $middle = $3;
@@ -333,7 +362,7 @@ sub one_sentence_per_line {
my $bodyFirstLine = $1;
my $remainingBody = $2;
my $indentation = ${ $mainSettings{modifyLineBreaks}{oneSentencePerLine} }{sentenceIndent};
- $logger->trace("first line of sentence: $bodyFirstLine") if $is_tt_switch_active;
+ $logger->trace("first line of sentence: $bodyFirstLine") if $is_tt_switch_active;
$logger->trace("remaining body (before indentation):\n'$remainingBody'") if ($is_tt_switch_active);
# add the indentation to all the body except first line
@@ -379,15 +408,15 @@ sub tasks_particular_to_each_object {
# search for environments
$logger->trace('looking for ENVIRONMENTS') if $is_t_switch_active;
- $self->find_environments if ${$self}{body} =~ m/$environmentBasicRegExp/s;
+ $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 if ${$self}{body} =~ m/$ifElseFiBasicRegExp/s;
+ $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 if ${$self}{body} =~ m/$allHeadingsRegexp/s;
+ $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
@@ -410,7 +439,7 @@ sub indent_body {
my $bodyFirstLine = $1;
my $remainingBody = $2;
my $indentation = ${$self}{indentation};
- $logger->trace("first line of sentence $bodyFirstLine") if $is_tt_switch_active;
+ $logger->trace("first line of sentence $bodyFirstLine") if $is_tt_switch_active;
$logger->trace("remaining body (before indentation):\n'$remainingBody'") if ($is_tt_switch_active);
# add the indentation to all the body except first line
diff --git a/support/latexindent/LatexIndent/Special.pm b/support/latexindent/LatexIndent/Special.pm
index 331d5e87cf..f68db3400b 100644
--- a/support/latexindent/LatexIndent/Special.pm
+++ b/support/latexindent/LatexIndent/Special.pm
@@ -17,12 +17,12 @@ package LatexIndent::Special;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::IfElseFi qw/$ifElseFiBasicRegExp/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
+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
@@ -114,11 +114,11 @@ sub construct_special_begin {
# info to the log file
$logger->trace("*The special beginnings regexp is: (see specialBeginEnd)") if $is_tt_switch_active;
- $logger->trace($specialBegins) if $is_tt_switch_active;
+ $logger->trace($specialBegins) if $is_tt_switch_active;
# overall special regexp
$logger->trace("*The overall special regexp is: (see specialBeginEnd)") if $is_tt_switch_active;
- $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active;
+ $logger->trace($specialAllMatchesRegExp) if $is_tt_switch_active;
# basic special begin regexp
$specialBeginBasicRegExp = qr/$specialBegins/;
@@ -134,7 +134,7 @@ sub find_special {
# otherwise loop through the special begin/end
$logger->trace("*Searching ${$self}{name} for special begin/end (see specialBeginEnd)") if $is_t_switch_active;
- $logger->trace( Dumper( \%{ $mainSettings{specialBeginEnd} } ) ) if $is_tt_switch_active;
+ $logger->trace( Dumper( \%{ $mainSettings{specialBeginEnd} } ) ) if $is_tt_switch_active;
# keep looping as long as there is a special match of some kind
while ( ${$self}{body} =~ m/$specialAllMatchesRegExp/sx ) {
diff --git a/support/latexindent/LatexIndent/Switches.pm b/support/latexindent/LatexIndent/Switches.pm
index 858e351913..b7ff3b2998 100644
--- a/support/latexindent/LatexIndent/Switches.pm
+++ b/support/latexindent/LatexIndent/Switches.pm
@@ -34,7 +34,7 @@ sub store_switches {
my $self = shift;
# copy document switches into hash local to this module
- %switches = %{ ${$self}{switches} };
+ %switches = %{ ${$self}{switches} };
$switches{version} = defined $switches{vversion} ? 1 : $switches{version};
$is_m_switch_active = defined $switches{modifyLineBreaks} ? $switches{modifyLineBreaks} : 0;
$is_t_switch_active = defined $switches{trace} ? $switches{trace} : 0;
diff --git a/support/latexindent/LatexIndent/Tokens.pm b/support/latexindent/LatexIndent/Tokens.pm
index adea6481ab..6fbf008e12 100644
--- a/support/latexindent/LatexIndent/Tokens.pm
+++ b/support/latexindent/LatexIndent/Tokens.pm
@@ -17,9 +17,9 @@ package LatexIndent::Tokens;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use Exporter qw/import/;
+use Exporter qw/import/;
use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::LogFile qw/$logger/;
our @EXPORT_OK = qw/token_check %tokens/;
# each of the tokens begins the same way -- this is exploited during the hidden Children routine
diff --git a/support/latexindent/LatexIndent/TrailingComments.pm b/support/latexindent/LatexIndent/TrailingComments.pm
index 748d005f98..9d6532500a 100644
--- a/support/latexindent/LatexIndent/TrailingComments.pm
+++ b/support/latexindent/LatexIndent/TrailingComments.pm
@@ -17,10 +17,10 @@ package LatexIndent::TrailingComments;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::LogFile qw/$logger/;
use Data::Dumper;
use Exporter qw/import/;
our @EXPORT_OK
@@ -52,7 +52,7 @@ sub add_comment_symbol {
{ id => $tokens{trailingComment} . $commentCounter . $tokens{endOfToken}, value => $commentValue } );
# log file info
- $logger->trace("*Updating trailing comment array") if $is_t_switch_active;
+ $logger->trace("*Updating trailing comment array") if $is_t_switch_active;
$logger->trace( Dumper( \@trailingComments ), 'ttrace' ) if ($is_tt_switch_active);
# the returned value
diff --git a/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm b/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm
index bf7008a6b4..a42258bccc 100644
--- a/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm
+++ b/support/latexindent/LatexIndent/UnNamedGroupingBracesBrackets.pm
@@ -17,12 +17,12 @@ package LatexIndent::UnNamedGroupingBracesBrackets;
# For all communication, please visit: https://github.com/cmhughes/latexindent.pl
use strict;
use warnings;
-use LatexIndent::Tokens qw/%tokens/;
-use LatexIndent::GetYamlSettings qw/%mainSettings/;
+use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::GetYamlSettings qw/%mainSettings/;
use LatexIndent::TrailingComments qw/$trailingCommentRegExp/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use Exporter qw/import/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Command"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK
= qw/construct_unnamed_grouping_braces_brackets_regexp $un_named_grouping_braces_RegExp $un_named_grouping_braces_RegExp_trailing_comment/;
diff --git a/support/latexindent/LatexIndent/Verbatim.pm b/support/latexindent/LatexIndent/Verbatim.pm
index 8efbeaf877..984c081f59 100644
--- a/support/latexindent/LatexIndent/Verbatim.pm
+++ b/support/latexindent/LatexIndent/Verbatim.pm
@@ -18,11 +18,11 @@ package LatexIndent::Verbatim;
use strict;
use warnings;
use Data::Dumper;
-use Exporter qw/import/;
-use LatexIndent::Tokens qw/%tokens/;
+use Exporter qw/import/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::GetYamlSettings qw/%mainSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
our @EXPORT_OK
= qw/put_verbatim_back_in find_verbatim_environments find_noindent_block find_verbatim_commands find_verbatim_special verbatim_common_tasks %verbatimStorage/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
@@ -34,7 +34,7 @@ sub find_noindent_block {
# noindent block
$logger->trace('*Searching for NOINDENTBLOCK (see noIndentBlock)') if $is_t_switch_active;
- $logger->trace( Dumper( \%{ $mainSettings{noIndentBlock} } ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%{ $mainSettings{noIndentBlock} } ) ) if ($is_tt_switch_active);
while ( my ( $noIndentBlock, $yesno ) = each %{ $mainSettings{noIndentBlock} } ) {
# integrity check on the field for noIndentBlock
@@ -182,7 +182,7 @@ sub find_verbatim_environments {
# verbatim environments
$logger->trace('*Searching for VERBATIM environments (see verbatimEnvironments)') if $is_t_switch_active;
- $logger->trace( Dumper( \%{ $mainSettings{verbatimEnvironments} } ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%{ $mainSettings{verbatimEnvironments} } ) ) if ($is_tt_switch_active);
while ( my ( $verbEnv, $yesno ) = each %{ $mainSettings{verbatimEnvironments} } ) {
my $verbEnvSpec;
@@ -281,7 +281,7 @@ sub find_verbatim_commands {
# verbatim commands need to be put back in *after* trailing comments have been put
# back in
$logger->trace('*Searching for VERBATIM commands (see verbatimCommands)') if $is_t_switch_active;
- $logger->trace( Dumper( \%{ $mainSettings{verbatimCommands} } ) ) if ($is_tt_switch_active);
+ $logger->trace( Dumper( \%{ $mainSettings{verbatimCommands} } ) ) if ($is_tt_switch_active);
while ( my ( $verbCommand, $yesno ) = each %{ $mainSettings{verbatimCommands} } ) {
my $verbCommandSpec;
@@ -486,7 +486,7 @@ sub put_verbatim_back_in {
# count the number of non-command verbatim objects
while ( my ( $key, $child ) = each %verbatimStorage ) {
${$child}{type} = "environment" if !( defined ${$child}{type} );
- $verbatimCount++ if ( $toMatch =~ m/${$child}{type}/ );
+ $verbatimCount++ if ( $toMatch =~ m/${$child}{type}/ );
}
return unless ( $verbatimCount > 0 );
@@ -535,7 +535,7 @@ sub put_verbatim_back_in {
${$self}{body} =~ s/$verbatimID/${$child}{begin}${$child}{body}${$child}{end}/s;
# log file info
- $logger->trace('Body now looks like:') if $is_tt_switch_active;
+ $logger->trace('Body now looks like:') if $is_tt_switch_active;
$logger->trace( ${$self}{body}, 'ttrace' ) if ($is_tt_switch_active);
# delete the child so it won't be operated upon again
@@ -565,7 +565,7 @@ sub put_verbatim_back_in {
# logfile info
$logger->trace('*Post-processed body:') if $is_tt_switch_active;
- $logger->trace( ${$self}{body} ) if ($is_tt_switch_active);
+ $logger->trace( ${$self}{body} ) if ($is_tt_switch_active);
}
}
return;
diff --git a/support/latexindent/LatexIndent/Version.pm b/support/latexindent/LatexIndent/Version.pm
index eb1bfbe143..9b6fbc7272 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.22.2';
-our $versionDate = '2023-07-14';
+our $versionNumber = '3.23';
+our $versionDate = '2023-09-09';
1
diff --git a/support/latexindent/LatexIndent/Wrap.pm b/support/latexindent/LatexIndent/Wrap.pm
index 6b545c7e28..c7dbd09765 100644
--- a/support/latexindent/LatexIndent/Wrap.pm
+++ b/support/latexindent/LatexIndent/Wrap.pm
@@ -18,14 +18,14 @@ package LatexIndent::Wrap;
use strict;
use warnings;
use Text::Wrap;
-use LatexIndent::Tokens qw/%tokens/;
+use LatexIndent::Tokens qw/%tokens/;
use LatexIndent::AlignmentAtAmpersand qw/get_column_width/;
-use LatexIndent::TrailingComments qw/$trailingCommentRegExp @trailingComments/;
-use LatexIndent::GetYamlSettings qw/%mainSettings %previouslyFoundSettings/;
-use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
-use LatexIndent::LogFile qw/$logger/;
-use LatexIndent::Verbatim qw/%verbatimStorage/;
-use Exporter qw/import/;
+use LatexIndent::TrailingComments qw/$trailingCommentRegExp @trailingComments/;
+use LatexIndent::GetYamlSettings qw/%mainSettings %previouslyFoundSettings/;
+use LatexIndent::Switches qw/$is_t_switch_active $is_tt_switch_active $is_m_switch_active/;
+use LatexIndent::LogFile qw/$logger/;
+use LatexIndent::Verbatim qw/%verbatimStorage/;
+use Exporter qw/import/;
our @ISA = "LatexIndent::Document"; # class inheritance, Programming Perl, pg 321
our @EXPORT_OK = qw/text_wrap text_wrap_comment_blocks/;
our $sentenceCounter;
diff --git a/support/latexindent/README b/support/latexindent/README
index 79fd8335cc..c1db1e1f98 100644
--- a/support/latexindent/README
+++ b/support/latexindent/README
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- latexindent.pl, version 3.22.2, 2023-07-14
+ latexindent.pl, version 3.23, 2023-09-09
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 6f9cf5bee1..c99ddccff9 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 ad7b6618d8..d1cc7c7530 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 de0c1335ca..f55bf5202d 100644
--- a/support/latexindent/defaultSettings.yaml
+++ b/support/latexindent/defaultSettings.yaml
@@ -1,5 +1,5 @@
#
-# latexindent.pl, version 3.22.2, 2023-07-14
+# latexindent.pl, version 3.23, 2023-09-09
#
# defaultSettings.yaml, the default settings for latexindent.pl
#
@@ -525,6 +525,8 @@ modifyLineBreaks:
exclamationMark: 1 # 0/1
questionMark: 1 # 0/1
other: 0 # regex
+ sentencesDoNOTcontain:
+ other: \\begin # regex
textWrapOptions:
columns: 0
multipleSpacesToSingle: 1
@@ -559,11 +561,11 @@ modifyLineBreaks:
BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4
EndStartsOnOwnLine: 0 # -1,0,1,2,3,4
EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4
- equation*:
- BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4
- BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4
- EndStartsOnOwnLine: 0 # -1,0,1,2,3,4
- EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4
+ ## equation*:
+ ## BeginStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## EndStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## EndFinishesWithLineBreak: 0 # -1,0,1,2,3,4
ifElseFi:
IfStartsOnOwnLine: 0 # -1,0,1,2,3,4
BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4
@@ -573,15 +575,15 @@ modifyLineBreaks:
ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4
FiStartsOnOwnLine: 0 # -1,0,1,2,3,4
FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4
- ifnum:
- IfStartsOnOwnLine: 0 # -1,0,1,2,3,4
- BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4
- OrStartsOnOwnLine: 0 # -1,0,1,2,3,4
- OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4
- ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4
- ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4
- FiStartsOnOwnLine: 0 # -1,0,1,2,3,4
- FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4
+ ## ifnum:
+ ## IfStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## BodyStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## OrStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## OrFinishesWithLineBreak: 0 # -1,0,1,2,3,4
+ ## ElseStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## ElseFinishesWithLineBreak: 0 # -1,0,1,2,3,4
+ ## FiStartsOnOwnLine: 0 # -1,0,1,2,3,4
+ ## FiFinishesWithLineBreak: 0 # -1,0,1,2,3,4
commands:
CommandStartsOnOwnLine: 0
CommandNameFinishesWithLineBreak: 0
diff --git a/support/latexindent/documentation/latexindent-yaml-schema.json b/support/latexindent/documentation/latexindent-yaml-schema.json
index 356439255b..2419f3ed60 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.22.2 2023-07-14",
+ "description": "latexindent.pl YAML schema helper, V3.23 2023-09-09",
"type": "object",
"properties": {
"fileExtensionPreference": {
diff --git a/support/latexindent/documentation/latexindent.pdf b/support/latexindent/documentation/latexindent.pdf
index 7498187ea1..3ab061348e 100644
--- a/support/latexindent/documentation/latexindent.pdf
+++ b/support/latexindent/documentation/latexindent.pdf
Binary files differ
diff --git a/support/latexindent/documentation/latexindent.tex b/support/latexindent/documentation/latexindent.tex
index 309dc502a3..01202c8b8d 100644
--- a/support/latexindent/documentation/latexindent.tex
+++ b/support/latexindent/documentation/latexindent.tex
@@ -475,19 +475,19 @@
\lstdefinestyle{textWrapOptions}{
style=yaml-LST,
- firstnumber=528,linerange={528-529},
+ firstnumber=530,linerange={530-531},
numbers=left,
}
\lstdefinestyle{textWrapOptionsAll}{
style=yaml-LST,
- firstnumber=528,linerange={528-555},
+ firstnumber=530,linerange={530-557},
numbers=left,
}
\lstdefinestyle{oneSentencePerLine}{
style=yaml-LST,
- firstnumber=503,linerange={503-527},
+ firstnumber=503,linerange={503-529},
numbers=left,
}
@@ -509,21 +509,27 @@
numbers=left,
}
+\lstdefinestyle{sentencesDoNOTcontain}{
+ style=yaml-LST,
+ firstnumber=528,linerange={528-530},
+ numbers=left,
+}
+
\lstdefinestyle{modifylinebreaksEnv}{
style=yaml-LST,
- firstnumber=557,linerange={557-566},
+ firstnumber=559,linerange={559-568},
numbers=left,
}
\lstdefinestyle{replacements}{
style=yaml-LST,
- firstnumber=618,linerange={618-626},
+ firstnumber=620,linerange={620-628},
numbers=left,
}
\lstdefinestyle{fineTuning}{
style=yaml-LST,
- firstnumber=629,linerange={629-684},
+ firstnumber=631,linerange={631-686},
numbers=left,
}
@@ -5482,7 +5488,7 @@ latexindent.pl textwrap10.tex -o=+-mod2.tex -l=wrap-comments2.yaml -m
\index{regular expressions!lowercase alph a-z} \index{regular expressions!uppercase alph
A-Z}%
- \cmhlistingsfromfile[style=oneSentencePerLine]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{oneSentencePerLine}}{lst:oneSentencePerLine}
+ \cmhlistingsfromfile*[style=oneSentencePerLine]{../defaultSettings.yaml}[MLB-TCB,width=.85\linewidth,before=\centering]{\texttt{oneSentencePerLine}}{lst:oneSentencePerLine}
\subsubsection{oneSentencePerLine: overview}
An overview of how the oneSentencePerLine routine feature works:
@@ -5796,61 +5802,117 @@ latexindent.pl url -m -l=alt-full-stop1.yaml
the non-default settings in \cref{lst:alt-full-stop1-yaml}.
\end{example}
-\subsubsection{Features of the oneSentencePerLine routine}
- The sentence manipulation routine takes place \emph{after} verbatim \index{verbatim!in
- relation to oneSentencePerLine} environments, preamble and trailing comments have been
- accounted for; this means that any characters within these types of code blocks will not
- be part of the sentence manipulation routine.
+\subsubsection{oneSentencePerLine: sentencesDoNOTcontain}
+ You can specify patterns that sentences do \emph{not} contain using the field
+ \announce*{2023-09-09}{oneSentencePerLine: sentencesDoNOTcontain} in
+ \cref{lst:sentencesDoNOTcontain}.
+
+ \cmhlistingsfromfile*[style=sentencesDoNOTcontain]{../defaultSettings.yaml}[MLB-TCB,width=.9\linewidth,before=\centering]{\texttt{sentencesDoNOTcontain}}{lst:sentencesDoNOTcontain}
+ If sentences run across environments then, by default, they will \emph{not} be
+ considered a sentence by \texttt{latexindent.pl}. \announce*{2023-09-09}*{updated
+ example of oneSentencePerLine}
\begin{example}
- For example, if we begin with the \texttt{.tex} file in \cref{lst:multiple-sentences3},
+ For example, if we use the \texttt{.tex} file in \cref{lst:multiple-sentences4}
+
+ \cmhlistingsfromfile*{demonstrations/multiple-sentences4.tex}{\texttt{multiple-sentences4.tex}}{lst:multiple-sentences4}
+
and run the command \index{switches!-l demonstration} \index{switches!-m demonstration}
\begin{commandshell}
-latexindent.pl multiple-sentences3 -m -l=manipulate-sentences.yaml
+latexindent.pl multiple-sentences4 -m -l=manipulate-sentences.yaml
\end{commandshell}
- then we obtain the output in \cref{lst:multiple-sentences3-mod1}.
- \cmhlistingsfromfile{demonstrations/multiple-sentences3.tex}{\texttt{multiple-sentences3.tex}}{lst:multiple-sentences3}
- \cmhlistingsfromfile{demonstrations/multiple-sentences3-mod1.tex}{\texttt{multiple-sentences3.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences3-mod1}
+ then the output is unchanged, because the default value of
+ \texttt{sentencesDoNOTcontain} says, \emph{sentences do NOT contain}
+
+ This means that, by default, \texttt{latexindent.pl} does \emph{not} consider the file
+ in \cref{lst:multiple-sentences4} to have a sentence. \lstinline!\\begin!
\end{example}
\begin{example}
- Furthermore, if sentences run across environments then, by default, the line breaks
- internal to the sentence will be removed. For example, if we use the \texttt{.tex} file
- in \cref{lst:multiple-sentences4} and run the commands \index{switches!-l demonstration}
- \index{switches!-m demonstration}
+ We can customise the \texttt{sentencesDoNOTcontain} field with anything that we do
+ \emph{not} want sentences to contain.
+
+ We begin with the file in \cref{lst:sentence-dnc1}.
+
+ \cmhlistingsfromfile*{demonstrations/sentence-dnc1.tex}{\texttt{sentence-dnc1.tex}}{lst:sentence-dnc1}
+
+ Upon running the following commands
\begin{commandshell}
-latexindent.pl multiple-sentences4 -m -l=manipulate-sentences.yaml
-latexindent.pl multiple-sentences4 -m -l=keep-sen-line-breaks.yaml
+latexindent.pl sentence-dnc1.tex -m -l=dnc1.yaml
\end{commandshell}
- then we obtain the output in
- \cref{lst:multiple-sentences4-mod1,lst:multiple-sentences4-mod2}.
- \cmhlistingsfromfile{demonstrations/multiple-sentences4.tex}{\texttt{multiple-sentences4.tex}}{lst:multiple-sentences4}
- \begin{widepage}
- \cmhlistingsfromfile{demonstrations/multiple-sentences4-mod1.tex}{\texttt{multiple-sentences4.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences4-mod1}
- \end{widepage}
- \cmhlistingsfromfile{demonstrations/multiple-sentences4-mod2.tex}{\texttt{multiple-sentences4.tex} using \vref{lst:keep-sen-line-breaks-yaml}}{lst:multiple-sentences4-mod2}
+ then we obtain the output given in \cref{lst:sentence-dnc1-mod1}.
+
+ \begin{cmhtcbraster}[ raster left skip=-2.5cm,
+ raster right skip=-1cm,
+ raster force size=false,
+ raster column 1/.style={add to width=3cm},
+ ]
+ \cmhlistingsfromfile*{demonstrations/sentence-dnc1-mod1.tex}{\texttt{sentence-dnc1-mod1.tex}}{lst:sentence-dnc1-mod1}
+ \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/dnc1.yaml}[MLB-TCB,width=.45\textwidth]{\texttt{dnc1.yaml}}{lst:dnc1-yaml}
+ \end{cmhtcbraster}
+
+ The settings in \cref{lst:dnc1-yaml} say that sentences do \emph{not} contain
+ \lstinline!\begin! and that they do not contain \lstinline!\cmh!
\end{example}
\begin{example}
- Once you've read \cref{sec:poly-switches}, you will know that you can accommodate the
- removal of internal sentence line breaks by using the YAML in
- \cref{lst:item-rules2-yaml} and the command \index{switches!-l demonstration}
- \index{switches!-m demonstration}
+ We can implement case insensitivity for the \texttt{sentencesDoNOTcontain} field.
+
+ We begin with the file in \cref{lst:sentence-dnc2}.
+
+ \cmhlistingsfromfile*{demonstrations/sentence-dnc2.tex}{\texttt{sentence-dnc2.tex}}{lst:sentence-dnc2}
+
+ Upon running the following commands
\begin{commandshell}
-latexindent.pl multiple-sentences4 -m -l=item-rules2.yaml
+latexindent.pl sentence-dnc2.tex -m -l=dnc2.yaml
\end{commandshell}
- the output of which is shown in \cref{lst:multiple-sentences4-mod3}.
+ then we obtain the output given in \cref{lst:sentence-dnc2-mod2}.
- \begin{cmhtcbraster}
- \cmhlistingsfromfile{demonstrations/multiple-sentences4-mod3.tex}{\texttt{multiple-sentences4.tex} using \cref{lst:item-rules2-yaml}}{lst:multiple-sentences4-mod3}
- \cmhlistingsfromfile[style=yaml-LST]{demonstrations/item-rules2.yaml}[MLB-TCB]{\texttt{item-rules2.yaml}}{lst:item-rules2-yaml}
+ \begin{cmhtcbraster}[ raster left skip=-2.5cm,
+ raster right skip=-1cm,
+ raster force size=false,
+ raster column 1/.style={add to width=3cm},
+ ]
+ \cmhlistingsfromfile*{demonstrations/sentence-dnc2-mod2.tex}{\texttt{sentence-dnc2-mod2.tex}}{lst:sentence-dnc2-mod2}
+ \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/dnc2.yaml}[MLB-TCB,width=.45\textwidth]{\texttt{dnc2.yaml}}{lst:dnc2-yaml}
\end{cmhtcbraster}
+
+ The settings in \cref{lst:dnc2-yaml} say that sentences do \emph{not} contain
+ \lstinline!\begin! and that they do not contain \emph{case insensitive} versions of
+ \lstinline!\cmh!
+ \end{example}
+ \begin{example}
+ We can turn off \texttt{sentenceDoNOTcontain} by setting it to \texttt{0} as in
+ \cref{lst:dnc-off-yaml}.
+
+ \cmhlistingsfromfile*[style=yaml-LST]{demonstrations/dnc-off.yaml}[MLB-TCB,width=.45\textwidth]{\texttt{dnc-off.yaml}}{lst:dnc-off-yaml}
+
+ The settings in \cref{lst:dnc-off-yaml} mean that sentences can contain any character.
+ \end{example}
+
+\subsubsection{Features of the oneSentencePerLine routine}
+ The sentence manipulation routine takes place \emph{after} verbatim \index{verbatim!in
+ relation to oneSentencePerLine} environments, preamble and trailing comments have been
+ accounted for; this means that any characters within these types of code blocks will not
+ be part of the sentence manipulation routine.
+
+ \begin{example}
+ For example, if we begin with the \texttt{.tex} file in \cref{lst:multiple-sentences3},
+ and run the command \index{switches!-l demonstration} \index{switches!-m demonstration}
+
+ \begin{commandshell}
+latexindent.pl multiple-sentences3 -m -l=manipulate-sentences.yaml
+\end{commandshell}
+
+ then we obtain the output in \cref{lst:multiple-sentences3-mod1}.
+ \cmhlistingsfromfile{demonstrations/multiple-sentences3.tex}{\texttt{multiple-sentences3.tex}}{lst:multiple-sentences3}
+ \cmhlistingsfromfile{demonstrations/multiple-sentences3-mod1.tex}{\texttt{multiple-sentences3.tex} using \vref{lst:manipulate-sentences-yaml}}{lst:multiple-sentences3-mod1}
\end{example}
\subsubsection{oneSentencePerLine: text wrapping and indenting sentences}
@@ -6049,24 +6111,24 @@ latexindent.pl multiple-sentences9 -o=+-mod1.tex -l=sentence-wrap4 -m
\index{poly-switches!off by default: set to 0}
\begin{description}
\item[$-1$] \emph{remove mode}: line breaks before or after the
- \emph{<part of thing>} can be removed (assuming that \texttt{preserveBlankLines} is
- set to \texttt{0});
+ \emph{<part of thing>} can be removed (assuming that \texttt{preserveBlankLines} is
+ set to \texttt{0});
\item[0] \emph{off mode}: line breaks will not be modified for the
- \emph{<part of thing>} under consideration;
+ \emph{<part of thing>} under consideration;
\item[1] \emph{add mode}: a line break will be added before or after the
- \emph{<part of thing>} under consideration, assuming that
- there is not already a line break before or after the \emph{<part of thing>};
+ \emph{<part of thing>} under consideration, assuming that
+ there is not already a line break before or after the \emph{<part of thing>};
\item[2] \emph{comment then add mode}: a comment symbol will be added, followed by a line break
- before or after the \emph{<part of thing>} under consideration, assuming that there is
- not already a comment and line break before or after the \emph{<part of thing>};
+ before or after the \emph{<part of thing>} under consideration, assuming that there is
+ not already a comment and line break before or after the \emph{<part of thing>};
\item[3] \emph{add then blank line mode}%
- \announce{2017-08-21}{blank line poly-switch}: a line break will be added before or after
- the \emph{<part of thing>} under consideration, assuming that there is not already a line
- break before or after the \emph{<part of thing>}, followed by a blank line;
+ \announce{2017-08-21}{blank line poly-switch}: a line break will be added before or after
+ the \emph{<part of thing>} under consideration, assuming that there is not already a line
+ break before or after the \emph{<part of thing>}, followed by a blank line;
\item[4] \emph{add blank line mode}%
- \announce{2019-07-13}{blank line poly-switch}; a blank line will
- be added before or after the \emph{<part of thing>} under consideration, even if the
- \emph{<part of thing>} is already on its own line.
+ \announce{2019-07-13}{blank line poly-switch}; a blank line will
+ be added before or after the \emph{<part of thing>} under consideration, even if the
+ \emph{<part of thing>} is already on its own line.
\end{description}
In the above, \emph{<part of thing>} refers to either the \emph{begin statement},
\emph{body} or \emph{end statement} of the code blocks detailed in
@@ -8259,11 +8321,11 @@ latexindent.pl bib2.bib -l bibsettings1.yaml,bibsettings2.yaml -o=+-mod2
\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}
+ 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}
+ \cmhlistingsfromfile{demonstrations/finetuning5.tex}{\texttt{finetuning5.tex}}{lst:finetuning5}
Using the settings in \cref{lst:fine-tuning3} and running the command
@@ -8274,8 +8336,8 @@ latexindent.pl finetuning5.tex -l=fine-tuning3.yaml
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}
+ \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
diff --git a/support/latexindent/latexindent.pl b/support/latexindent/latexindent.pl
index 61ee1131b4..571dbcbd26 100755
--- a/support/latexindent/latexindent.pl
+++ b/support/latexindent/latexindent.pl
@@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
-# latexindent.pl, version 3.22.2, 2023-07-14
+# latexindent.pl, version 3.23, 2023-09-09
#
# 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