Professional Documents
Culture Documents
Xtab.sty bảng kéo dài hơn một Trang
Xtab.sty bảng kéo dài hơn một Trang
Xtab.sty bảng kéo dài hơn một Trang
Mục lục
1 Giới thiệu 1
4 Ví dụ 3
1 Giới thiệu
Gói lệnh xtab.sty do các tác giả Peter Wilson, Herries Press viết nhằm khắc phục
một số nhược điểm của gói lệnh supertabular.sty, gói lệnh này tôi đã đề cập tới
trong cuốn sách thứ 2 về TeX của tôi. Mục đích của các gói lệnh này là tự động
ngắt các bảng quá dài hơn một trang, còn dùng môi trường tabular thì không
làm được. Bạn có thể lấy gói lệnh tại địa chỉ
http://www.tex.ac.uk/tex-archive/macros/latex/contrib/xtab/
• errorshow đây là tùy chọn mặc định, không viết vào tệp *.log các thông
tin quá cỡ của bảng.
• pageshow viết ra tất cả công thông tin khia nào, tại sao xtab lại ngắt và
làm những việc như vậy.
1
http://nhdien.wordpress.com 2
• debugshow giống như phần trên pageshow nhưng thêm dòng vào bảng để
truy lại dòng đó được.
Có thể dùng \sstraceon mở mỗi đoạn để dùng debugshow và đóng đoạn kiểm
tra lại dùng \sstraceoff, tất nhiên không có tùy chọn debugshow ngay từ đầu
\begin{xtabular}{| l | l | l | l | l |}
*&*&*&*&*\\
*&*&*&*&*\\
*&*&*&*&*\\
*&*&*&*&*\\
\end{xtabular}
giống như môi trường tabular, chỉ khác là ngắt được sang trang.
2. Môi trường có minipage
\begin{xtabular}{| l | l | l | l | l |}
*&*&*&*&*\\
*&*&*&*&*\\
*&*&*&*&*\\
*&*&*&*&*\\
\end{xtabular}
Môi trường khi tách sang trang được đưa vào một môi trường minipage của
LaTeX, do vậy cuối trang có chỗ chú thích chứ không phải cuối bảng.
3. Các lệnh làm chú thích bảng, nhãn, câu chú thích chuyển trang của bảng đều
có lệnh riên và để ngoài.
• \tablehead{...} Khi chuyển trang dòng đầu tiên có nội dung của lệnh
này.
• \tabletail{...} Khi chuyển trang dòng cuối cùng có nội dung của lệnh
này.
4 Ví dụ
\topcaption{The principal xtab package commands} \label{tab:xtab}
\tablefirsthead{\hline \multicolumn{1}{|c|}{\textbf{Command}} &
\multicolumn{1}{c|}{\textbf{Effect}} \\ \hline }
\tablehead{\multicolumn{2}{c}%
{{\captionsize\bfseries \tablename\ \thetable{} --
continued from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{Command}} &
\multicolumn{1}{c|}{\textbf{Effect}} \\ \hline }
\tablelasthead{\multicolumn{2}{c}%
{{\captionsize\bfseries \tablename\ \thetable{} --
concluded from previous page}} \\
\hline \multicolumn{1}{|c|}{\textbf{Command}} &
\multicolumn{1}{c|}{\textbf{Effect}} \\ \hline }
\tabletail{\hline \multicolumn{2}{|r|}{{Continued on next page}} \\ \hline}
\tablelasttail{\hline \hline}
\begin{center}
\begin{xtabular}{|l|p{0.5\textwidth}|}
\verb|\begin{xtabular}{...}| & This is equivalent to the normal
\verb|\begin{tabular}{...}| environment.
You supply the specification of the columns
just as for the normal \Lenv{tabular} environment.
\\
&
All commands that can be used within a \Lenv{tabular}
environment can also be used within
the \Lenv{xtabular} environment.
\\
&
Unlike the \Lenv{tabular} environment which prevents page breaking
within the tabular, the \Lenv{xtabular} allows page breaking, so that
tabulars can extend automatically across several pages.
... ... ...\\
\verb|\tablelasttail{...}| & The contents of this command are inserted before
the final (internal) \verb|\end{tabular}| of the table.
\\
\verb|\tablelasttail{...}| & The contents of this command are inserted before
the final (internal) \verb|\end{tabular}| of the table.
http://nhdien.wordpress.com 4
\\
&
For example, you might want to note that this is where
the table ends.
\\
\end{xtabular}
\end{center}