Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
ftilmann committed Dec 11, 2015
1 parent f0914be commit ac107dd
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ latexdiff.tex
latexrevise.aux
latexrevise.tex
latexdiff-1.0.5a
dist

12 changes: 10 additions & 2 deletions latexdiff
Original file line number Diff line number Diff line change
Expand Up @@ -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.'\})*';
}

Expand Down
33 changes: 33 additions & 0 deletions testsuite/complicated-math-new.tex
Original file line number Diff line number Diff line change
@@ -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}

33 changes: 33 additions & 0 deletions testsuite/complicated-math-old.tex
Original file line number Diff line number Diff line change
@@ -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}

2 changes: 1 addition & 1 deletion testsuite/verify
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit ac107dd

Please sign in to comment.