diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/ltablex/ltablex.tex |
Initial commit
Diffstat (limited to 'macros/latex/contrib/ltablex/ltablex.tex')
-rw-r--r-- | macros/latex/contrib/ltablex/ltablex.tex | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/macros/latex/contrib/ltablex/ltablex.tex b/macros/latex/contrib/ltablex/ltablex.tex new file mode 100644 index 0000000000..44a44c5eec --- /dev/null +++ b/macros/latex/contrib/ltablex/ltablex.tex @@ -0,0 +1,182 @@ +\documentclass[DIV=9, parskip=half, pagesize=auto]{scrartcl} + +\usepackage{fixltx2e} +\usepackage{etex} +\usepackage{xspace} +\usepackage{lmodern} +\usepackage[T1]{fontenc} +\usepackage{textcomp} +\usepackage[svgnames]{xcolor} +\usepackage{listings} +\usepackage{microtype} +\usepackage{hyperref} + +\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} +\newcommand*{\pkg}[1]{\textsf{#1}} +\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} +\makeatletter +\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} +\makeatother +\newcommand*{\env}[1]{\texttt{#1}} + +\addtokomafont{title}{\rmfamily} + +\lstset{% + language=[LaTeX]TeX,% + columns=flexible,% + upquote=true,% + numbers=left,% + basicstyle=\ttfamily,% + keywordstyle=\color{Navy},% + commentstyle=\color{DimGray},% + stringstyle=\color{SeaGreen},% + numberstyle=\scriptsize\color{SlateGray}% +} + +\title{The \pkg{ltablex} package\thanks{This manual corresponds to \pkg{ltablex}~v1.0, dated~1995/11/06.}} +\author{Anil K. Goel (\mail{akgoel@uwaterloo.ca})} +\date{1995/11/06} + + + +\begin{document} + +\maketitle + +\noindent +The file modifies the \env{tabularx} environment to +combine the features of the \pkg{tabularx} package +(auto-sized columns in a fixed width table) +with those of the \pkg{longtable} package +(multi-page tables). + +The tables are typeset using the \env{tabularx} environment +and the \env{longtable} environment is used internally to +handle multi-page tables. The \cmd{\setlongtables} feature +is used, and, therefore, the document should be +run through \texttt{latex} twice. + +Another feature that has been added is to treat the \texttt{X} +columns like `\texttt{l}' columns if the table contents would allow +that to happen without exceeding the specified width of +the table. In other words, the specified width is +treated as the maximum allowed and not the exact width +of the table. This feature is the default but can be +disabled (or enabled) with \cmd{\keepXColumns} (or \cmd{\convertXColumns}). + +Caveats: +% +\begin{itemize} +\item The document needs to be \texttt{latex}ed a couple times in general. +\item In general, it is necessary to remove the \texttt{.aux} file before + the first \texttt{latex} run on the document. +\item The table should not be larger than \TeX's memory capacity +\end{itemize} + +\bigskip + +Here is a a simple usage example: +% +\begin{lstlisting} +\documentclass{article} + +\usepackage{ltablex} + +\textheight=4in + +\begin{document} + +% we want a table that is \textwidth long, has 4 columns, columns 1 +% and 3 are auto sized with the 3rd columns being 3 times wider than +% the first column. +% + + +\begin{tabularx}{\linewidth}% + {% col 1; auto-sized ragged right + |>{\setlength{\hsize}{.5\hsize}\raggedright\arraybackslash}X|% + % col 2; default centered + c|% + % col 3; auto-sized ragged left + >{\setlength{\hsize}{1.5\hsize}\raggedleft\arraybackslash}X|% + % col 4; default left-justified + l|} + +\caption*{The Table Caption}\\ +\hline +F-Head1 & F-Head2 & F-Head3 & F-Head4\\ +\hline +\hline +\endfirsthead +\hline +Head1 & Head2 & Head3 & Head4\\ +\hline +\hline +\endhead + +\hline +\hline +Foot1 & Foot2 & Foot3 & Foot4\\ +\hline +\endfoot + + +\hline +\hline +L-Foot1 & L-Foot2 & L-Foot3 & L-Foot4\\ +\hline +\endlastfoot + +This is a very long sentence not likely to fit& +not too long& +This is another very long sentence not likely to fit& +not long\\ + +\hline +filler & filler & filler & filler\\ + +\hline +This is a very long sentence not likely to fit& +not too long& +This is another very long sentence not likely to fit& +not long\\ + +\hline +This is a very long sentence not likely to fit& +not too long& +This is another very long sentence not likely to fit& +not long\\ + +\hline +This is a very long sentence not likely to fit& +not too long& +This is another very long sentence not likely to fit& +not long\\ + +\end{tabularx} + +\begin{tabularx}{\linewidth}{|c|X|c|} +\hline +a &convert X to l & b\\ +\hline +\end{tabularx} + +\keepXColumns +\begin{tabularx}{\linewidth}{|c|X|c|} +\hline +a &retain X & b\\ +\hline +\end{tabularx} + +\convertXColumns +\begin{tabularx}{\linewidth}{|c|X|c|} +\hline +a &convert X to l & b\\ +\hline +\end{tabularx} + + +\end{document} +\end{lstlisting} + +\end{document} |