git.iko.soy/typeable/pandoc
on master help sign in
Revert "LaTeX writer: Add `\strut` to fix multiline tables"
32f1b0aJohn MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+1−2
@@ -669,8 +669,7 @@ tableCellToLaTeX header (width, align, blocks) = do
669 AlignDefault -> "\\raggedright"
669 AlignDefault -> "\\raggedright"
670 return $ ("\\begin{minipage}" <> valign <>
670 return $ ("\\begin{minipage}" <> valign <>
671 braces (text (printf "%.2f\\columnwidth" width)) <>
671 braces (text (printf "%.2f\\columnwidth" width)) <>
672− (halign <> "\\strut" <> cr <> cellContents <> cr) <>
672+ (halign <> cr <> cellContents <> cr) <> "\\end{minipage}") $$
673− "\\strut\\end{minipage}") $$
674 notesToLaTeX notes
673 notesToLaTeX notes
675
674
676notesToLaTeX :: [Doc] -> Doc
675notesToLaTeX :: [Doc] -> Doc
tests/tables.latex+45−45
@@ -52,47 +52,47 @@ Multiline table with caption:
52\begin{longtable}[]{@{}clrl@{}}
52\begin{longtable}[]{@{}clrl@{}}
53\caption{Here's the caption. It may span multiple lines.}\tabularnewline
53\caption{Here's the caption. It may span multiple lines.}\tabularnewline
54\toprule
54\toprule
55−\begin{minipage}[b]{0.13\columnwidth}\centering\strut
55+\begin{minipage}[b]{0.13\columnwidth}\centering
56Centered Header
56Centered Header
57−\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
57+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright
58Left Aligned
58Left Aligned
59−\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
59+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
60Right Aligned
60Right Aligned
61−\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
61+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
62Default aligned
62Default aligned
63−\strut\end{minipage}\tabularnewline
63+\end{minipage}\tabularnewline
64\midrule
64\midrule
65\endfirsthead
65\endfirsthead
66\toprule
66\toprule
67−\begin{minipage}[b]{0.13\columnwidth}\centering\strut
67+\begin{minipage}[b]{0.13\columnwidth}\centering
68Centered Header
68Centered Header
69−\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
69+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright
70Left Aligned
70Left Aligned
71−\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
71+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
72Right Aligned
72Right Aligned
73−\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
73+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
74Default aligned
74Default aligned
75−\strut\end{minipage}\tabularnewline
75+\end{minipage}\tabularnewline
76\midrule
76\midrule
77\endhead
77\endhead
78−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
78+\begin{minipage}[t]{0.13\columnwidth}\centering
79First
79First
80−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
80+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
81row
81row
82−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
82+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
8312.0
8312.0
84−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
84+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
85Example of a row that spans multiple lines.
85Example of a row that spans multiple lines.
86−\strut\end{minipage}\tabularnewline
86+\end{minipage}\tabularnewline
87−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
87+\begin{minipage}[t]{0.13\columnwidth}\centering
88Second
88Second
89−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
89+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
90row
90row
91−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
91+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
925.0
925.0
93−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
93+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
94Here's another one. Note the blank line between rows.
94Here's another one. Note the blank line between rows.
95−\strut\end{minipage}\tabularnewline
95+\end{minipage}\tabularnewline
96\bottomrule
96\bottomrule
97\end{longtable}
97\end{longtable}
98
98
@@ -100,35 +100,35 @@ Multiline table without caption:
100
100
101\begin{longtable}[]{@{}clrl@{}}
101\begin{longtable}[]{@{}clrl@{}}
102\toprule
102\toprule
103−\begin{minipage}[b]{0.13\columnwidth}\centering\strut
103+\begin{minipage}[b]{0.13\columnwidth}\centering
104Centered Header
104Centered Header
105−\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
105+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright
106Left Aligned
106Left Aligned
107−\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
107+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
108Right Aligned
108Right Aligned
109−\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
109+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
110Default aligned
110Default aligned
111−\strut\end{minipage}\tabularnewline
111+\end{minipage}\tabularnewline
112\midrule
112\midrule
113\endhead
113\endhead
114−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
114+\begin{minipage}[t]{0.13\columnwidth}\centering
115First
115First
116−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
116+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
117row
117row
118−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
118+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
11912.0
11912.0
120−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
120+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
121Example of a row that spans multiple lines.
121Example of a row that spans multiple lines.
122−\strut\end{minipage}\tabularnewline
122+\end{minipage}\tabularnewline
123−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
123+\begin{minipage}[t]{0.13\columnwidth}\centering
124Second
124Second
125−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
125+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
126row
126row
127−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
127+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
1285.0
1285.0
129−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
129+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
130Here's another one. Note the blank line between rows.
130Here's another one. Note the blank line between rows.
131−\strut\end{minipage}\tabularnewline
131+\end{minipage}\tabularnewline
132\bottomrule
132\bottomrule
133\end{longtable}
133\end{longtable}
134
134
@@ -146,23 +146,23 @@ Multiline table without column headers:
146
146
147\begin{longtable}[]{@{}clrl@{}}
147\begin{longtable}[]{@{}clrl@{}}
148\toprule
148\toprule
149−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
149+\begin{minipage}[t]{0.13\columnwidth}\centering
150First
150First
151−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
151+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
152row
152row
153−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
153+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
15412.0
15412.0
155−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
155+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
156Example of a row that spans multiple lines.
156Example of a row that spans multiple lines.
157−\strut\end{minipage}\tabularnewline
157+\end{minipage}\tabularnewline
158−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
158+\begin{minipage}[t]{0.13\columnwidth}\centering
159Second
159Second
160−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
160+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
161row
161row
162−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
162+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
1635.0
1635.0
164−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
164+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
165Here's another one. Note the blank line between rows.
165Here's another one. Note the blank line between rows.
166−\strut\end{minipage}\tabularnewline
166+\end{minipage}\tabularnewline
167\bottomrule
167\bottomrule
168\end{longtable}
168\end{longtable}