aboutsummaryrefslogtreecommitdiff
path: root/test/tables
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-06-05 14:13:58 -0600
committerJohn MacFarlane <jgm@berkeley.edu>2021-06-05 14:13:58 -0600
commit21cc52abe33997ea2f2c539f10d26684b7633bc0 (patch)
tree0696a72ee641bfdf51289ede94c7a5c0603c7886 /test/tables
parentc550bf8482310dfbcb20694e7bc969d19acc5f7d (diff)
downloadpandoc-21cc52abe33997ea2f2c539f10d26684b7633bc0.tar.gz
LaTeX writer: Fix regression in table header position.
In recent versions the table headers were no longer bottom-aligned (if more than one line). This patch fixes that by using minipages for table headers in non-simple tables. Closes #7347.
Diffstat (limited to 'test/tables')
-rw-r--r--test/tables/nordics.latex26
-rw-r--r--test/tables/planets.latex8
-rw-r--r--test/tables/students.latex12
3 files changed, 36 insertions, 10 deletions
diff --git a/test/tables/nordics.latex b/test/tables/nordics.latex
index 1b5929bad..1dcac7319 100644
--- a/test/tables/nordics.latex
+++ b/test/tables/nordics.latex
@@ -5,13 +5,31 @@
>{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.20}}@{}}
\caption{States belonging to the \emph{Nordics.}}\tabularnewline
\toprule
-Name & Capital & \vtop{\hbox{\strut Population}\hbox{\strut (in 2018)}} &
-\vtop{\hbox{\strut Area}\hbox{\strut (in km\textsuperscript{2})}} \\
+\begin{minipage}[b]{\linewidth}\centering
+Name
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Capital
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Population\\
+(in 2018)
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Area\\
+(in km\textsuperscript{2})
+\end{minipage} \\
\midrule
\endfirsthead
\toprule
-Name & Capital & \vtop{\hbox{\strut Population}\hbox{\strut (in 2018)}} &
-\vtop{\hbox{\strut Area}\hbox{\strut (in km\textsuperscript{2})}} \\
+\begin{minipage}[b]{\linewidth}\centering
+Name
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Capital
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Population\\
+(in 2018)
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Area\\
+(in km\textsuperscript{2})
+\end{minipage} \\
\midrule
\endhead
Denmark & Copenhagen & 5,809,502 & 43,094 \\
diff --git a/test/tables/planets.latex b/test/tables/planets.latex
index 8238c43f3..b22c3adeb 100644
--- a/test/tables/planets.latex
+++ b/test/tables/planets.latex
@@ -1,18 +1,18 @@
\begin{longtable}[]{@{}cclrrrrrrrrl@{}}
\caption{Data about the planets of our solar system.}\tabularnewline
\toprule
-\multicolumn{2}{l}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
+\multicolumn{2}{c}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
(kg/m\^{}3) & Gravity (m/s\^{}2) & Length of day (hours) & Distance from Sun
(10\^{}6km) & Mean temperature (C) & Number of moons & Notes \\
\midrule
\endfirsthead
\toprule
-\multicolumn{2}{l}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
+\multicolumn{2}{c}{} & Name & Mass (10\^{}24kg) & Diameter (km) & Density
(kg/m\^{}3) & Gravity (m/s\^{}2) & Length of day (hours) & Distance from Sun
(10\^{}6km) & Mean temperature (C) & Number of moons & Notes \\
\midrule
\endhead
-\multicolumn{2}{l}{\multirow{4}{*}{Terrestrial planets}} & Mercury & 0.330 &
+\multicolumn{2}{c}{\multirow{4}{*}{Terrestrial planets}} & Mercury & 0.330 &
4,879 & 5427 & 3.7 & 4222.6 & 57.9 & 167 & 0 & Closest to the Sun \\
& & Venus & 4.87 & 12,104 & 5243 & 8.9 & 2802.0 & 108.2 & 464 & 0 & \\
& & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our world \\
@@ -24,7 +24,7 @@ planet \\
& \multirow{2}{*}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 &
2872.5 & -195 & 27 & \\
& & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14 & \\
-\multicolumn{2}{l}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 &
+\multicolumn{2}{c}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 &
153.3 & 5906.4 & -225 & 5 & Declassified as a planet in 2006. \\
\bottomrule
\end{longtable}
diff --git a/test/tables/students.latex b/test/tables/students.latex
index 87efb0851..3d4d287d9 100644
--- a/test/tables/students.latex
+++ b/test/tables/students.latex
@@ -3,11 +3,19 @@
>{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}}@{}}
\caption{List of Students}\tabularnewline
\toprule
-Student ID & Name \\
+\begin{minipage}[b]{\linewidth}\centering
+Student ID
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Name
+\end{minipage} \\
\midrule
\endfirsthead
\toprule
-Student ID & Name \\
+\begin{minipage}[b]{\linewidth}\centering
+Student ID
+\end{minipage} & \begin{minipage}[b]{\linewidth}\centering
+Name
+\end{minipage} \\
\midrule
\endhead
\multicolumn{2}{l}{Computer Science} \\