diff --git a/.gitignore b/.gitignore index 47966e4..8e281ca 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ latexdiff.tex latexrevise.aux latexrevise.tex latexdiff-1.0.5a +dist + diff --git a/latexdiff b/latexdiff index fe7bcd4..895eb28 100755 --- a/latexdiff +++ b/latexdiff @@ -556,10 +556,18 @@ push(@SAFECMDLIST, qr/^QLEFTBRACE$/, qr/^QRIGHTBRACE$/); ### my $pat5 = '(?:[^{}]|\\\{|\\\}|\{'.$pat4.'\})*'; ### my $pat6 = '(?:[^{}]|\\\{|\\\}|\{'.$pat5.'\})*'; ### 0.6: Use preprocessing to suppress \{ and \}, so no longer need to account for this in patterns +### my $pat0 = '(?:[^{}])*'; +### my $pat1 = '(?:[^{}]|\{'.$pat0.'\})*'; +### my $pat2 = '(?:[^{}]|\{'.$pat1.'\})*'; +### my $pat3 = '(?:[^{}]|\{'.$pat2.'\})*'; +### my $pat4 = '(?:[^{}]|\{'.$pat3.'\})*'; +### my $pat5 = '(?:[^{}]|\{'.$pat4.'\})*'; +### my $pat6 = '(?:[^{}]|\{'.$pat5.'\})*'; + my $pat0 = '(?:[^{}])*'; my $pat_n = $pat0; -# if you get "undefined control sequence MATHBLOCKmath" error, inclease this loop - for (my $i_pat = 0; $i_pat < 100; ++$i_pat){ +# if you get "undefined control sequence MATHBLOCKmath" error, increase the maximum value in this loop + for (my $i_pat = 0; $i_pat < 20; ++$i_pat){ $pat_n = '(?:[^{}]|\{'.$pat_n.'\})*'; } diff --git a/testsuite/complicated-math-new.tex b/testsuite/complicated-math-new.tex new file mode 100644 index 0000000..926bae6 --- /dev/null +++ b/testsuite/complicated-math-new.tex @@ -0,0 +1,33 @@ +\documentclass{article} + +\usepackage{amsmath, amssymb} + +\usepackage{bm} + +\newcommand{\inprod}[2]{\ensuremath{#1 \cdot #2}} +\newcommand{\dd}[1]{\ensuremath{d#1\,}} +\newcommand{\pr}[1]{\left(#1\right)} +\newcommand{\tr}[1]{\ensuremath{\,{}^{t}\!#1}} +\DeclareMathOperator{\erf}{erf} + +\newcommand{\Kst}{\ensuremath{\bm{K}}} +\newcommand{\hyper}{\ensuremath{\bm{\rho}}} + +\begin{document} + +\begin{equation} + \label{eq:34} + p_{\mathrm{cut}}\pr{\bm{a} \mid \hyper, m_{\mathrm{low}}, m_{\mathrm{high}}, \bm{r}} + =0+ + \frac{ + 2p\pr{\bm{a} \mid \hyper} + H\pr{\inprod{\bm{r}}{\bm{a}} - m_{\mathrm{down}}} + H\pr{m_{\mathrm{up}} - \inprod{\bm{r}}{\bm{a}}} + }{ + \erf{\pr{m_{\mathrm{high}}/\sqrt{2\tr{\bm{r}}\Kst^{-1}\bm{r}}}} + - + \erf{\pr{m_{\mathrm{low}}/\sqrt{2\tr{\bm{r}}\Kst^{-1}\bm{r}}}} + } +\end{equation} +\end{document} + diff --git a/testsuite/complicated-math-old.tex b/testsuite/complicated-math-old.tex new file mode 100644 index 0000000..e82aeff --- /dev/null +++ b/testsuite/complicated-math-old.tex @@ -0,0 +1,33 @@ +\documentclass{article} + +\usepackage{amsmath, amssymb} + +\usepackage{bm} + +\newcommand{\inprod}[2]{\ensuremath{#1 \cdot #2}} +\newcommand{\dd}[1]{\ensuremath{d#1\,}} +\newcommand{\pr}[1]{\left(#1\right)} +\newcommand{\tr}[1]{\ensuremath{\,{}^{t}\!#1}} +\DeclareMathOperator{\erf}{erf} + +\newcommand{\Kst}{\ensuremath{\bm{K}}} +\newcommand{\hyper}{\ensuremath{\bm{\rho}}} + +\begin{document} + +\begin{equation} + \label{eq:34} + p_{\mathrm{cut}}\pr{\bm{a} \mid \hyper, m_{\mathrm{low}}, m_{\mathrm{high}}, \bm{r}} + = + \frac{ + 2p\pr{\bm{a} \mid \hyper} + H\pr{\inprod{\bm{r}}{\bm{a}} - m_{\mathrm{low}}} + H\pr{m_{\mathrm{high}} - \inprod{\bm{r}}{\bm{a}}} + }{ + \erf{\pr{m_{\mathrm{high}}/\sqrt{2\tr{\bm{r}}\Kst^{-1}\bm{r}}}} + - + \erf{\pr{m_{\mathrm{low}}/\sqrt{2\tr{\bm{r}}\Kst^{-1}\bm{r}}}} + } +\end{equation} +\end{document} + diff --git a/testsuite/verify b/testsuite/verify index 08b0bad..4ac92ee 100755 --- a/testsuite/verify +++ b/testsuite/verify @@ -17,7 +17,7 @@ set testroots=( test rapine_et_al island_obs2004 texdiffsample gershwin12 gershw delequ latin9 pollack move-equation nomarkup subscript doubledollar \ DIFDELCMDBUG eqnarray subscriptm delequ2 schneider gennady umesh underwood endfloat outerrise \ delequ3 delequ4 "simplefrac --allow-spaces" "master --flatten" titlediffTest2 exampleDiff bornd2 \ -"rolla --math-markup=2" mini "complex-maths --math-markup=1" margalit circonflex mwe-comment "apacite-test --flatten" quoteddollarunderscore units \ +"rolla --math-markup=2" mini "complex-maths --math-markup=1" margalit circonflex mwe-comment "apacite-test --flatten" quoteddollarunderscore units complicated-math \ ) #set testroots= ( test subscript )