Hi Cham,
very good minimal example!
That glitch only occurs because of the manually inserted space of 8pt. The first line is made higher, the second line is made higher, the last one isn't. Somehow we got an asymmetry. If you omit this, it's still perfectly centered.
We can stretch it in another way. One way is redefining
cases
in order to get it stretched, such as by
\arraystretch
. I did this
in my blog some time ago. This introduces an optional argument for stretching:
Code: Select all
\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{tensor}
\usepackage{pifont}
\makeatletter
\renewcommand*\env@cases[1][1.2]{%
\let\@ifnextchar\new@ifnextchar
\left\lbrace
\def\arraystretch{#1}%
\array{@{}l@{\quad}l@{}}%
}
\makeatother
\begin{document}
\begin{equation*}
\delta(x) \; \Rightarrow \; \tensor{\delta}{_{\varepsilon}}(x) =
\begin{cases}[2]
0, &\text{if $x < -\, \varepsilon$.} \\%[8pt]
\dfrac{1}{2 \varepsilon\strut},
&\text{if $-\, \varepsilon < x < \varepsilon$.} \\%[8pt]
0, &\text{if $x > \varepsilon$.}
\end{cases}
\end{equation*}
\end{document}
You may notice that all is stretched, so the brace is higher too.
Another way is adding an invisible line (0pt wide) that is vertically centered, in the middle line. So
\vcenter{\rule{0pt}{8ex}}
it preserves the centering:
Code: Select all
\documentclass[12pt,letterpaper,twoside]{book}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{tensor}
\usepackage{pifont}
\begin{document}
\begin{equation*}
\delta(x) \; \Rightarrow \; \tensor{\delta}{_{\varepsilon}}(x) =
\begin{cases}
0, &\text{if $x < -\, \varepsilon$.} \\
\dfrac{1}{2 \varepsilon\strut},
&\text{if $-\, \varepsilon < x < \varepsilon$.}
\vcenter{\rule{0pt}{8ex}}\\
0, &\text{if $x > \varepsilon$.}
\end{cases}
\end{equation*}
\end{document}
Stefan