git.iko.soy/typeable/pandoc
on master help sign in
Revert "LaTeX writer: Add `\strut` to fix multiline tables"

This reverts commit 4c684561ee0665b014e887ae559b7020e4e9f2d3. See https://groups.google.com/d/msg/pandoc-discuss/u6J-_aCProU/UufN3IYRAgAJ This should fix uneven spacing issues in multiline tables.

commit32f1b0a5f14c93271aaf42acaa9d06c4e59c1604 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 27 Apr 2016, 17:25 (11 years ago) parentece215e
2 files changed+46−47
src/Text/Pandoc/Writers/LaTeX.hs+1−2 tests/tables.latex+45−45
src/Text/Pandoc/Writers/LaTeX.hs+1−2
@@ -669,8 +669,7 @@ tableCellToLaTeX header (width, align, blocks) = do
669669 AlignDefault -> "\\raggedright"
670670 return $ ("\\begin{minipage}" <> valign <>
671671 braces (text (printf "%.2f\\columnwidth" width)) <>
672− (halign <> "\\strut" <> cr <> cellContents <> cr) <>
673− "\\strut\\end{minipage}") $$
672+ (halign <> cr <> cellContents <> cr) <> "\\end{minipage}") $$
674673 notesToLaTeX notes
675674
676675notesToLaTeX :: [Doc] -> Doc
tests/tables.latex+45−45
@@ -52,47 +52,47 @@ Multiline table with caption:
5252\begin{longtable}[]{@{}clrl@{}}
5353\caption{Here's the caption. It may span multiple lines.}\tabularnewline
5454\toprule
55−\begin{minipage}[b]{0.13\columnwidth}\centering\strut
55+\begin{minipage}[b]{0.13\columnwidth}\centering
5656Centered Header
57−\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
57+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright
5858Left Aligned
59−\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
59+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
6060Right Aligned
61−\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
61+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
6262Default aligned
63−\strut\end{minipage}\tabularnewline
63+\end{minipage}\tabularnewline
6464\midrule
6565\endfirsthead
6666\toprule
67−\begin{minipage}[b]{0.13\columnwidth}\centering\strut
67+\begin{minipage}[b]{0.13\columnwidth}\centering
6868Centered Header
69−\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
69+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright
7070Left Aligned
71−\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
71+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
7272Right Aligned
73−\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
73+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
7474Default aligned
75−\strut\end{minipage}\tabularnewline
75+\end{minipage}\tabularnewline
7676\midrule
7777\endhead
78−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
78+\begin{minipage}[t]{0.13\columnwidth}\centering
7979First
80−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
80+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
8181row
82−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
82+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
838312.0
84−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
84+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
8585Example of a row that spans multiple lines.
86−\strut\end{minipage}\tabularnewline
87−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
86+\end{minipage}\tabularnewline
87+\begin{minipage}[t]{0.13\columnwidth}\centering
8888Second
89−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
89+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
9090row
91−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
91+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
92925.0
93−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
93+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
9494Here's another one. Note the blank line between rows.
95−\strut\end{minipage}\tabularnewline
95+\end{minipage}\tabularnewline
9696\bottomrule
9797\end{longtable}
9898
@@ -100,35 +100,35 @@ Multiline table without caption:
100100
101101\begin{longtable}[]{@{}clrl@{}}
102102\toprule
103−\begin{minipage}[b]{0.13\columnwidth}\centering\strut
103+\begin{minipage}[b]{0.13\columnwidth}\centering
104104Centered Header
105−\strut\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
105+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright
106106Left Aligned
107−\strut\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
107+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
108108Right Aligned
109−\strut\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
109+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
110110Default aligned
111−\strut\end{minipage}\tabularnewline
111+\end{minipage}\tabularnewline
112112\midrule
113113\endhead
114−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
114+\begin{minipage}[t]{0.13\columnwidth}\centering
115115First
116−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
116+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
117117row
118−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
118+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
11911912.0
120−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
120+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
121121Example of a row that spans multiple lines.
122−\strut\end{minipage}\tabularnewline
123−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
122+\end{minipage}\tabularnewline
123+\begin{minipage}[t]{0.13\columnwidth}\centering
124124Second
125−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
125+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
126126row
127−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
127+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
1281285.0
129−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
129+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
130130Here's another one. Note the blank line between rows.
131−\strut\end{minipage}\tabularnewline
131+\end{minipage}\tabularnewline
132132\bottomrule
133133\end{longtable}
134134
@@ -146,23 +146,23 @@ Multiline table without column headers:
146146
147147\begin{longtable}[]{@{}clrl@{}}
148148\toprule
149−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
149+\begin{minipage}[t]{0.13\columnwidth}\centering
150150First
151−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
151+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
152152row
153−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
153+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
15415412.0
155−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
155+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
156156Example of a row that spans multiple lines.
157−\strut\end{minipage}\tabularnewline
158−\begin{minipage}[t]{0.13\columnwidth}\centering\strut
157+\end{minipage}\tabularnewline
158+\begin{minipage}[t]{0.13\columnwidth}\centering
159159Second
160−\strut\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
160+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright
161161row
162−\strut\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
162+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
1631635.0
164−\strut\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
164+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
165165Here's another one. Note the blank line between rows.
166−\strut\end{minipage}\tabularnewline
166+\end{minipage}\tabularnewline
167167\bottomrule
168168\end{longtable}