Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I duplicate the example in longtable.pdf? I see several features in the example table from the longtable package documentation pages 2 & 3. I want to build an example from that table. I can see it in the dtx, but cannot get my sample to work.

share|improve this question
    
The answer to your question is in the dtx as you note. You should ask your real question. As it stands, we have no idea what your problem is. –  TH. Apr 28 '11 at 5:25
    
My real question is how can i read and play with the example. The dtx format is not clear. I do not care about the formatting of the rest of the article, just the example. –  sbj3 Apr 28 '11 at 15:34
add comment

1 Answer

up vote 3 down vote accepted

I just copied and pasted the table, removed the comments, and then added the definition of \env and \v and made " a short verb command, more or less the same way that longtable.dtx does.

\documentclass{article}
\usepackage{longtable}
\usepackage{shortvrb}
\newcommand*\env[1]{\textsl{#1}}
\MakeShortVerb{\"}
\def\v{\char`}
\begin{document}
\begin{longtable}{@{*}r||p{1in}@{*}}
KILLED & LINE!!!! \kill
\caption
[An optional table caption (used in the list of tables)]
{A long table\label{long}}\\
\hline\hline
\multicolumn{2}{@{*}c@{*}}%
     {This part appears at the top of the table}\\
\textsc{First}&\textsc{Second}\\
\hline\hline
\endfirsthead
\caption[]{(continued)}\\
\hline\hline
\multicolumn{2}{@{*}c@{*}}%
      {This part appears at the top of every other page}\\
\textbf{First}&\textbf{Second}\\
\hline\hline
\endhead
\hline
This goes at the&bottom.\\
\hline
\endfoot
\hline
These lines will&appear\\
in place of the & usual foot\\
at the end& of the table\\
\hline
\endlastfoot
\env{longtable}  columns  are specified& in the \\
same way as  in the \env{tabular}& environment.\\
"@{*}r||p{1in}@{*}"& in this case.\\
Each row ends with a& "\\" command.\\
The "\\"  command  has an& optional\\
argument, just as in& the\\
 \env{tabular}&environment.\\[10pt]
See the  effect  of "\\[10pt]"&?\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Also  "\hline"  may be used,&  as in \env{tabular}.\\
\hline
That  was a "\hline"&.\\
\hline\hline
That  was "\hline\hline"&.\\
\multicolumn{2}{||c||}%
{This is a \ttfamily\v\\multicolumn\v{2\v}\v{||c||\v}}\\
If a  page break  occurs at a "\hline" then& a line is drawn\\
at the bottom of one  page  and at the& top of the next.\\
\hline
The  "[t] [b] [c]"  argument of \env{tabular}& can  not be used.\\
The optional argument may be  one of& "[l] [r] [c]"\\
to specify whether  the  table  should be& adjusted\\
to the  left, right& or centrally.\\
\hline\hline
L    ots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Some lines may take up a lot of space, like this: &
    \raggedleft This last column is a ``p'' column so this
    ``row'' of the table can take up several lines. Note however that
    \TeX\ will  never break a page within such a row. Page breaks only
    occur between rows of the table or at "\hline" commands.
    \tabularnewline
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
Lots of lines& like this.\\
\hline
Lots\footnote{This is a footnote.} of lines& like this.\\
Lots   of   lines& like this\footnote{\env{longtable} takes special
    precautions, so that footnotes may also be used in `p' columns.}\\
\hline
Lots of lines& like this.\\
Lots of lines& like this.
\end{longtable}
\end{document}
share|improve this answer
    
Thanks. Your earlier comment and down votes assume that I know enough about Latex commands to know what is important in the dtx file. I did not. I do a little more now. –  sbj3 Apr 28 '11 at 20:50
    
@sbj3: I didn't down vote your question. I didn't vote on it at all. –  TH. Apr 29 '11 at 18:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.