aboutsummaryrefslogtreecommitdiff
path: root/test/tables
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-12-21 03:04:54 +0100
committerGitHub <noreply@github.com>2020-12-20 18:04:54 -0800
commit8f402beab922646d4c428b40a75fe4d140ab5e9e (patch)
treed805b8eabfe6a54c89ed90223f44b5535a1630bd /test/tables
parent7e98562c04be19f533bc806a8525fe203d1ede58 (diff)
downloadpandoc-8f402beab922646d4c428b40a75fe4d140ab5e9e.tar.gz
LaTeX writer: support colspans and rowspans in tables. (#6950)
Note that the multirow package is needed for rowspans. It is included in the latex template under a variable, so that it won't be used unless needed for a table.
Diffstat (limited to 'test/tables')
-rw-r--r--test/tables/nordics.latex26
-rw-r--r--test/tables/planets.latex36
-rw-r--r--test/tables/students.latex23
3 files changed, 85 insertions, 0 deletions
diff --git a/test/tables/nordics.latex b/test/tables/nordics.latex
new file mode 100644
index 000000000..d1a0b4aed
--- /dev/null
+++ b/test/tables/nordics.latex
@@ -0,0 +1,26 @@
+\begin{longtable}[]{@{}
+ >{\centering\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}}
+ >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}}
+ >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.20}}
+ >{\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})}} \\ \addlinespace
+\midrule
+\endfirsthead
+\toprule
+Name & Capital & \vtop{\hbox{\strut Population}\hbox{\strut (in 2018)}} &
+\vtop{\hbox{\strut Area}\hbox{\strut (in
+km\textsuperscript{2})}} \\ \addlinespace
+\midrule
+\endhead
+Denmark & Copenhagen & 5,809,502 & 43,094 \\ \addlinespace
+Finland & Helsinki & 5,537,364 & 338,145 \\ \addlinespace
+Iceland & Reykjavik & 343,518 & 103,000 \\ \addlinespace
+Norway & Oslo & 5,372,191 & 323,802 \\ \addlinespace
+Sweden & Stockholm & 10,313,447 & 450,295 \\ \addlinespace
+Total & & 27,376,022 & 1,258,336 \\ \addlinespace
+\bottomrule
+\end{longtable}
diff --git a/test/tables/planets.latex b/test/tables/planets.latex
new file mode 100644
index 000000000..9457b6821
--- /dev/null
+++ b/test/tables/planets.latex
@@ -0,0 +1,36 @@
+\begin{longtable}[]{@{}cclrrrrrrrrl@{}}
+\caption{Data about the planets of our solar system.}\tabularnewline
+\toprule
+\multicolumn{2}{l}{} & 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 \\ \addlinespace
+\midrule
+\endfirsthead
+\toprule
+\multicolumn{2}{l}{} & 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 \\ \addlinespace
+\midrule
+\endhead
+\multicolumn{2}{l}{\multirow{4}{*}{Terrestrial planets}} & Mercury & 0.330 &
+4,879 & 5427 & 3.7 & 4222.6 & 57.9 & 167 & 0 & Closest to the
+Sun \\ \addlinespace
+& & Venus & 4.87 & 12,104 & 5243 & 8.9 & 2802.0 & 108.2 & 464 & 0
+& \\ \addlinespace
+& & Earth & 5.97 & 12,756 & 5514 & 9.8 & 24.0 & 149.6 & 15 & 1 & Our
+world \\ \addlinespace
+& & Mars & 0.642 & 6,792 & 3933 & 3.7 & 24.7 & 227.9 & -65 & 2 & The red
+planet \\ \addlinespace
+\multirow{4}{*}{Jovian planets} & \multirow{2}{*}{Gas giants} & Jupiter & 1898
+& 142,984 & 1326 & 23.1 & 9.9 & 778.6 & -110 & 67 & The largest
+planet \\ \addlinespace
+& & Saturn & 568 & 120,536 & 687 & 9.0 & 10.7 & 1433.5 & -140 & 62
+& \\ \addlinespace
+& \multirow{2}{*}{Ice giants} & Uranus & 86.8 & 51,118 & 1271 & 8.7 & 17.2 &
+2872.5 & -195 & 27 & \\ \addlinespace
+& & Neptune & 102 & 49,528 & 1638 & 11.0 & 16.1 & 4495.1 & -200 & 14
+& \\ \addlinespace
+\multicolumn{2}{l}{Dwarf planets} & Pluto & 0.0146 & 2,370 & 2095 & 0.7 &
+153.3 & 5906.4 & -225 & 5 & Declassified as a planet in 2006. \\ \addlinespace
+\bottomrule
+\end{longtable}
diff --git a/test/tables/students.latex b/test/tables/students.latex
new file mode 100644
index 000000000..680a539d3
--- /dev/null
+++ b/test/tables/students.latex
@@ -0,0 +1,23 @@
+\begin{longtable}[]{@{}
+ >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}}
+ >{\raggedright\arraybackslash}p{(\columnwidth - 2\tabcolsep) * \real{0.50}}@{}}
+\caption{List of Students}\tabularnewline
+\toprule
+Student ID & Name \\ \addlinespace
+\midrule
+\endfirsthead
+\toprule
+Student ID & Name \\ \addlinespace
+\midrule
+\endhead
+\multicolumn{2}{l}{Computer Science} \\ \addlinespace
+3741255 & Jones, Martha \\ \addlinespace
+4077830 & Pierce, Benjamin \\ \addlinespace
+5151701 & Kirk, James \\ \addlinespace
+\multicolumn{2}{l}{Russian Literature} \\ \addlinespace
+3971244 & Nim, Victor \\ \addlinespace
+\multicolumn{2}{l}{Astrophysics} \\ \addlinespace
+4100332 & Petrov, Alexandra \\ \addlinespace
+4100332 & Toyota, Hiroko \\ \addlinespace
+\bottomrule
+\end{longtable}