pandoc/tests/tables.latex
John MacFarlane fc4ae15337 LaTeX writer: Don't use \endhead with longtable.
It causes the heading to be a different size form the body,
sometimes.
2012-09-15 20:40:48 -07:00

169 lines
3.7 KiB
Text

Simple table with caption:
\begin{longtable}[c]{rlcl}
\hline\noalign{\medskip}
Right & Left & Center & Default
\\\noalign{\medskip}
\hline\noalign{\medskip}
12 & 12 & 12 & 12
\\\noalign{\medskip}
123 & 123 & 123 & 123
\\\noalign{\medskip}
1 & 1 & 1 & 1
\\\noalign{\medskip}
\hline
\noalign{\medskip}
\caption{Demonstration of simple table syntax.}
\end{longtable}
Simple table without caption:
\begin{longtable}[c]{rlcl}
\hline\noalign{\medskip}
Right & Left & Center & Default
\\\noalign{\medskip}
\hline\noalign{\medskip}
12 & 12 & 12 & 12
\\\noalign{\medskip}
123 & 123 & 123 & 123
\\\noalign{\medskip}
1 & 1 & 1 & 1
\\\noalign{\medskip}
\hline
\end{longtable}
Simple table indented two spaces:
\begin{longtable}[c]{rlcl}
\hline\noalign{\medskip}
Right & Left & Center & Default
\\\noalign{\medskip}
\hline\noalign{\medskip}
12 & 12 & 12 & 12
\\\noalign{\medskip}
123 & 123 & 123 & 123
\\\noalign{\medskip}
1 & 1 & 1 & 1
\\\noalign{\medskip}
\hline
\noalign{\medskip}
\caption{Demonstration of simple table syntax.}
\end{longtable}
Multiline table with caption:
\begin{longtable}[c]{clrl}
\hline\noalign{\medskip}
\parbox[b]{0.15\columnwidth}{\centering
Centered Header
} & \parbox[b]{0.14\columnwidth}{\raggedright
Left Aligned
} & \parbox[b]{0.16\columnwidth}{\raggedleft
Right Aligned
} & \parbox[b]{0.34\columnwidth}{\raggedright
Default aligned
}
\\\noalign{\medskip}
\hline\noalign{\medskip}
\parbox[t]{0.15\columnwidth}{\centering
First
} & \parbox[t]{0.14\columnwidth}{\raggedright
row
} & \parbox[t]{0.16\columnwidth}{\raggedleft
12.0
} & \parbox[t]{0.34\columnwidth}{\raggedright
Example of a row that spans multiple lines.
}
\\\noalign{\medskip}
\parbox[t]{0.15\columnwidth}{\centering
Second
} & \parbox[t]{0.14\columnwidth}{\raggedright
row
} & \parbox[t]{0.16\columnwidth}{\raggedleft
5.0
} & \parbox[t]{0.34\columnwidth}{\raggedright
Here's another one. Note the blank line between rows.
}
\\\noalign{\medskip}
\hline
\noalign{\medskip}
\caption{Here's the caption. It may span multiple lines.}
\end{longtable}
Multiline table without caption:
\begin{longtable}[c]{clrl}
\hline\noalign{\medskip}
\parbox[b]{0.15\columnwidth}{\centering
Centered Header
} & \parbox[b]{0.14\columnwidth}{\raggedright
Left Aligned
} & \parbox[b]{0.16\columnwidth}{\raggedleft
Right Aligned
} & \parbox[b]{0.34\columnwidth}{\raggedright
Default aligned
}
\\\noalign{\medskip}
\hline\noalign{\medskip}
\parbox[t]{0.15\columnwidth}{\centering
First
} & \parbox[t]{0.14\columnwidth}{\raggedright
row
} & \parbox[t]{0.16\columnwidth}{\raggedleft
12.0
} & \parbox[t]{0.34\columnwidth}{\raggedright
Example of a row that spans multiple lines.
}
\\\noalign{\medskip}
\parbox[t]{0.15\columnwidth}{\centering
Second
} & \parbox[t]{0.14\columnwidth}{\raggedright
row
} & \parbox[t]{0.16\columnwidth}{\raggedleft
5.0
} & \parbox[t]{0.34\columnwidth}{\raggedright
Here's another one. Note the blank line between rows.
}
\\\noalign{\medskip}
\hline
\end{longtable}
Table without column headers:
\begin{longtable}[c]{rlcr}
\hline\noalign{\medskip}
12 & 12 & 12 & 12
\\\noalign{\medskip}
123 & 123 & 123 & 123
\\\noalign{\medskip}
1 & 1 & 1 & 1
\\\noalign{\medskip}
\hline
\end{longtable}
Multiline table without column headers:
\begin{longtable}[c]{clrl}
\hline\noalign{\medskip}
\parbox[t]{0.15\columnwidth}{\centering
First
} & \parbox[t]{0.14\columnwidth}{\raggedright
row
} & \parbox[t]{0.16\columnwidth}{\raggedleft
12.0
} & \parbox[t]{0.34\columnwidth}{\raggedright
Example of a row that spans multiple lines.
}
\\\noalign{\medskip}
\parbox[t]{0.15\columnwidth}{\centering
Second
} & \parbox[t]{0.14\columnwidth}{\raggedright
row
} & \parbox[t]{0.16\columnwidth}{\raggedleft
5.0
} & \parbox[t]{0.34\columnwidth}{\raggedright
Here's another one. Note the blank line between rows.
}
\\\noalign{\medskip}
\hline
\end{longtable}