--- runfiles/texmf-dist/scripts/latex2man/latex2man.orig 2017-08-06 21:56:45.722169852 -0400 +++ runfiles/texmf-dist/scripts/latex2man/latex2man 2017-08-06 22:02:41.815668681 -0400 @@ -1324,7 +1324,7 @@ last SWITCH; }; # LaTeX macros with two arguments - /\\([a-zA-Z]+){([^}]*)}{([^}]*)}/ + /\\([a-zA-Z]+)\{([^}]*)}\{([^}]*)}/ && do {$s=$`;$m=$1;$a1=$2;$a2=$3;$r=$'; #' check_Macro2 $m; interpret_word $s; @@ -1338,7 +1338,7 @@ last SWITCH; }; # Special Handling of Email and URL LaTeX macros with one argument - /\\(URL|Email){([^}]*)}/ && ($opt_H) + /\\(URL|Email)\{([^}]*)}/ && ($opt_H) && do {$s=$`;$m=$1;$a1=$2;$r=$'; #' interpret_word $s; PrintM $Macro2a->{$m}; @@ -1351,7 +1351,7 @@ last SWITCH; }; # LaTeX macros with one argument - /\\([a-zA-Z]+){([^}]*)}/ && do {$s=$`;$m=$1;$a1=$2;$r=$'; #' + /\\([a-zA-Z]+)\{([^}]*)}/ && do {$s=$`;$m=$1;$a1=$2;$r=$'; #' check_Macro1 $m; interpret_word $s; PrintM $Macro1a->{$m}; @@ -1518,7 +1518,7 @@ $join = $cnt % 2 != 0; $kind = 3; } else { - my @x = $_ =~ /[^\\]{/g; + my @x = $_ =~ /[^\\]\{/g; my @y = $_ =~ /[^\\]}/g; $join = $#x != $#y; $kind = 2; @@ -1679,7 +1679,7 @@ my $line = $_; chop $line; print "--- \`$line'\n"; } - if (/^\s*\\input{([^}]*)}\s*/) { + if (/^\s*\\input\{([^}]*)}\s*/) { # handle \input{fn} my $fn = $1; printf DEST "%%%%%%%%%%%%%%%%%% start of \\input{%s}\n", $fn; @@ -1731,7 +1731,7 @@ my $line = $_; chop $line; print "--- \`$line'\n"; } - if (/^\s*\\input{([^}]*)}\s*/) { + if (/^\s*\\input\{([^}]*)}\s*/) { # handle \input{fn} my $fn = $1; if ($opt_M) { @@ -1760,7 +1760,7 @@ next if ($skip[-1] == 1); if ($inside_verb) { - if (/^\s*\\end{verbatim}/) { + if (/^\s*\\end\{verbatim}/) { if ($started == 1) { &{$Prefix . "VerbatimEnd"}; $inside_verb = 0; @@ -1789,19 +1789,19 @@ $rcs_date,$rcs_time,$rcs_owner,$rcs_status,$rcs_locker) = split(/\s/,$1); $date = date2str ($rcs_date); $Macro->{'today'} = $date; - } elsif (/^\s*\\setDate{\\rcsInfoLongDate}/) { + } elsif (/^\s*\\setDate\{\\rcsInfoLongDate}/) { $Macro->{'Date'} = $date; - } elsif (/^\s*\\setDate{\\today}/) { + } elsif (/^\s*\\setDate\{\\today}/) { $Macro->{'Date'} = $date; - } elsif (/^\s*\\setDate{([^}]*)}/) { + } elsif (/^\s*\\setDate\{([^}]*)}/) { $date = $1; $date =~ s/~/$Macro->{'~'}/g; $Macro->{'Date'} = $date; - } elsif (/^\s*\\setVersion{([^}]*)}/) { + } elsif (/^\s*\\setVersion\{([^}]*)}/) { $version = $1; $versin =~ s/~/$Macro->{'~'}/g; $Macro->{'Version'} = $version; - } elsif (/^\s*\\begin{Name}{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}/) { + } elsif (/^\s*\\begin\{Name}\{([^}]*)}\{([^}]*)}\{([^}]*)}\{([^}]*)}\{([^}]*)}/) { $section = "Name"; $chapter = $1; $name = $2; @@ -1815,9 +1815,9 @@ $section_cnt = 0; &{$Prefix . "Start"} ($name, $chapter, $author, $tool, $title); &{$Prefix . "NameStart"} ($name, $chapter, $author, $tool, $title); - } elsif (/^\s*\\end{Name}/) { + } elsif (/^\s*\\end\{Name}/) { &{$Prefix . "NameEnd"} ($name, $chapter, $author, $tool); - } elsif (/^\s*\\begin{Table}(\[([^]]*)\])?{([^}]*)}/) { + } elsif (/^\s*\\begin\{Table}(\[([^]]*)\])?\{([^}]*)}/) { # \begin{Table}[width]{columns} if ($started == 1) { $columns = $3; @@ -1826,74 +1826,74 @@ $first_column = 1; &{$Prefix . "TableStart"} ($columns, $2); } - } elsif (/^\s*\\end{Table}/) { + } elsif (/^\s*\\end\{Table}/) { if ($started == 1) { $inside_table = 0; $first_column = 0; &{$Prefix . "TableEnd"} ($columns); } - } elsif (/^\s*\\begin{Description}(\[[^]]*\])?/) { + } elsif (/^\s*\\begin\{Description}(\[[^]]*\])?/) { if ($started == 1) { $list_nest++; $cur_list[$list_nest] = 'descr'; $item_nr[$list_nest] = 0; &{$Prefix . "DescriptionStart"}; } - } elsif (/^\s*\\end{Description}/) { + } elsif (/^\s*\\end\{Description}/) { if ($started == 1) { &{$Prefix . "DescriptionEnd"}; $list_nest--; } - } elsif (/^\s*\\begin{description}/) { + } elsif (/^\s*\\begin\{description}/) { if ($started == 1) { $list_nest++; $cur_list[$list_nest] = 'descr'; $item_nr[$list_nest] = 0; &{$Prefix . "DescriptionStart"}; } - } elsif (/^\s*\\end{description}/) { + } elsif (/^\s*\\end\{description}/) { if ($started == 1) { &{$Prefix . "DescriptionEnd"}; $list_nest--; } - } elsif (/^\s*\\begin{center}/) { + } elsif (/^\s*\\begin\{center}/) { if ($started == 1) { &{$Prefix . "CenterStart"}; } - } elsif (/^\s*\\end{center}/) { + } elsif (/^\s*\\end\{center}/) { if ($started == 1) { &{$Prefix . "CenterEnd"}; } - } elsif (/^\s*\\begin{enumerate}/) { + } elsif (/^\s*\\begin\{enumerate}/) { if ($started == 1) { $list_nest++; $cur_list[$list_nest] = 'enum'; $item_nr[$list_nest] = 0; &{$Prefix . "EnumStart"} ; } - } elsif (/^\s*\\end{enumerate}/) { + } elsif (/^\s*\\end\{enumerate}/) { if ($started == 1) { &{$Prefix . "EnumEnd"} ; $list_nest--; } - } elsif (/^\s*\\begin{itemize}/) { + } elsif (/^\s*\\begin\{itemize}/) { if ($started == 1) { $list_nest++; $cur_list[$list_nest] = 'item'; $item_nr[$list_nest] = 0; &{$Prefix . "ItemStart"} ; } - } elsif (/^\s*\\end{itemize}/) { + } elsif (/^\s*\\end\{itemize}/) { if ($started == 1) { &{$Prefix . "ItemEnd"} ; $list_nest--; } - } elsif (/^\s*\\begin{verbatim}/) { + } elsif (/^\s*\\begin\{verbatim}/) { if ($started == 1) { &{$Prefix . "VerbatimStart"}; $inside_verb = 1; } - } elsif (/^\s*\\(subsubsection|subsection|section){([^}]*)}/) { + } elsif (/^\s*\\(subsubsection|subsection|section)\{([^}]*)}/) { $kind = $1; $section = $2; $section_cnt ++; @@ -1904,7 +1904,7 @@ } } elsif (/^\s*\\LatexManEnd/) { last; - } elsif (/^\s*((\\begin{Name|Table|Description})|(\\(sub)?section))/) { + } elsif (/^\s*((\\begin\{Name|Table|Description})|(\\(sub)?section))/) { die "$CMD: in line $.\n " . "Arguments of $1 are not contained in a single " . "line.\n " .