pandoc/tests/tables.latex
Jose Luis Duran f1d330b7b5 LaTeX writer: Fix tables
- [x] Fix a bug introduced in 66378062b6, which
  causes the table caption to repeat across all pages
- [x] Address the issues discussed
  [here](https://groups.google.com/forum/#!msg/pandoc-discuss/qMu6_5lYy0o/ZAU7lzAIKw0J)
  regarding the extra vertical space.
  - [ ] NOTE: This will cause multiline table cells to appear unpadded. See
    http://tex.stackexchange.com/questions/34971
  - [x] Use [`\tabularnewline`](http://tex.stackexchange.com/questions/78796)
    instead of `\\`.
2014-08-28 02:02:20 +00:00

168 lines
4.7 KiB
Text

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