Professional Documents
Culture Documents
I. Giới thiệu
Một gói lệnh trong bó công cụ của LaTeX có tại
http://tug.ctan.org/tex-archive/macros/latex/required/tools/
do Frank Mittelbach, David Carlisle viết mới được cập nhật gói lệnh array.sty.
1
http://nhdien.wordpress.com 2
• trong tùy chọn p, m hoặc b, giá trị mặc định của thụt
dòng cột là \parindent= 0pt. Ta có thể thay đổi như
>{\setlength{\parindent}{1cm}}p.
• dấu >{ và <{ta có thể dùng làm cột có môi trường toán: >{$}c<{$}
\newcolumntype{C}{>{$}c<{$}}
\newcolumntype{L}{>{$}l<{$}}
\newcolumntype{R}{>{$}r<{$}}
\begin{tabular}{|b{10em}|c|}
\hline
Thế là phải xuống dòng \newline Ai cũng vậy ... \newline Thế thì...
& Ở dòng bên đây ...\\
\hline
&Có gì đâu?\\
\hline
\end{tabular}
http://nhdien.wordpress.com 3
\begin{tabular}{|>{\raggedleft}p{10em}|c|}
\hline
Thế là phải xuống dòng \newline Ai cũng vậy ... \newline Thế thì...
& Ở dòng bên đây ...\\
\hline
&Có gì đâu?\\
\hline
\end{tabular}
\begin{tabular}{|>{$}c<{$}|c|}
\hline
\exp(x)&Hàm số muc\\ \hline
\log(x)&Hàm số logarit\\
\hline
\end{tabular}
\setlength\extrarowheight{2pt}
\begin{tabular}{|>{$}c<{$}|c|}
\hline
\exp(x)&Hàm số muc\\ \hline
http://nhdien.wordpress.com 4
\log(x)&Hàm số logarit\\
\hline
\end{tabular}
\begin{tabular}{|c|@{\hspace{1cm}}c|}
\hline
aa&bbb\\ \hline
cccc&dddd\\
\hline
\end{tabular}
aa bbb
cccc dddd
\begin{tabular}{|c|!{\hspace{1cm}}c|}
\hline
aa&bbb\\ \hline
cccc&dddd\\
\hline
\end{tabular}
aa bbb
cccc dddd
\setlength{\arrayrulewidth}{5pt}
\begin{tabular}{|c|c|}
\hline
A & B \\
\hline
\end{tabular}
A B
2.
\hline
w&w&Thêm vào\\
\noalign{\global\arrayrulewidth.4pt}
\hline
\noalign{\global\arrayrulewidth3pt}
& & \\
\hline
\end{tabular}
w w Thêm vào
3.
{\tiny
\setlength{\tabcolsep}{3pt}
\begin{tabular}{|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.6cm}|%
>{\centering}m{0.8cm}|%
l}
10 & 9 & 8 & 7 & 6 & 5 & 4 & 3 & 2 & 1 & 0 & \\
\hline
& & & & & & & & & & & \\
\multicolumn{3}{|c|}{STKSZ} & ROM S1 & SGT DIS & ROM EN & BYT DIS & CLK EN &
WRC FG & CSC FG & - & \\
& & & & & & & & & & & \\
\hline
\end{tabular}
}
10 9 8 7 6 5 4 3 2 1 0
4.
\newcommand*\checkBoxes{%
http://nhdien.wordpress.com 6
\parbox{8cm}{%
\begin{tabular}{*{5}{>{\centering\tiny}m{1.5cm}}@{}l@{}}
Một&Hai&Ba&Bốn&Năm\tabularnewline
\fbox{\normalsize 1} & \fbox{\normalsize 2} & \fbox{\normalsize 3}
& \fbox{\normalsize 4} & \fbox{\normalsize 5}\tabularnewline
\end{tabular}%
}}
\begin{center}
\begin{tabular}{>{\tiny}m{1em} m{2cm} c}
1 &Phần 1& \checkBoxes\\[1cm]
2 &Phần 3& \checkBoxes\\[1cm]
3 &Phần 3& \checkBoxes\\[1cm]
\end{tabular}
\end{center}
\newcolumntype{C}[1]{>{\centering}p{#1\linewidth}|}
\begin{tabular}{|C{.2}C{.4}}
\hline
item 1 & item 2\tabularnewline
\hline
1&2\tabularnewline
\hline
\end{tabular}
item 1 item 2
1 2
http://nhdien.wordpress.com 7
2.
\begin{tabular}{
|>{\fontencoding{T1}\fontfamily{cmr}\selectfont}l%
|>{\fontencoding{T1}\fontfamily{cmtt}\selectfont}l%
|>{\fontencoding{T1}\fontfamily{pzc}\selectfont}l|
}
\hline
cmr & cmtt & Zapf Chancery \\
\hline
ABcD & ABcD & ABcD \\
1234 & 1234 & 1234 \\
\hline
\end{tabular}
\newcolumntype{C}{>{\itshape}c}
\newcolumntype{L}{>{\bfseries}l}
\newcolumntype{R}{>{\color{red}}r}
\newcolumntype{C}{>{\itshape}c}
\newcolumntype{D}{>{\color{blue}\itshape}
r@{\color{blue}\itshape.}>{\color{blue}\itshape}l}
\begin{tabular}[c]{|C|L|R|D|}
\hline
300.30 & 12.00 & 13.00 & 1223&45\\
40.30 & 14.56 & 3544.20 & 223&45\\
40.30 & 14.56 & text & 56&70\\
\hline
\end{tabular}
\noalign{\global\arrayrulewidth\savedwidth}}
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|c|c|c|c|c|c|c|} \hline
\multicolumn{1}{|c}{} & \multicolumn{1}{c|}{$Y$}&
\multicolumn{5}{c|}{\hspace{3cm}} \\ \cline{3-7}
\multicolumn{1}{|c}{$X$} & \multicolumn{1}{c|}{}&
\multicolumn{1}{c|}{1} & 2 & 3 & 4 &
\multicolumn{1}{c|}{5} \\ \hline\wcline{3-7}
& 5 &\multicolumn{1}{Ic|}{1} & 3 & 1 & 0
&\multicolumn{1}{cI}{1} \\ \cline{2-7}
AA& 4 &\multicolumn{1}{Ic|}{1} & 0 & 7 & 5
&\multicolumn{1}{cI}{1} \\ \cline{2-7}
& 3 &\multicolumn{1}{Ic|}{2} & 1 & 0 & 9
&\multicolumn{1}{cI}{3} \\ \cline{2-7}
BB& 2 &\multicolumn{1}{Ic|}{1} &$b$& 6 & 0
&\multicolumn{1}{cI}{$a$} \\ \cline{2-7}
& 1 &\multicolumn{1}{Ic|}{0} & 0 & 1 & 1
&\multicolumn{1}{cI}{3} \\ \hline\wcline{3-7}
\end{tabular}
X 1 2 3 4 5
5 1 3 1 0 1
AA 4 1 0 7 5 1
3 2 1 0 9 3
BB 2 1 b 6 0 a
1 0 0 1 1 3
http://nhdien.wordpress.com 9
5.
\newcommand\whline{%
\noalign{\xdef\origarrayrulewidth{\the\arrayrulewidth}%
\global\arrayrulewidth 3\arrayrulewidth}%
\hline%
\noalign{\global\arrayrulewidth\origarrayrulewidth}%
}
\rowcolors{1}{blue!4}{blue!12}
\begin{tabular}{|cIc|c|}
\hline
a & B & C \\\hline
a & B & C \\\whline
a & B & C \\\hline
a & B & C \\\hline
a & B & C \\\whline
a & B & C \\\hline
\end{tabular}
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
http://nhdien.wordpress.com 10
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C
a B C a B C a B C a B C