summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/xltabular/xltabular-example.inp
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/xltabular/xltabular-example.inp')
-rw-r--r--macros/latex/contrib/xltabular/xltabular-example.inp80
1 files changed, 80 insertions, 0 deletions
diff --git a/macros/latex/contrib/xltabular/xltabular-example.inp b/macros/latex/contrib/xltabular/xltabular-example.inp
new file mode 100644
index 0000000000..f61cc62065
--- /dev/null
+++ b/macros/latex/contrib/xltabular/xltabular-example.inp
@@ -0,0 +1,80 @@
+
+\newcommand*\showCounterTable{%
+ \noindent The Counter \textbf{table:~\arabic{table}}%
+}
+
+\begin{document}
+
+\chapter{Chapter 1}
+\section{Section 1 of Chapter 1}
+
+\showCounterTable
+\begin{xltabular}[l]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:A}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 2 of Chapter 1}
+
+\showCounterTable
+\begin{xltabular}[r]{.7\linewidth}{|c|X|X|}
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 3 of Chapter 1}
+
+\showCounterTable
+\begin{xltabular}[r]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:B}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\chapter{Chapter 2}
+\section{Section 1 of Chapter 2}
+
+\showCounterTable
+\begin{xltabular}[c]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:C}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 2 of Chapter 2}
+
+\showCounterTable
+\begin{xltabular}[c]{.7\linewidth}{|c|X|X|}
+\caption{A table with a caption\label{tab:D}} \\
+\hline
+1 & \hrulefill 2 \hrulefill & \hrulefill 3 \hrulefill \\
+4 & \hrulefill 5 \hrulefill & \hrulefill 6 \hrulefill \\
+\hline
+\end{xltabular}
+\showCounterTable
+
+\section{Section 3 of Chapter 2 -- some references}
+
+\begin{itemize}
+ \item Table~\ref{tab:A} is on page~\pageref{tab:A}
+ \item Table~\ref{tab:B} is on page~\pageref{tab:B}
+ \item Table~\ref{tab:C} is on page~\pageref{tab:C}
+ \item Table~\ref{tab:D} is on page~\pageref{tab:D}
+\end{itemize}
+
+\end{document}
+
+\endinput