Professional Documents
Culture Documents
2 Sử dụng lệnh
1. Tùy chọn gói lệnh
\usepackage[fleqn,tbtags]{mathtools} tương đương với
\usepackage[fleqn,tbtags]{amsmath}
\usepackage{mathtools}
Ngoài ra còn tùy chọn
fixamsmath sử lại một lỗi trong gói lệnh amsmath.sty
donotfixamsmathbugs không sửa lại lỗi.
allowspaces cho phép chữa lại khoảng trống quanh công thức
disallowspaces không cho phép sửa công thức.
2. Nhiều khi trong gói lệnh amsmath.sty mất chữ khi dùng
\[
\begin{gathered}
[p] = 100 \\
[v] = 200
\end{gathered}
\]
= 100
[v] = 200
Nhưng với gói lệnh mathtools.sty thì
[p] = 100
[v] = 200
1
http://nhdien.wordpress.com - Nguyễn Hữu Điển 2
X
X= Xij ←− amsmath.sty
1≤i≤j≤n
X
X= Xij ←− mathtools.sty
1≤i≤j≤n
X
a+b= f (i)g(j)
i+j=10
X
= h(k)
k≥0
X
a+b= f (i)g(j)
i+j=10
X
= h(k)
k≥0
4. Tinh chỉnh bằng lệnh \smashoperator{} mặc định căn vào giữa, với tùy chọn
\smashoperator[r]{} căn bên phải, \smashoperator[l]{} căn trái
\begin{align*}
V &= \sum_{i\le j \le \le k \le \ell}^{\infty} V_{ijk\ell} \\
V &= \smashoperator{\sum_{i\le j \le \le k \le \ell}^{\infty}} V_{ijk\ell} \\
V &= \smashoperator[r]{\sum_{i\le j \le \le k \le \ell}^{\infty}} V_{ijk\ell} \\
V &= \smashoperator[l]{\sum_{i\le j \le \le k \le \ell}^{\infty}} V_{ijk\ell}
\end{align*}
∞
X
V = Vijk`
i≤j≤≤k≤`
X∞
V = Vijk`
i≤j≤≤k≤`
X∞
V = Vijk`
i≤j≤≤k≤`
X∞
V = Vijk`
i≤j≤≤k≤`
http://nhdien.wordpress.com - Nguyễn Hữu Điển 3
{\Huge
\begin{alignat*}{2}
& \lim_{n\to\infty} \max_{p\ge n},
& \adjustlimits\lim_{n\to\infty} \max_{p\ge n} \\
& \lim_{n\to\infty} \max_{p^2\ge n},
& \adjustlimits\lim_{n\to\infty} \max_{p^2\ge n} \\
& \lim_{n\to\infty} \sup_{p^2\ge nK},
& \adjustlimits\lim_{n\to\infty} \sup_{p^2\ge nK} \\
& \limsup_{n\to\infty} \max_{p\ge n},
& \adjustlimits\limsup_{n\to\infty} \max_{p\ge n}
\end{alignat*}}
Bên trái là chưa tinh chỉnh, bên phải dùng lệnh tinh chỉnh rồi
\newtagform{brackets2}[\textbf]{[}{]}
\usetagform{brackets2}
\begin{align}
X &= \sum_{1\le i\le j\le n} X_{ij} \\
X &= \sum_{\mathclap{1\le i\le j\le n}} X_{ij}
\end{align}
X
X= Xij [1]
1≤i≤j≤n
X
X= Xij [2]
1≤i≤j≤n
\begin{align}
X &= \sum_{1\le i\le j\le n} X_{ij} \\
X &= \sum_{\mathclap{1\le i\le j\le n}} X_{ij}
\end{align}
X
X= Xij (3)
1≤i≤j≤n
X
X= Xij (4)
1≤i≤j≤n
\begin{align}
X &= \sum_{1\le i\le j\le n} X_{ij} \label{eq:eq01}\\
X &= \sum_{\mathclap{1\le i\le j\le n}} X_{ij} \label{eq:eq02}
\end{align}
X
X= Xij (5)
1≤i≤j≤n
X
X= Xij
1≤i≤j≤n
\begin{align}
X &= \sum_{1\le i\le j\le n} X_{ij} \label{eq:eq03}\\
X &= \sum_{\mathclap{1\le i\le j\le n}} X_{ij} \label{eq:eq04}
\end{align}
X
X= Xij (6)
1≤i≤j≤n
X
X= Xij (7)
1≤i≤j≤n
\usepackage{mathtools}
\begin{matrix*}[l]
\begin{align*}
&\begin{matrix*}[l]
a_{11} &a_{12} \\
a_{21} &a_{22}+b_{12}
\end{matrix*} \\
&\begin{pmatrix*}[l]
a_{11} &a_{12} \\
a_{21} &a_{22}+b_{12} a11 a12
\end{pmatrix*}\\ a21 a22 + b12
&\begin{bmatrix*}[l] a11 a12
a_{11} &a_{12} \\ a21 a22 + b12
a_{21} &a_{22}+b_{12}
a11 a12
\end{bmatrix*}\\ a21 a22 + b12
&\begin{Bmatrix*}[l]
a_{11} &a_{12} \\ a11 a12
a_{21} &a_{22}+b_{12} a21 a22 + b12
\end{Bmatrix*}\\ a11 a12
&\begin{vmatrix*}[l] a21 a22 + b12
a_{11} &a_{12} \\
a11 a12
a_{21} &a_{22}+b_{12}
a21 a22 + b12
\end{vmatrix*}\\
&\begin{Vmatrix*}[l]
a_{11} &a_{12} \\
a_{21} &a_{22}+b_{12}
\end{Vmatrix*}
\end{align*}
9. Thêm môi trường dcases và dcases* để tinh chỉnh, ta so sánh
\[
a=\begin{cases}
E = m c^2 & \text{Nothing to see here} \\
\int x-3\, dx & \text{Integral is text style}
\end{cases}
\]
(
E = mc2 Nothing to see here
a=
x − 3 dx Integral is text style
R
\[
a=\begin{dcases}
E = m c^2 & \text{Nothing to see here} \\
\int x-3\, dx & \text{Integral is text style}
\end{dcases}
\]
2
Nothing to see here
E = mc
a=
Z
x − 3 dx Integral is text style
\[
http://nhdien.wordpress.com - Nguyễn Hữu Điển 7
a=\begin{dcases*}
E = m c^2 & Nothing to see here \\
\int x-3\, dx & Integral is text style
\end{dcases*}
\]
2
Nothing to see here
E = mc
a=
Z
x − 3 dx Integral is text style
a=b (8)
c=d (9)
a=b (10)
Bên trong công thức
c=d (11)
\[
{}^{4}_{12}\mathbf{C}^{5+}_{2} \quad
\prescript{14}{2}{\mathbf{C}}^{5+}_{2} \quad
\prescript{4}{12}{\mathbf{C}}^{5+}_{2} \quad
\prescript{14}{}{\mathbf{C}}^{5+}_{2} \quad
\prescript{}{2}{\mathbf{C}}^{5+}_{2}
\]
5+ 14 5+ 4 5+ 14
4
12 C2 2 C2 12 C2 C5+
2
5+
2 C2
\newcommand*\myisotope[3]{%
\begingroup
\mathtoolsset{
prescript-sup-format=\mathit,
prescript-sub-format=\mathbf,
prescript-arg-format=\mathrm,
}%
\prescript{#1}{#2}{#3}%
\endgroup
}
http://nhdien.wordpress.com - Nguyễn Hữu Điển 8
\[
\myisotope{A}{Z}{X}\to \myisotope{A-4}{Z-2}{Y}+
\myisotope{4}{2}{\alpha}
\]
A
ZX → A−4 4
Z−2 Y + 2 α
Ví dụ
\[
A \xLeftarrow[under]{over} B
\]
over
A ⇐=== B
under
Tương tự có
\[
\underbracket[3pt]{xxx\ yyy}_{zzz} \quad \text{and} \quad
\underbracket[1pt][7pt]{xxx\ yyy}_{zzz}
\]
http://nhdien.wordpress.com - Nguyễn Hữu Điển 9
\[
a=\frac{
\splitfrac{xy + xy + xy + xy + xy}
{+ xy + xy + xy + xy}
}
{z}
=\frac{
\splitdfrac{xy + xy + xy + xy + xy}
{+ xy + xy + xy + xy}
}
{z}
\]
xy + xy + xy + xy + xy xy + xy + xy + xy + xy
+ xy + xy + xy + xy + xy + xy + xy + xy
a= =
z z
15. Môi trường gathered được cải tiến nhiều
Ví dụ
\begin{equation}
\begin{lgathered}
x=1,\quad x+1=2 \\
y=2
\end{lgathered}
\end{equation}
x = 1, x+1=2
(12)
y=2
Cải tiến môi trường này
\newcounter{steplinecnt}
\newcommand\stepline{\stepcounter{steplinecnt}\thesteplinecnt}
\newgathered{stargathered}
{\llap{\stepline}$*$\quad\hfil}% \hfil for centering
{\hfil}% \hfil for centering
{\setcounter{steplinecnt}{0}}% reset counter
Áp dụng
http://nhdien.wordpress.com - Nguyễn Hữu Điển 10
\begin{gather}
\begin{stargathered}
x=1,\quad x+1=2 \\
y=2
\end{stargathered}
\end{gather}
1∗ x = 1, x+1=2
(13)
2∗ y=2
\begin{spreadlines}{20pt}
Cách ra 20pt
\begin{gather}
a=b\\
c=d
\end{gather}
\end{spreadlines}
Cách ra 20pt
a=b (14)
c=d (15)
a=b (16)
c=d (17)