summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-05-11 23:57:47 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2016-05-11 23:57:47 -0700
commit609fb33302156348fa3f2fc6d86b9201fa17f052 (patch)
treeacae6e52d4ee7511c3bbef4f3478f23d7e5ddf5f
parent803ba9219895614276b33784d29467142bc80b29 (diff)
parentec2fc30288a376225d249728607db563fe320cc5 (diff)
Merge pull request #2913 from jlduran/strut-minipage-tables
Retake on strut with \minipage inside tables
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
-rw-r--r--tests/tables.latex144
2 files changed, 74 insertions, 74 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 804e0febc..9284d18ee 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -675,7 +675,8 @@ tableCellToLaTeX header (width, align, blocks) = do
AlignDefault -> "\\raggedright"
return $ ("\\begin{minipage}" <> valign <>
braces (text (printf "%.2f\\columnwidth" width)) <>
- (halign <> cr <> cellContents <> cr) <> "\\end{minipage}") $$
+ (halign <> "\\strut" <> cr <> cellContents <> "\\strut" <> cr) <>
+ "\\end{minipage}") $$
notesToLaTeX notes
notesToLaTeX :: [Doc] -> Doc
@@ -1306,4 +1307,3 @@ pDocumentClass =
else do P.skipMany (P.satisfy (/='{'))
P.char '{'
P.manyTill P.letter (P.char '}')
-
diff --git a/tests/tables.latex b/tests/tables.latex
index 9f3f97e53..38d4d089e 100644
--- a/tests/tables.latex
+++ b/tests/tables.latex
@@ -52,46 +52,46 @@ Multiline table with caption:
\begin{longtable}[]{@{}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
+\begin{minipage}[b]{0.13\columnwidth}\centering\strut
+Centered Header\strut
+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
+Left Aligned\strut
+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
+Right Aligned\strut
+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
+Default aligned\strut
\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
+\begin{minipage}[b]{0.13\columnwidth}\centering\strut
+Centered Header\strut
+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
+Left Aligned\strut
+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
+Right Aligned\strut
+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
+Default aligned\strut
\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.
+\begin{minipage}[t]{0.13\columnwidth}\centering\strut
+First\strut
+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
+row\strut
+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
+12.0\strut
+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
+Example of a row that spans multiple lines.\strut
\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.
+\begin{minipage}[t]{0.13\columnwidth}\centering\strut
+Second\strut
+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
+row\strut
+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
+5.0\strut
+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
+Here's another one. Note the blank line between rows.\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
@@ -100,34 +100,34 @@ Multiline table without caption:
\begin{longtable}[]{@{}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
+\begin{minipage}[b]{0.13\columnwidth}\centering\strut
+Centered Header\strut
+\end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright\strut
+Left Aligned\strut
+\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft\strut
+Right Aligned\strut
+\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright\strut
+Default aligned\strut
\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.
+\begin{minipage}[t]{0.13\columnwidth}\centering\strut
+First\strut
+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
+row\strut
+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
+12.0\strut
+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
+Example of a row that spans multiple lines.\strut
\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.
+\begin{minipage}[t]{0.13\columnwidth}\centering\strut
+Second\strut
+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
+row\strut
+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
+5.0\strut
+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
+Here's another one. Note the blank line between rows.\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
@@ -146,23 +146,23 @@ Multiline table without column headers:
\begin{longtable}[]{@{}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.
+\begin{minipage}[t]{0.13\columnwidth}\centering\strut
+First\strut
+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
+row\strut
+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
+12.0\strut
+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
+Example of a row that spans multiple lines.\strut
\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.
+\begin{minipage}[t]{0.13\columnwidth}\centering\strut
+Second\strut
+\end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright\strut
+row\strut
+\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft\strut
+5.0\strut
+\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright\strut
+Here's another one. Note the blank line between rows.\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}