| 1 |
\documentclass[DIV=9, parskip=half, pagesize=auto]{scrartcl} |
| 2 |
|
| 3 |
\usepackage{fixltx2e} |
| 4 |
\usepackage{etex} |
| 5 |
\usepackage{xspace} |
| 6 |
\usepackage{lmodern} |
| 7 |
\usepackage[T1]{fontenc} |
| 8 |
\usepackage{textcomp} |
| 9 |
\usepackage[svgnames]{xcolor} |
| 10 |
\usepackage{listings} |
| 11 |
\usepackage{microtype} |
| 12 |
\usepackage{hyperref} |
| 13 |
|
| 14 |
\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} |
| 15 |
\newcommand*{\pkg}[1]{\textsf{#1}} |
| 16 |
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} |
| 17 |
\makeatletter |
| 18 |
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} |
| 19 |
\makeatother |
| 20 |
\newcommand*{\env}[1]{\texttt{#1}} |
| 21 |
|
| 22 |
\addtokomafont{title}{\rmfamily} |
| 23 |
|
| 24 |
\lstset{% |
| 25 |
language=[LaTeX]TeX,% |
| 26 |
columns=flexible,% |
| 27 |
upquote=true,% |
| 28 |
numbers=left,% |
| 29 |
basicstyle=\ttfamily,% |
| 30 |
keywordstyle=\color{Navy},% |
| 31 |
commentstyle=\color{DimGray},% |
| 32 |
stringstyle=\color{SeaGreen},% |
| 33 |
numberstyle=\scriptsize\color{SlateGray}% |
| 34 |
} |
| 35 |
|
| 36 |
\title{The \pkg{ltablex} package\thanks{This manual corresponds to \pkg{ltablex}~v1.0, dated~1995/11/06.}} |
| 37 |
\author{Anil K. Goel (\mail{[email protected]})} |
| 38 |
\date{1995/11/06} |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
\begin{document} |
| 43 |
|
| 44 |
\maketitle |
| 45 |
|
| 46 |
\noindent |
| 47 |
The file modifies the \env{tabularx} environment to |
| 48 |
combine the features of the \pkg{tabularx} package |
| 49 |
(auto-sized columns in a fixed width table) |
| 50 |
with those of the \pkg{longtable} package |
| 51 |
(multi-page tables). |
| 52 |
|
| 53 |
The tables are typeset using the \env{tabularx} environment |
| 54 |
and the \env{longtable} environment is used internally to |
| 55 |
handle multi-page tables. The \cmd{\setlongtables} feature |
| 56 |
is used, and, therefore, the document should be |
| 57 |
run through \texttt{latex} twice. |
| 58 |
|
| 59 |
Another feature that has been added is to treat the \texttt{X} |
| 60 |
columns like `\texttt{l}' columns if the table contents would allow |
| 61 |
that to happen without exceeding the specified width of |
| 62 |
the table. In other words, the specified width is |
| 63 |
treated as the maximum allowed and not the exact width |
| 64 |
of the table. This feature is the default but can be |
| 65 |
disabled (or enabled) with \cmd{\keepXColumns} (or \cmd{\convertXColumns}). |
| 66 |
|
| 67 |
Caveats: |
| 68 |
% |
| 69 |
\begin{itemize} |
| 70 |
\item The document needs to be \texttt{latex}ed a couple times in general. |
| 71 |
\item In general, it is necessary to remove the \texttt{.aux} file before |
| 72 |
the first \texttt{latex} run on the document. |
| 73 |
\item The table should not be larger than \TeX's memory capacity |
| 74 |
\end{itemize} |
| 75 |
|
| 76 |
\bigskip |
| 77 |
|
| 78 |
Here is a a simple usage example: |
| 79 |
% |
| 80 |
\begin{lstlisting} |
| 81 |
\documentclass{article} |
| 82 |
|
| 83 |
\usepackage{ltablex} |
| 84 |
|
| 85 |
\textheight=4in |
| 86 |
|
| 87 |
\begin{document} |
| 88 |
|
| 89 |
% we want a table that is \textwidth long, has 4 columns, columns 1 |
| 90 |
% and 3 are auto sized with the 3rd columns being 3 times wider than |
| 91 |
% the first column. |
| 92 |
% |
| 93 |
|
| 94 |
|
| 95 |
\begin{tabularx}{\linewidth}% |
| 96 |
{% col 1; auto-sized ragged right |
| 97 |
|>{\setlength{\hsize}{.5\hsize}\raggedright\arraybackslash}X|% |
| 98 |
% col 2; default centered |
| 99 |
c|% |
| 100 |
% col 3; auto-sized ragged left |
| 101 |
>{\setlength{\hsize}{1.5\hsize}\raggedleft\arraybackslash}X|% |
| 102 |
% col 4; default left-justified |
| 103 |
l|} |
| 104 |
|
| 105 |
\caption*{The Table Caption}\\ |
| 106 |
\hline |
| 107 |
F-Head1 & F-Head2 & F-Head3 & F-Head4\\ |
| 108 |
\hline |
| 109 |
\hline |
| 110 |
\endfirsthead |
| 111 |
\hline |
| 112 |
Head1 & Head2 & Head3 & Head4\\ |
| 113 |
\hline |
| 114 |
\hline |
| 115 |
\endhead |
| 116 |
|
| 117 |
\hline |
| 118 |
\hline |
| 119 |
Foot1 & Foot2 & Foot3 & Foot4\\ |
| 120 |
\hline |
| 121 |
\endfoot |
| 122 |
|
| 123 |
|
| 124 |
\hline |
| 125 |
\hline |
| 126 |
L-Foot1 & L-Foot2 & L-Foot3 & L-Foot4\\ |
| 127 |
\hline |
| 128 |
\endlastfoot |
| 129 |
|
| 130 |
This is a very long sentence not likely to fit& |
| 131 |
not too long& |
| 132 |
This is another very long sentence not likely to fit& |
| 133 |
not long\\ |
| 134 |
|
| 135 |
\hline |
| 136 |
filler & filler & filler & filler\\ |
| 137 |
|
| 138 |
\hline |
| 139 |
This is a very long sentence not likely to fit& |
| 140 |
not too long& |
| 141 |
This is another very long sentence not likely to fit& |
| 142 |
not long\\ |
| 143 |
|
| 144 |
\hline |
| 145 |
This is a very long sentence not likely to fit& |
| 146 |
not too long& |
| 147 |
This is another very long sentence not likely to fit& |
| 148 |
not long\\ |
| 149 |
|
| 150 |
\hline |
| 151 |
This is a very long sentence not likely to fit& |
| 152 |
not too long& |
| 153 |
This is another very long sentence not likely to fit& |
| 154 |
not long\\ |
| 155 |
|
| 156 |
\end{tabularx} |
| 157 |
|
| 158 |
\begin{tabularx}{\linewidth}{|c|X|c|} |
| 159 |
\hline |
| 160 |
a &convert X to l & b\\ |
| 161 |
\hline |
| 162 |
\end{tabularx} |
| 163 |
|
| 164 |
\keepXColumns |
| 165 |
\begin{tabularx}{\linewidth}{|c|X|c|} |
| 166 |
\hline |
| 167 |
a &retain X & b\\ |
| 168 |
\hline |
| 169 |
\end{tabularx} |
| 170 |
|
| 171 |
\convertXColumns |
| 172 |
\begin{tabularx}{\linewidth}{|c|X|c|} |
| 173 |
\hline |
| 174 |
a &convert X to l & b\\ |
| 175 |
\hline |
| 176 |
\end{tabularx} |
| 177 |
|
| 178 |
|
| 179 |
\end{document} |
| 180 |
\end{lstlisting} |
| 181 |
|
| 182 |
\end{document} |