# Tag Info

1

Here is a try with environ package. But I am not sure if it works for your complex cases. It is worth giving a try. The following code works. \documentclass[a4paper]{scrartcl} \usepackage[margin=1in]{geometry} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{ltablex} % includes tabularx, but combined with longtables (spanning multiple ...

1

I get no error if I replace \end{tabularx} (which is probably wrong in the first place) with \endtabularx\endgroup. No guarantee this won't break anything else. \documentclass[a4paper]{scrartcl} \usepackage[margin=1in]{geometry} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{ltablex} % includes tabularx, but combined with longtables ...

2

I've managed to make the code compilable but there are still some things that could be improved. \documentclass{book} \usepackage{tabularx} \usepackage{booktabs} \usepackage{thesis_style} \newcommand*\something{$\delta^{u}gil$} \begin{document} Text before the table. \begin{table}[h] \centering \begin{threeparttable} \begin{tabularx}{\textwidth}{XXXX} ...

4

In the standard column specifier usage of c (or l or r), there is a space of \tabcolsep (defaulting to 6.0pt) to the left as well as to the right. This means, that cc has in fact following spacing \tabcolsep cell_content \tabcolsep\tabcolsep cell_content \tabcolsep Usage of @{}c@{} drops this spacing before and after. It is better than to manipulate ...

4

Each table cell forms a group, so your definition of \PercentColor is lost by the time it reaches \ApplyGradient. If you make the definition \global (I've done so using \global\edef or, equivalently, \xdef) it works as expected: \documentclass{article} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=1.10} ...

2

I find siunitx better for managing numeric tables. \documentclass[draft]{article} \usepackage[margin=1in]{geometry} % choose margins here \usepackage{booktabs} % for \toprule, \midrule, \bottomrule, and \cmidrule \usepackage[labelsep=newline,% line break after label justification=raggedright, singlelinecheck=off]{caption} ...

7

You could use a tabular* environment, as is done in the table below, to force the tabular material to take up the full width of the text block. By setting \tabcolsep (the parameter that governs the default amount of inter-column whitespace) to a very small value and providing additional, flexible whitespace via an @{\extracolsep{\fill}} directive, the ...

1

I suggest another approach: with the cellspace package, define a minimal vertical spacing between the top of a cell and the above cell, and similarly aminimal spacing between the bottom of a cell and the top of the below cell. There remains to prefix the column specifier with S. It works by default with the l, r, c specifier, and with the X type if you ...

4

This is due to the extra space of \\[1em] being effectively added to the text within the last cell in the row, thus preventing that cell from being centered - see here. Thus in order to get your content centered and be able to specify row height, you need to add another, empty, column to your table, like so: \documentclass{article} ...

3

Your table is wider then the available \linewidth and the tabularx is used without any X column. One possibility to get the table right is using \small and defining the first column as an X column: Code: \documentclass{article} \usepackage[margin=1cm]{geometry} \usepackage{tabularx} \usepackage{booktabs} \usepackage{amsmath} ...

3

Given that all of your column headers are the same, and the d_{(\ce{O1}-\ce{Mg_{(Zn)}} is what is causing the columns to be so wide, I suggest combining all of the column labels. Incorporating the triming suggestions of @Johannes_B from the comments above you can get: by writing \documentclass{article} \usepackage[margin=1cm]{geometry} ...

1

How about: \usepackage{multirow} \begin{document} \begin{table}[h] \begin{tabular}{|l|l|l|l|l|} \hline X & xx & x & x & x \\ \hline \multirow{4}{*}{A} & x & x & x & x \\ \cline{2-5} & x & x & x & x \\ \cline{2-5} & x & x & x & x \\ ...

0

This is just a longer comment to @egreg's answer using his tabular table, rewritten as tabularx When space permits I tend to rewrite like this using tabularx. I use the X columns to add the space between columns, not for the data columns (I also recomment siunitx for that). I double the number of columns, and then adjust the space columns accordingly. Note ...

0

However, using tabularx is a simple way to have equal width columns with a prescribed total width, which may be desirable for numeric data. As for the alignment on the deimal dot, it's easy to get it here, since data have to be right-aligned, and all have the sae number of decimal digits: \documentclass{article} \usepackage[utf8]{inputenc} ...

3

You want siunitx; if you really want to spread out the table (don't, please respect your readers ;-)), use tabular*: \documentclass{article} \usepackage{siunitx} \usepackage{booktabs} \begin{document} \begin{center} \begin{tabular}{ l S[table-format=2.1] S[table-format=1.1] S[table-format=2.1] S[table-format=2.1] S[table-format=-1.1]% the ...

3

Don't use tabularx on numeric data:-) \documentclass{article} \usepackage{dcolumn} \usepackage{booktabs} \begin{document} \begin{center} \begin{tabular}{l *{6}{D..{3.1}}} \toprule & \multicolumn{2}{c}{first} & \multicolumn{2}{c}{second} & \multicolumn{2}{c}{third} \\ \multicolumn{1}{c}{data set} & \multicolumn{1}{c}{foo} & ...

Top 50 recent answers are included