A package providing some additional commands to enhance the quality of tables in LaTeX.

learn more… | top users | synonyms

38
votes
1answer
2k views

booktabs: What is the difference between \toprule and \hline

The horizontal lines in tabular environment can be constructed. What is the difference between \toprule, \midrule, \bottomrule and specifying horizontal line using \hline?
27
votes
3answers
7k views

Professional-looking tables with alternating row colors?

Both the Booktabs documentation and the Small Guide to Making Nice Tables provide some nice rules-of-thumb for making professional-looking tables (e.g., no double rules, no vertical rules, etc.) Q: ...
21
votes
2answers
451 views

Add \midrule Every 5 Lines Automatically

I wrote a table listing scores of 40 students using booktabs package. How to write midrule command automatically every 5 rows? \documentclass{article} \usepackage{booktabs} \begin{document} ...
19
votes
6answers
2k views

How to increase row height while using booktabs?

I'm making a table using booktabs. One of the columns contains a series of fractions. \documentclass[12pt, letterpaper]{article} \usepackage{nag} \usepackage[margin=1.0in]{geometry} ...
14
votes
1answer
5k views

Coloring columns in a table with colortbl and booktabs

I have created a rather complicated table with some columns that I want to color. For the table, I chose the booktabs and tabularx packages. For coloring the columns, I use colortbl. The problem that ...
14
votes
1answer
633 views

\cmidrule with booktabs in beamer does not show up

I am trying to use a coloured \cmidrule in a table in beamer - however, it does not show up. I have read Strange disappearing colored rules in beamer which indicates that this is a bug and discusses ...
13
votes
2answers
587 views

Slovak (and Czech) babel gives problems with cmidrule and cline

I tried to use the Slovak language with the booktabs package. Let's see a couple of cases. slovak is included in the options to babel \usepackage[english,slovak]{babel} or ...
12
votes
1answer
1k views

Use of \midrule in booktabs table

Are there any formal guidelines/suggestions on the use of \midrule inside a booktabs table with just rows of identically formatted data? The booktabs manual is very specific about vertical rules, ...
11
votes
3answers
791 views

Horrible table layout

I have a table which gives an overview of some theory. It includes a lot of words or combination of words. The layout is horrible and not LaTeX quality. Some guidance as to how to improve would be ...
11
votes
2answers
497 views

Table using booktabs and cellcolor looks ugly

When using \cellcolor in a booktabs table, I find that the output is not really appealing: I don't really care that the colored cell does not touch the lines above and below (cf. Coloring columns ...
10
votes
1answer
112 views

Booktabs and row color

As you may know, there is a problem of white space when you try to color rows with book tabs. I found the above solution. However, when you use @{} in \begin{tabular}{@{}*{6}{>$c<$}@{}} (in ...
10
votes
1answer
2k views

Vertical table lines are discontinuous with booktabs

I created a table in LaTeX, but there are some problems with the borders. The borders remain open whereas I want them closed. Also, in the last row, I want the vertical line gone, ie I want just one ...
9
votes
2answers
3k views

\midrule dashed and colored in booktabs — two kinds of midrules in one booktab

Is it possible to make two \midrules in one booktab? The first one should be colored, the second one colored and dashed, as it is shown in the picture. Before each entry is a horizontal space - how to ...
9
votes
1answer
460 views

Wrapping \cmidrule in a macro

In my earlier solution for Multivariate polynomial long division using LaTeX I had wrapped \cmidrule in a macro as its syntax alowing to shorten the end points was not standard: ...
9
votes
3answers
3k views

Fill space with dots within table

I would like the whitespace between two items within a table to be filled with dots. Please consider the following picture to get the idea. So far I tried to achieve this output with the following ...
8
votes
3answers
161 views

Is it possible to create a barchart in a table?

I'm using booktabs to display some profiling data. I would like to add bars to each row to visually indicate the quantities in one column. I would like to use a table instead of a barchart since ...
8
votes
1answer
431 views

How can I make a table like the type in this image in LaTeX?

I'm trying to make a table like the one in following image in LaTeX but I'm unsure how to go about it. I've been using the tabular environment from the booktabs package, but the following code ...
8
votes
1answer
5k views

Vertical lines are being broken up (disrupted) by the horizontal booktabs lines

My vertical lines are being broken up (disrupted) by horizontal booktabs lines. How can I fix this? It's well and good to say use \hline but I also need a cmidrule that spans only the second two ...
7
votes
3answers
186 views

Table inside enumeration: How to align vertically when using booktabs' \toprule?

I want to display a table inside an enumerate environment such that the first row aligns with the item label. My current code is the following: \documentclass{article} \usepackage{enumitem} ...
7
votes
2answers
2k views

Longtable does not break correctly when used with \specialrule instead of \hline

I'm writing an application that generate latex code, therefore the solution must be the most generic possible to ensure that it will generate clean pdf all the time. I would like to let my users ...
7
votes
1answer
797 views

How to omit vertical realignment when using cmidrule in different colors?

My question is similar to the one here How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule? but can not be solved with the suggested answer (because the lines are ...
6
votes
2answers
8k views

Problems with \toprule and \midrule in a table

Having the following siunitx table code in LyX, for each occurrence of \toprule and \midrule I obtain an error message: The control sequence at the end of the top line of your error message was ...
6
votes
2answers
830 views

\cmidrule with two multirows not behaving correctly?

Here is the code: \begin{table} \centering \begin{tabular}{rrrrr} \toprule \multirow{2}{*}{b} & \multicolumn{2}{c}{QCDH} & Single & \multirow{2}{*}{$\frac{\pi_{q1}}{\pi_{s1}}$} \\ ...
6
votes
1answer
217 views

booktabs's horizontal rules aren't displayed with cifa document class

There seems to be a problem between the CIFA document class and the booktabs package. When I compile the following code, the horizontal lines are not displayed: \documentclass{cifa} ...
6
votes
1answer
379 views

Decimals in table don't align with dcolumn when bolded

I am making a table using booktabs and dcolumn. It works perfectly until I tried to bold one of the numbers and then the decimals won't read properly. Are there any workaround here? ...
6
votes
1answer
950 views

Midrule that extends only over some of the columns in booktabs

I hope this isn't a silly question, the thing is that I want to create a table with a midrule applied in just some cells, I mean something like that (just between Item, Animal and Description): ...
5
votes
3answers
281 views

slim braces in a table

We need to make clear that certain data is the same in several rows. An underbrace taken from math-mode does the job quite well, but is unfortunately way too prominent in the table, especially in ...
5
votes
6answers
267 views

ltablex and booktabs

I need a table which is larger than one page and it should have a fixed size. To improve the look, I use booktabs. However, the foot of the table is not nice on all pages, except on the last page. ...
5
votes
3answers
4k views

Formatting table border and text alignment in LaTeX table

I have the following table in the .tex file: \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table}[htbp] \centering \caption{Distribution of Number of Injured ...
5
votes
1answer
4k views

\midrule before \endhead in longtable environment with booktabs package

I am trying to use longtable with repeating headers on each page. For example: Column 1 & Column 2 & Column 3 \endhead \midrule results in an ugly multi-page table. The horizontal rule ...
5
votes
1answer
427 views

How to trim the length of \toprule? [duplicate]

How to trim \toprule (from booktabs package)? It is probably something basic I'm missing, but I need it and it's nowhere to be found.
5
votes
1answer
46 views

Overhang parameter of rowcolor changes overhang of each cell, not just the row

I want to highlight a few rows in a table, and used \rowcolor as per the first table. Well, this results in the row coloring being wider than I desire, so I thought the simple fix would be to adjust ...
5
votes
1answer
2k views

Big table with rotated column labels using booktabs

I'm trying to get a big table to fit into my document using the booktabs package, but it is too wide. An example of a couple of rows of the table is given below. I'm using the ...
5
votes
1answer
1k views

multirow and text wrapping

I have a problem using multirow along with text wrapping when spanning cell contains a lot of text. Here is my code: \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} ...
4
votes
2answers
159 views

Compiling problem

I have had the problem of compiling my document with the following table in it: \begin{table}[!h] \centering\small \caption{Thickness measurements on the two tubes.} \label{tab:Thickness_measurement} ...
4
votes
2answers
133 views

Do the different rules generated by booktabs have the same thickness?

I use the booktabs package and excel2latex to generate my tables. I work in TeXmaker. As I zoom in or zoom out on my table, I find that, sometimes the \toprule, sometimes \midrule and sometimes the ...
4
votes
2answers
96 views

How to trim horizontal line ends in table with vertical lines?

How to obtain something like this ? The only way for trimming horizontal line in table that I found is using booktabs. The problem with booktabs is that it doesn't manage good vertical lines. I ...
4
votes
2answers
1k views

Longtable width exceeds page

I saw these topics and sure they help a lot, Resize longtable to width of landscape page How to fit landscape multi-page table to textwidth But still it does not fix my problem for some reason. I ...
4
votes
1answer
692 views

How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule?

I'm using consecutive \cmidrule commands in conjunction with \arrayrulecolor to alternately hide and unhide horizontal rules in a table. However, when \arrayrulecolor is used with \cmidrule, some odd ...
4
votes
1answer
160 views

Serious problems with table layout

I have some issues when creating my OLS regression in LaTeX and really hope, that some of you could help me. (I do not know how to make more columns and to add text like: ...
4
votes
1answer
4k views

Equations inside tabular environment, no vertical spacing

I have a problem with the spacing of my equations. According to this http://tex.stackexchange.com/a/50348/15360 booktabs one should rarely have to regulate the spacing. But the result of the code ...
4
votes
1answer
608 views

How can I use renewcommand for toprule of the booktabs package?

I have a LaTeX document and want to change the thickness of \toprule and \bottomrule to 1.5pt. Is there a way to do this with the \renewcommand or do I have to change every \toprule to ...
4
votes
2answers
3k views

Vertical alignment using multirow and booktabs

I'm trying to format correctly the following table: \documentclass[a4paper,twoside]{report} \usepackage{array,colortbl,multirow,multicol,booktabs,ctable} ...
4
votes
1answer
163 views

Footnote in booktabs package [duplicate]

I wish to add a footnote somewhere in a table. I am using booktabs package. I wrote the footnote using \footnote. It is showing symbol 1 inside a small box but it is not showing the footnote anywhere. ...
4
votes
1answer
398 views

Table and \hlines too short or wide

Here is a MWE of what I am trying to do. \documentclass[a4paper]{article} \usepackage{tabularx,booktabs} \usepackage{color,colortbl} \begin{document} \begin{table}[htb] \centering ...
4
votes
2answers
552 views

Conflict between `booktabs` and `arydshln` packages

Please see the MWE below and its result. I didn't use the arydshln package in the example, but I have to use it somewhere else in the same document. As you see, there is something wrong with the ...
4
votes
1answer
17k views

Error using \toprule \midrule from Booktabs package [closed]

I am trying to use the package booktabs to make my tables look nicer. However, Latex gives me an error whenever I use \toprule \midrule or \bottomrule. Here is a simple example I created: ...
4
votes
1answer
1k views

Format nomencl in table style

For my thesis I wwant to format the nomencl in the same style as the rest. Simply put this means I want the nomencl to appear as follows: Symbol Quantity Unit t Time s rest ...
4
votes
2answers
2k views

Vertical spacing in tables with math

How can I force LaTeX to vertically center math in a table taking into account subscripts, superscripts, etc? It appears from the output below that LaTeX vertically centered the $JV$ and added the ...
4
votes
3answers
91 views

How to use \shortstack together with \arraystretch to achieve the same row separation?

When I use \shortstack to create newline in a table cell, the row separation is not the same as defined by the value of \arraystretch. The following MWE shows the problem: ...