You are on page 1of 10

Mc trn di v gi lnh oubraces.

sty
Nguyn Hu in
Khoa Ton - C - Tin hc
HKHTN H Ni, HQGHN

Mc trn di trong VieTeX

Thanh th ba cha mc tn v mc di nh hnh s dng chnh xc cc mc

ny ta xt cc v d sau

Cc mc trn v di c trong LATEX

1. l hai lnh rt hay c dng \overbrace v \underbrace nh


$$\overbrace {a_1+a_2+\underbrace {\cdots}+a_n}$$
z
}|
{
a1 + a2 + |{z}
+an
2. Vi du nh lm ch s cho phn ch thch ca du mc
$$\underbrace {a_1+a_2+\overbrace {\cdots}^{n-3}+a_n}_{n}$$
n3

z}|{
a1 + a2 + +an
|
{z
}
n

3. Dng nhiu dng ch thch dng \substack{}


1

http://nhdien.wordpress.com - Nguyn Hu in

$$
\underbrace{a_{ki}+b_{ik}}_{\substack{0\le k\le n\\ 0\le i\le m}}
\qquad
\overbrace{a_{ki}+b_{ik}}^{\substack{0\le k\le n\\ 0\le i\le m}}
0kn
0im

aki + bik
| {z }

z }| {
aki + bik

0kn
0im

4. Lnh c tc dng trong cc lnh dng cng thc v kt hp gii thch


\begin{align*}
Y_n
&= \dfrac {\sqrt{n}}{\sigma \vert f(\mu) \vert}
(X_n-\mu)[g(X_n)+f(\mu)]\\
&= \dfrac {\sqrt{n}}{\sigma \vert f(\mu) \vert}(X_n-\mu)g(X_n)+
\dfrac {\sqrt{n}}{\sigma \vert f(\mu) \vert}(X_n-\mu)f(\mu)\\
&= \dfrac 1{ \vert f(\mu) \vert}
\underbrace{\dfrac {\sqrt{n}}{\sigma}(X_n-\mu)}_
{\substack{\Vert\\O_p(1)}}g(X_n)+
\underbrace{\dfrac {f(\mu)}{\vert f(\mu) \vert}}_
{\substack{\Vert\\\pm1}}
\underbrace{\dfrac {\sqrt{n}}{\sigma }(X_n-\mu)}_
{\substack{\downarrow \\N(0,1)}}
\end{align*}

(Xn )[g(Xn ) + f 0 ()]

n
n
=
(Xn )g(Xn ) +
(Xn )f 0 ()
0
0
|f ()|
|f ()|

1
n
f 0 () n
= 0
(Xn ) g(Xn ) + 0
(Xn )
|f ()| | {z
|f ()| | {z
}
}
| {z }

Yn =

|f 0 ()|

k
Op (1)

k
1

N (0,1)

5. C th t mu cc mc theo lnh bnh thng vi gi lnh \usepackage{color}


\begin{align}\label{eq:pqFormel}
y &= 2x^2 -3x +5\\\nonumber
& \hphantom{= \ 2\left(x^2-\frac{3}{2}\,x\right. }%
\textcolor{blue}{%
\overbrace{\hphantom{+\left(\frac{3}{4}\right)^2- %

http://nhdien.wordpress.com - Nguyn Hu in

\left(\frac{3}{4}\right)^2}}^{=0}}\\[-11pt]
&= 2\left(\textcolor{red}{%
\underbrace{x^2-\frac{3}{2}\,x + \left(\frac{3}{4}\right)^2}%
}%
\underbrace{- \left(\frac{3}{4}\right)^2 + \frac{5}{2}}%
\right)\\
&= 2\left(\qquad\textcolor{red}{\left(x-\frac{3}{4}\right)^2}
\qquad + \ \frac{31}{16}\qquad\right)\\
y\textcolor{blue}{-\frac{31}{8}}
&= 2\left(x\textcolor{cyan}{-\frac{3}{4}}\right)^2%
\end{align}
y = 2x2 3x + 5

(1)
=0

}|
{
 2  2
3
3
3

= 2 x2 x +
+
2
4
4
{z
}|
{z
|

2
31
3
+
=2
x
4
16

2
31
3
y = 2 x
8
4
z

5
2
}
!

(2)

(3)
(4)

6. cho du mc cn bng hy dng lnh \vphantom{...}


Khi cha dng n
$$
P = \underbrace{\sum_{j=1}^{\infty}....} +
\underbrace{\lim_{T \to \infty} .....}
$$
P =

.... + lim .....


|T
{z }
j=1
| {z }

Khi ta sa li vi \vphantom{...}
$$
P = \underbrace{\sum_{j=1}^{\infty}....} +
\underbrace{\vphantom{\sum_{j=1}^{\infty}}\lim_{T \to \infty} ...}
$$
P =

.... + lim ...

j=1

| {z }

| {z }

http://nhdien.wordpress.com - Nguyn Hu in

7. S kt hp vn dng \vphantom{...}
$$
\binom{x_1}{y_1}=
\underbrace{r
\vphantom{\begin{pmatrix}\sin \theta \\
\cos \theta \end{pmatrix}}}_{\text{phn 1}}
\times
\underbrace{
\begin{pmatrix}
\sin \theta & -\cos \theta \\
\cos \theta & \sin \theta
\end{pmatrix}
}_{\text{phn 2}}
\binom{x_0}{y_0}
+
\underbrace{
\binom{a_1}{b_1}
\vphantom{\begin{pmatrix}\sin \theta \\
\cos \theta \end{pmatrix}}}_{\text{phn 3}}
$$
 

   
x0
a1
x1
sin cos
+
= r
cos sin
y1
y
b
{z
} 0
| {z1 }
|{z} |
phn 1

phn 2

phn 3

8. C th dng nh ngha cha \vphantom sau s dng rt tin v bt phc


tp: Khi cha p dng lnh
\begin{equation}
f(x) =
\underbrace{1}_\text{mt}
\underbrace{{}+\frac{1}{x}}_\text{hai}
\underbrace{{}+\left[\left(\frac{1}{x}\right)\right]}_\text{ba}
\end{equation}
 
1
1
f (x) = |{z}
1 + +
(5)
x
x
|{z}
| {z }
mt
hai

ba

Ta nh ngha cao
\def\ngoc caoest{\vphantom{\left[\left(\frac{1}{x}\right)\right]}}
v dng nh sau

http://nhdien.wordpress.com - Nguyn Hu in

\begin{equation}
f(x) =
\underbrace{1\ngoc caoest}_\text{mt}
+\underbrace{\frac{1}{x}\ngoc caoest}_\text{hai}
+\underbrace{\left[\left(\frac{1}{x}\right)\right]}_\text{ba}
\end{equation}
 
1
1
+
f (x) = 1 +
x
x
|{z} |{z} | {z }
hai

mt

(6)

ba

9. Ngoc vung trn v di nh ngha li ngay t u


\makeatletter
\def\overbracket#1{\mathop{\vbox{\ialign{##\crcr\noalign{\kern3\p@}
\downbracketfill\crcr\noalign{\kern3\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
\def\underbracket#1{\mathop{\vtop{\ialign{##\crcr
$\hfil\displaystyle{#1}\hfil$\crcr\noalign{\kern3\p@\nointerlineskip}
\upbracketfill\crcr\noalign{\kern3\p@}}}}\limits}
\makeatother
Ta c th s dng
$$
\overbracket{\text{C mt ngi
\underbracket{\text{C mt mi
$$
$$
\overbracket{\text{C mt ngi
\qquad
\underbracket{\text{C mt mi
$$

nh nh th}}\qquad
nh nh vy}}

nh nh th}}^{\text{ting ci}}
nh nh vy}}_{\text{y hoa}}

C mt ngi nh nh th

C mt mi nh nh vy

vang nhng ting ci

C mt ngi nh nh th

C mt mi nh nh vy
y hoa

10. Ngoc trn v di trn cng nh ngha li

http://nhdien.wordpress.com - Nguyn Hu in

\makeatletter
\def\overparenthesis#1{\mathop{\vbox{\ialign{##\crcr\noalign{\kern3\p@}
\downparenthfill\crcr\noalign{\kern3\p@\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
\def\underparenthesis#1{\mathop{\vtop{\ialign{##\crcr
$\hfil\displaystyle{#1}\hfil$\crcr\noalign{\kern3\p@\nointerlineskip}
\upparenthfill\crcr\noalign{\kern3\p@}}}}\limits}
\makeatother
$$
\overparenthesis{\text{C mt ngi
\underparenthesis{\text{C mt mi
$$
$$
\overparenthesis{\text{C mt ngi
\qquad
\underparenthesis{\text{C mt mi
$$
{
z
C mt ngi nh nh th

nh nh th}}\qquad
nh nh vy}}

nh nh th}}^{\text{ting ci}}
nh nh vy}}_{\text{y hoa}}

C mt mi nh nh vy
}
|

ting ci

z
{
C mt ngi nh nh th

C mt mi nh nh vy
|
}
y hoa

11. Mc trn di c i s ty chn iu chnh thp cao


\makeatletter
\def\underbracket{%
\@ifnextchar [ %
{\@underbracket}%
{\@underbracket [\@bracketheight]}%
}
\def\@underbracket[#1]{%
\@ifnextchar [ %
{\@under@bracket[#1]}%
{\@under@bracket[#1][0.4em]}%
}
\def\@under@bracket[#1][#2]#3{%\message {Underbracket: #1,#2,#3}
\mathop {%
\vtop {%
\m@th \ialign {%
##\crcr $\hfil \displaystyle {#3}\hfil $%

http://nhdien.wordpress.com - Nguyn Hu in

\crcr \noalign %
{\kern 3\p@ \nointerlineskip }%
\upbracketfill {#1}{#2}
\crcr \noalign %
{\kern 3\p@ }%
}%
}%
}%
\limits%
}
\def\upbracketfill#1#2{%
$\m@th \setbox \z@ \hbox {$\braceld$}
\edef\@bracketheight{\the\ht\z@}\bracketend{#1}{#2}
\leaders \vrule \@height #1 \@depth \z@ \hfill
\leaders \vrule \@height #1 \@depth \z@ \hfill%
\bracketend{#1}{#2}$%
}
\def\bracketend#1#2{\vrule height #2 width #1\relax}
\def\overbracket{\@ifnextchar [ {\@overbracket} {\@overbracket
[\@bracketheight]}}
\def\@overbracket[#1]{\@ifnextchar [ {\@over@bracket[#1]}
{\@over@bracket[#1][0.3em]}}
\def\@over@bracket[#1][#2]#3{%\message {Overbracket: #1,#2,#3}
\mathop {\vbox {\m@th \ialign {##\crcr \noalign {\kern 3\p@
\nointerlineskip }\downbracketfill {#1}{#2}
\crcr \noalign {\kern 3\p@ }
\crcr $\hfil \displaystyle {#3}\hfil $%
\crcr} }}\limits}
\def\downbracketfill#1#2{$\m@th \setbox \z@ \hbox {$\braceld$}
\edef\@bracketheight{\the\ht\z@}\downbracketend{#1}{#2}
\leaders \vrule \@height #1 \@depth \z@ \hfill
\leaders \vrule \@height #1 \@depth \z@ \hfill
\downbracketend{#1}{#2}$}
\def\downbracketend#1#2{\vrule depth #2 width #1\relax}
\makeatother
p dng nh sau:
Bt u

1 2 3 4 5 6 7 8 9 10 Kt thc
ngoc thp

ngoc trung
bnh

ngoc cao

http://nhdien.wordpress.com - Nguyn Hu in

$\underbracket {foo\ bar}$

f oo bar

$\underbracket[2pt] {foo\ bar}$}

f oo bar

$\underbracket[2pt][1em] {foo\ bar}$}

f oo bar

ngoc thp

Bt u

ngoc trung
bnh

ngoc cao

1 2 3 4 5 6 7 8 9 10 Kt thc

$\overbracket {foo\ bar}$

f oo bar

$\overbracket[2pt] {foo\ bar}$}

f oo bar

$\overbracket[2pt][1em] {foo\ bar}$}

f oo bar

Bt u 1 2 3 4

567

8 9 10 Kt thc

ngoc thp ngoc trung bnh


ngoc cao
Bt u 1 2 3 4 5 6 7 8 9 10 Kt thc
ngoc thp

ngoc trung bnh

ngoc cao

ngoc cao
ngoc thp ngoc trung bnh
Bt u 1 2 3 4

ngoc thp

567

ngoc trung bnh

8 9 10 Kt thc
ngoc cao

Bt u 1 2 3 4 5 6 7 8 9 10 Kt thc
12. a dng s dng
\newcommand{\zerosub}[1]{\hbox to 0pt{\hss$\scriptstyle#1$\hss}}
\begin{equation}

http://nhdien.wordpress.com - Nguyn Hu in

F_n \cdot {\underbrace{F_{n + 2}}_{\zerosub{= F_{n + 1} + F_n}}}


- F_{n + 1} \cdot {\underbrace{F_{n + 1}}_{\zerosub{= F_n + F_{n - 1}}}}= k
\end{equation}
Fn Fn+2 Fn+1 Fn+1 = k
| {z }
| {z }
=Fn+1 +Fn

(7)

=Fn +Fn1

\begin{equation}
F_n \cdot {\underbrace{F_{n + 2}}_{= F_{n + 1} + F_n}}
- F_{n + 1} \cdot {\underbrace{F_{n + 1}}_{= F_n + F_{n - 1}}}= k
\end{equation}
Fn

Fn+2
| {z }

Fn+1

=Fn+1 +Fn

Fn+1
}
| {z

=k

(8)

=Fn +Fn1

\begin{equation}
{\underbrace{A+B+C+D}_{\zerosub{\mu_n}}}=k
\end{equation}
A
+ C + D} = k
| + B {z

(9)

\begin{equation}
{\underbrace{A+B+C+D}_{\mu_n}}=k
\end{equation}
A
+ C + D} = k
| + B {z

(10)

13. Lng vo mt bng


\begin{tabular}{p{8em}*3c}
abcdefg&abcdefg&abcdefg&abcdefg\\[-10pt]
\multicolumn{3}{c}{$\underbrace{\hspace{24em}}_{F_n\text{bao rng}}$}&\\
\end{tabular}
abcdefg
|

abcdefg
{z

abcdefg

Fn bao rng

abcdefg
}

14. C th gii thch trong mt mi trng


\begin{equation}
a = \underbrace{\kern1.6cm b\kern1.6cm}_{\begin{minipage}{3.5cm}a
really long comment about the possible significance of the second
term on the right hand side of this equation\end{minipage}}
+ c
\end{equation}

http://nhdien.wordpress.com - Nguyn Hu in
a= |
b
{z
} +c
a really long comment about the
possible
significance of the second
term on the right
hand side of this
equation

10
(11)

Gi lnh oubraces.sty

s dng tinh vi hn c lnh dng


$$
\overunderbraces{&\br{2}{x}& &\br{2}{y}}
{a + b +&c + d +&e + f&+&g + h&+ i + j&+ k + l + m}
{& &\br{3}{z}}
= \pi r^2
$$
x
y
}|
{ z
}|
{
z
a + b + c + d + e + f + g + h + i + j + k + l + m = r2
|
{z
}
z
\begin{align}
&\mathsurround =0pt\rlap{$\overbrace{A+B}$}A+\underbrace{B+C}
\qquad \text{Khng dng \texttt{oubraces.sty}} \\
&\overunderbraces{&\br{2}{}}
{&A+&B&+C&}
{& &\br{2}{}}
\qquad \text{S dng \texttt{oubraces.sty}}
\end{align}

z }| {
A + |B {z
+ C}
z }| {
A+B+C
| {z }

Khng dng oubraces.sty

(12)

S dng oubraces.sty

(13)

You might also like