Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixing booktabs and standard tabular commands #27

Open
jolars opened this issue Jan 15, 2021 · 2 comments
Open

Mixing booktabs and standard tabular commands #27

jolars opened this issue Jan 15, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@jolars
Copy link

jolars commented Jan 15, 2021

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).

@jacobadenbaum
Copy link
Owner

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.

@jolars
Copy link
Author

jolars commented Jan 15, 2021

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()?

@jacobadenbaum jacobadenbaum added the good first issue Good for newcomers label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants