TexTables.jl
TexTables.jl copied to clipboard
Mixing booktabs and standard tabular commands
It seems like the output mixes \toprule and \bottomrule (booktab commands) with \hline (standard tabular command):
using TexTables
using RDatasets
neuro = RDatasets.dataset("boot", "neuro")
summarize(neuro) |> to_tex |> print
\begin{tabular}{r|ccccc}
\toprule
& Obs & Mean & Std. Dev. & Min & Max \\ \hline
V1 & 40 & -232.720 & 12.862 & -249.900 & -196.900 \\
V2 & 418 & -186.567 & 37.206 & -249.000 & -98.600 \\
V3 & 469 & -66.160 & 39.719 & -235.800 & -0.100 \\
V4 & 468 & 48.074 & 30.760 & 1.000 & 197.800 \\
V5 & 445 & 162.483 & 38.111 & 75.600 & 249.300 \\
V6 & 90 & 229.740 & 18.718 & 154.300 & 249.700 \\
\bottomrule
\end{tabular}
Please consider changing \hline to \midrule (or \toprule and \bottomrule to \hline).
Good point! This is pretty easy to change, and I agree that in this example it looks better, but I'm nervous about just changing it globally for all the tables since I don't actually know whether or not it is perfectly drop-in interchangeable with \hline.
Perhaps an option in the to_tex function? Can always change the default to pure booktab at a later date.
Sounds good. Although I always use booktabs myself, perhaps the default really should be standard latex (only hline). Maybe the best approach would be to just have a booktabs = false argument in to_tex()?