100 lines
6.3 KiB
Plaintext
100 lines
6.3 KiB
Plaintext
|
From cfe445c4bff997cdc59979a89da8362cbf403e75 Mon Sep 17 00:00:00 2001
|
||
|
From: Frederik Tilmann <ftilmann@zedat.fu-berlin.de>
|
||
|
Date: Sat, 17 Sep 2016 22:21:08 +0200
|
||
|
Subject: [PATCH] Removed some more unescaped left braces (which triggered
|
||
|
depracation warnings)
|
||
|
|
||
|
From a83d9cb865fd0d8ba83ae97ce567035d96b015c7 Mon Sep 17 00:00:00 2001
|
||
|
From: Frederik Tilmann <ftilmann@zedat.fu-berlin.de>
|
||
|
Date: Tue, 11 Oct 2016 01:01:46 +0200
|
||
|
Subject: [PATCH] Fix further unescaped left brace warnings; fixes issue #61
|
||
|
|
||
|
---
|
||
|
texmf-dist/scripts/latexdiff/latexdiff.pl | 26 +++++++++++++-------------
|
||
|
1 file changed, 13 insertions(+), 13 deletions(-)
|
||
|
|
||
|
--- texmf-dist/scripts/latexdiff/latexdiff.pl
|
||
|
+++ texmf-dist/scripts/latexdiff/latexdiff.pl 2017-06-13 14:00:41.712076413 +0000
|
||
|
@@ -2255,15 +2255,15 @@ sub marktags {
|
||
|
sub take_comments_and_enter_from_frac() {
|
||
|
###*************take the \n and % between frac and {}***********
|
||
|
###notice all of the substitution are made none global
|
||
|
- while( m/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\frac(([\s]*%[^\n]*?)*[\r\n|\r|\n])+\{(.*?)\\end{\1}/s ) {
|
||
|
+ while( m/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\frac(([\s]*%[^\n]*?)*[\r\n|\r|\n])+\{(.*?)\\end\{\1}/s ) {
|
||
|
### if there isn't any % or \n in the pattern $2 then there should be an \\end{...} in $2
|
||
|
- if( $2 !~ m/\\end{$1}/s ) {
|
||
|
+ if( $2 !~ m/\\end\{$1}/s ) {
|
||
|
### take out % and \n from the next match only (none global)
|
||
|
- s/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\frac(([\s]*%[^\n]*?)*[\r\n|\r|\n])+\{(.*?)\\end{\1}/\\begin{$1}$2\\frac{$5\\end{$1}/s;
|
||
|
+ s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\frac(([\s]*%[^\n]*?)*[\r\n|\r|\n])+\{(.*?)\\end\{\1}/\\begin{$1}$2\\frac{$5\\end{$1}/s;
|
||
|
}
|
||
|
else{
|
||
|
###there are no more % and \n in $2, we want to find the next one so we clear the begin-end from the pattern
|
||
|
- s/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end{\1}/MATHBLOCK$1$2MATHBLOCKEND/s;
|
||
|
+ s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end\{\1}/MATHBLOCK$1$2MATHBLOCKEND/s;
|
||
|
}
|
||
|
}
|
||
|
###cleaning up
|
||
|
@@ -2277,18 +2277,18 @@ sub take_comments_and_enter_from_frac()
|
||
|
### from now on CURRFRAC is the frac we are looking at
|
||
|
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)\\frac\{(.*?)\\end\{\1\}/\\begin\{$1\}$2CURRFRAC\{$3\\end\{$1\}/s;
|
||
|
while( m/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)CURRFRAC\{(.*?)\\end\{\1\}/s ) {
|
||
|
- if( m/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)CURRFRAC\{($pat_n)\}([\s]*(%[^\n]*?)*[\r\n|\r|\n])+[\s]*\{(.*?)\\end{\1}/s ) {
|
||
|
+ if( m/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)CURRFRAC\{($pat_n)\}([\s]*(%[^\n]*?)*[\r\n|\r|\n])+[\s]*\{(.*?)\\end\{\1}/s ) {
|
||
|
s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)\}(.*?)CURRFRAC\{($pat_n)\}([\s]*(%[^\n]*?)*[\r\n|\r|\n])+[\s]*\{(.*?)\\end\{\1\}/\\begin\{$1\}$2CURRFRAC\{$3\}\{$6\\end\{$1\}/s;
|
||
|
}
|
||
|
else { # there is no comment or \n between the two brackets {}{}
|
||
|
### change CURRFRAC to FRACSTART so we can change them all back to //frac{ when we finish
|
||
|
- s/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)CURRFRAC\{(.*?)\\end{\1}/\\begin{$1}$2FRACSTART\{$3\\end{$1}/s;
|
||
|
+ s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)CURRFRAC\{(.*?)\\end\{\1}/\\begin{$1}$2FRACSTART\{$3\\end{$1}/s;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
else{
|
||
|
###there are no more frac in $2, we want to find the next one so we clear the begin-end from the pattern
|
||
|
- s/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end{\1}/MATHBLOCK$1$2MATHBLOCKEND/s;
|
||
|
+ s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end\{\1}/MATHBLOCK$1$2MATHBLOCKEND/s;
|
||
|
}
|
||
|
|
||
|
}
|
||
|
@@ -2351,16 +2351,16 @@ sub preprocess {
|
||
|
s/(?<!\\)\\\[/\\begin{SQUAREBRACKET}/sg;
|
||
|
s/\\\]/\\end{SQUAREBRACKET}/sg;
|
||
|
# Convert all picture environmentent (\begin{PICTUREENV} .. \end{PICTUREENV} \PICTUREBLOCKenv
|
||
|
- s/\\begin{($PICTUREENV)}(.*?)\\end{\1}/\\PICTUREBLOCK$1\{$2\}/sg;
|
||
|
+ s/\\begin\{($PICTUREENV)}(.*?)\\end\{\1}/\\PICTUREBLOCK$1\{$2\}/sg;
|
||
|
# For --block-math-markup option -convert all \begin{MATH} .. \end{MATH}
|
||
|
# into \MATHBLOCKMATH{...} commands, where MATH is any valid math environment
|
||
|
# Also convert all array environments into ARRAYBLOCK environments
|
||
|
if ( $mathmarkup != FINE ) {
|
||
|
- s/\\begin{($ARRENV)}(.*?)\\end{\1}/\\ARRAYBLOCK$1\{$2\}/sg;
|
||
|
+ s/\\begin\{($ARRENV)}(.*?)\\end\{\1}/\\ARRAYBLOCK$1\{$2\}/sg;
|
||
|
|
||
|
take_comments_and_enter_from_frac();
|
||
|
|
||
|
- s/\\begin{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end{\1}/\\MATHBLOCK$1\{$2\}/sg;
|
||
|
+ s/\\begin\{($MATHENV|$MATHARRENV|SQUAREBRACKET)}(.*?)\\end\{\1}/\\MATHBLOCK$1\{$2\}/sg;
|
||
|
}
|
||
|
# add final token " STOP"
|
||
|
$_ .= " STOP"
|
||
|
@@ -2646,8 +2646,8 @@ sub postprocess {
|
||
|
# environments) are between the \begin{$MATHENV} and \end{MATHMODE} commands. This is necessary as the minimal matching
|
||
|
# is not globally minimal but only 'locally' (matching is beginning from the left side of the string)
|
||
|
if ( $mathmarkup == FINE ) {
|
||
|
- 1 while s/\\begin{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}((?:.(?!(?:\\end{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}|\\begin{MATHMODE})))*?)\\end{MATHMODE}/\\begin{$1}$2\\end{$1}/s;
|
||
|
- 1 while s/\\begin{MATHMODE}((?:.(?!\\end{MATHMODE}))*?)\\end{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)}/\\begin{$2}$1\\end{$2}/s;
|
||
|
+ 1 while s/\\begin\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)\}((?:.(?!(?:\\end\{(?:(?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)\}|\\begin\{MATHMODE\})))*?)\\end\{MATHMODE\}/\\begin{$1}$2\\end{$1}/s;
|
||
|
+ 1 while s/\\begin\{MATHMODE\}((?:.(?!\\end\{MATHMODE\}))*?)\\end\{((?:$MATHENV)|(?:$MATHARRENV)|SQUAREBRACKET)\}/\\begin{$2}$1\\end{$2}/s;
|
||
|
# convert remaining \begin{MATHMODE} \end{MATHMODE} (and not containing & or \\ )into MATHREPL environments
|
||
|
s/\\begin\{MATHMODE\}((?:(.(?!(?<!\\)\&|\\\\))*)?)\\end\{MATHMODE\}/\\begin{$MATHREPL}$1\\end{$MATHREPL}/sg;
|
||
|
# others into MATHARRREPL
|
||
|
@@ -4430,7 +4430,7 @@ institute
|
||
|
\providecommand{\DIFaddend}{\protect\marginpar{]}}
|
||
|
\providecommand{\DIFdelbegin}{\protect\marginpar{d[}}
|
||
|
\providecommand{\DIFdelend}{\protect\marginpar{]}}
|
||
|
-%DIF END BRACKET PREAMBLE
|
||
|
+%DIF END MARGIN PREAMBLE
|
||
|
|
||
|
%DIF DVIPSCOL PREAMBLE
|
||
|
%Note: only works with dvips converter
|