| 1 |
|
| 2 |
\newcommand*\showCounterTable{% |
| 3 |
\noindent The Counter \textbf{table:~\arabic{table}}\par |
| 4 |
} |
| 5 |
|
| 6 |
\begin{document} |
| 7 |
|
| 8 |
\chapter{Chapter 1} |
| 9 |
\section{Section 1 of Chapter 1} |
| 10 |
|
| 11 |
\showCounterTable |
| 12 |
\begin{xltabular}[l]{.7\linewidth}{|c|X|X|} |
| 13 |
\caption{A table with a caption\label{tab:A}} \\ |
| 14 |
\hline |
| 15 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 16 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 17 |
\hline |
| 18 |
\end{xltabular} |
| 19 |
\showCounterTable |
| 20 |
|
| 21 |
\section{Section 2 of Chapter 1} |
| 22 |
|
| 23 |
\showCounterTable |
| 24 |
\begin{xltabular}[r]{.7\linewidth}{|c|X|X|} |
| 25 |
\hline |
| 26 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 27 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 28 |
\hline |
| 29 |
\end{xltabular} |
| 30 |
\showCounterTable |
| 31 |
|
| 32 |
\section{Section 3 of Chapter 1} |
| 33 |
|
| 34 |
\showCounterTable |
| 35 |
\begin{xltabular}[r]{.7\linewidth}{|c|X|X|} |
| 36 |
\caption{A table with a caption\label{tab:B}} \\ |
| 37 |
\hline |
| 38 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 39 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 40 |
\hline |
| 41 |
\end{xltabular} |
| 42 |
\showCounterTable |
| 43 |
|
| 44 |
\section{Section 4 of Chapter 1} |
| 45 |
|
| 46 |
\showCounterTable |
| 47 |
\begin{xltabular}[r]{.7\linewidth}{|c|X|X|} |
| 48 |
\caption*{A table with a star caption\label{tab:BB}} \\ |
| 49 |
\hline |
| 50 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 51 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 52 |
\hline |
| 53 |
\end{xltabular} |
| 54 |
\showCounterTable |
| 55 |
|
| 56 |
\showCounterTable |
| 57 |
\begin{xltabular}[r]{.7\linewidth}{|c|X|X|} |
| 58 |
\caption{A table with a normal caption\label{tab:BBB}} \\ |
| 59 |
\hline |
| 60 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 61 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 62 |
\hline |
| 63 |
\end{xltabular} |
| 64 |
\showCounterTable |
| 65 |
|
| 66 |
\chapter{Chapter 2} |
| 67 |
\section{Section 1 of Chapter 2} |
| 68 |
|
| 69 |
\showCounterTable |
| 70 |
\begin{xltabular}[c]{.7\linewidth}{|c|X|X|} |
| 71 |
\caption{A table with a caption\label{tab:C}} \\ |
| 72 |
\hline |
| 73 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 74 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 75 |
\hline |
| 76 |
\end{xltabular} |
| 77 |
\showCounterTable |
| 78 |
|
| 79 |
\section{Section 2 of Chapter 2} |
| 80 |
|
| 81 |
\showCounterTable |
| 82 |
\begin{xltabular}[c]{.7\linewidth}{|c|X|X|} |
| 83 |
\caption{A table with a caption\label{tab:D}} \\ |
| 84 |
\hline |
| 85 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 86 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 87 |
\hline |
| 88 |
\end{xltabular} |
| 89 |
\showCounterTable |
| 90 |
|
| 91 |
|
| 92 |
\section{Section 3 of Chapter 2} |
| 93 |
|
| 94 |
\showCounterTable |
| 95 |
\begin{xltabular}[c]{.7\linewidth}{|c|X|X|} |
| 96 |
\caption{A table with a caption\label{tab:DD}} \\ |
| 97 |
\hline |
| 98 |
& \begin{enumerate}\item foo \item bar \end{enumerate} & \\ |
| 99 |
1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\ |
| 100 |
4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\ |
| 101 |
\hline |
| 102 |
\end{xltabular} |
| 103 |
\showCounterTable |
| 104 |
|
| 105 |
|
| 106 |
\section{Section 4 of Chapter 2 -- some references} |
| 107 |
|
| 108 |
\begin{itemize} |
| 109 |
\item Table~\ref{tab:A} is on page~\pageref{tab:A} |
| 110 |
\item Table~\ref{tab:B} is on page~\pageref{tab:B} |
| 111 |
\item Table~\ref{tab:C} is on page~\pageref{tab:C} |
| 112 |
\item Table~\ref{tab:D} is on page~\pageref{tab:D} |
| 113 |
\end{itemize} |
| 114 |
|
| 115 |
|
| 116 |
\begin{longtable}{c} |
| 117 |
\caption{caption} |
| 118 |
\endfirsthead |
| 119 |
xxx\\xxx |
| 120 |
xxx\\xxx |
| 121 |
\end{longtable} |
| 122 |
|
| 123 |
\listoftables |
| 124 |
|
| 125 |
\end{document} |
| 126 |
|
| 127 |
\endinput |