Tag Info

Hot answers tagged

5

The following provides the desired layout of the table (without colour): \documentclass{article} \usepackage[margin=1in]{geometry}% Just for this example \usepackage{tabularx,array,booktabs} \newcolumntype{N}{@{}>{\stepcounter{enumi}\theenumi.~}l@{}} \newcolumntype{M}{@{}>{\stepcounter{enumi}\theenumi.~}p{\linewidth}@{}} \newenvironment{listenv} ...


5

Maybe just: \documentclass{book} \usepackage{multirow,bigdelim} \begin{document} \begin{tabular}{cc} \hline Sample values: each line contains one entire beat)\tabularnewline \hline 68.1 72.8 78.4 85.6 93.6 98.1 95.3 91.2 91.1 ... & \rdelim\}{3}{3mm}[variable length] \tabularnewline 74.4 79.2 85.6 92.8 100.8 108.8 115.2 121.6 ...


5

You can also adapt the solution from Braces for cases in tabular environment which allows you to mark the top and bottom using \tikzmark and then do the drawing afterwards: Code: \documentclass{book} \usepackage{multirow,bigdelim,dcolumn,booktabs} \usepackage{xparse} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{decorations.pathreplacing} ...


5

I'd probably use array for this but in any case the same \extrarowheight parameter can be used: \documentclass[12pt]{article} \usepackage{tabu} \begin{document} a \[ \begin{tabu} {c | c c c c c c} \firsthline f & a_{11} & a_{12} & a_{21} & a_{22} & b_1 & b_2 \\ \hline 1 & a_{11}^1 & a_{12}^1 & ...


5

You can do it with the collcell package: \documentclass{article} \usepackage{collcell} \newcolumntype{F}[1]{>{\collectcell\fillempty}#1<{\endcollectcell}} \newcommand{\fillempty}[1]{% \if\relax\detokenize{#1}\relax 0% \else #1% \fi } \begin{document} \begin{tabular}{ *{4}{F{l}} } 1 & 2 & 3 & 4 \\ & x & x & ...


5

you have told dcolumn that you only have one decimal place in the numbers so it only leaves room for one digit after the . Also please always post complete documents not fragments with bits removed. The 2.4 leaves enough room for a minus sign and a digit to the left of the . and 4 digits after. \documentclass[a4paper,12pt,icelandic]{report} ...


4

This possibly does the right thing. \documentclass{article} \usepackage{amsmath} \usepackage{colortbl} \begin{document} \begin{tabular}{p{0.5\textwidth}} {\makeatletter\CT@everycr{\the\everycr}\begin{align} S &= \pi r ^2 \end{align}} \end{tabular} \end{document}


3

You can achieve all this with David Carlisle's tabularx package. I thought to provide 2 different solutions, since manual breaks can be done inside a tabular environment, but that does not solve your problem properly IMO. Column width is fixed within tabularx preamble: >{\centering\arraybackslash}X means "centered-text (>{\centering\arraybackslash}), ...


3

Here is an implementation that doesn't use bigdelim; rather an array that is vertically aligned on the math axis: \documentclass{article} \usepackage{booktabs} \begin{document} \begin{tabular}{c c} \toprule Sample values: each line contains one entire beat \\ \midrule $\left.\kern-\nulldelimiterspace \begin{array}{ *{9}{r} } 68.1 & 72.8 ...


3

If you color the cells, you need no rule. And you never need vertical rules in tables (nor double rules). \documentclass{article} \usepackage{xcolor} \usepackage{colortbl} \begin{document} \begin{tabular}{l *{5}{>{\columncolor{blue!20}}l} l} \rowcolor{white}% & 1 & 2 & 3 & 4 & 5 & 6\\ 1 & 1 & 1 & 1 & 1 & 1 ...


2

I think the problem is your ... in the second-to-last row in your table. I was able to use the siunitx package by replacing ... with \dots. Also, have a look at the mhchem package. I've replaced your first equation using the \ce{} command provided by mhchem. \documentclass[a4paper,12pt]{report} \usepackage[icelandic]{babel} \usepackage{dcolumn} ...


2

tabu's way of doing this is to use \tabulinesep. From manual: Applying to your code (with some huge space for demo) \documentclass[12pt]{article} \usepackage{tabu} \begin{document} \[\tabulinesep=1cm %<--------------------------adjust 1cm \begin{tabu} {c | c c c c c c} \firsthline f & a_{11} & a_{12} & a_{21} & ...


2

Here's a quick Tikz answer: I created two new commands called \upbar and \downbar that connect to each other so that the spacing to the top of the table, the text, and the bottom of the table remains correct. If the bars were to connect to the top and bottoms of the table, it would look like a vertical rule, which isn't what you want. ...


2

The makecell package is done for that: it allows for linebreaks in cells, and common formatting for column heads. Also you shouldn't use \esizebox as it also scales the text in a tabular. I used the tabulars environment instead, with a table total width of 16 cm.. Although one should not use \multicolumns that come across X type columns, it seems to be ...


2

Manual Solution: You can apply \rowcolor and selectively color in white the cells which should not have color \ColorBlock{<start row>}{<end row>}{<color>} Using collcell package we can define a macro which specifies which rows of the table to color. This applies only to columns with the L alignment defined in the MWE. Code: ...


2

I used equation inside a minipage. \documentclass{article} \usepackage[table]{xcolor} \usepackage{amsmath} \begin{document} \begin{tabular}{p{0.5\textwidth}} \cellcolor{yellow}\begin{minipage}{.5\textwidth}\begin{equation} S = \pi r ^2 \end{equation}\end{minipage}\\ \end{tabular} \end{document} Edited After see DavidĀ“s comment to use without ...


2

You can either use the functionality of multirow, or merely raise/lower the contents into place, making sure you also remove any vertical height as a result of the movement. Below, \vertcenter does exactly that, moving the contents up by half of the regular baseline skip (.5\normalbaselineskip): \documentclass{article} \usepackage{booktabs,multirow} ...


1

With KOMA-Script If you use package babel together with KOMA-Script (to be correct, package scrbase, which is called in the KOMA-Script classes scrartcl, scrreprt, scrbook and scrlttr2 and in the KOMA-Script package scrextend) it is better to use the mechanism of KOMA-Script instead of babels because KOMA-Script has a better verification. KOMA-Script ...


1

I have a solution you might find helpful, though it throws off the table formatting slightly. Here you go: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{tabular}{lcl} \hline A & $\Big|$ & 3.45\\ B & $\Big|$ & 6.12\\ C & $2$ & 7.93\\ D & $\Big|$ & 0.31\\ ...


1

Here is a solution using forest. It makes no sense to use a float in this context, so the tabulars cannot benefit from the automatic numbering of the table environment. However, you could use one of the methods for getting captions outside float environments if you would prefer the tables to be numbered automatically. (There are a bunch of questions ...



Only top voted, non community-wiki answers of a minimum length are eligible