Improve formatting of table: something similar to the visual effect of cases environment











up vote
2
down vote

favorite












I have this long table with a lot of similar entries repeated.



example



I've tried to improve the visual result with some space between rows and grouping the common part of each entry. i.e. the first four observed variables should be:




  • Blue rods revolute position goalkeeper

  • Blue rods revolute position defence

  • Blue rods revolute position midfield

  • Blue rods revolute position attack


However, I'm not satisfied with the visual result. I would try with something similar to the cases environment (i.e. a big "{" between the first and the second column for each group) but I don't know how to do it with table rows.



Of course, if you have a suggestion on how to better compress the data or a suggestion on how to have a better visual effect that doesn't involve the big "{" you're welcome. However, note that the order how the row is important, so I cannot merge "blue rods" and "red rods".



This is the code I used to generate the example:



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{multirow}
usepackage{makecell}

begin{document}
begin{table}[htbp]
centering
begin{tabular}{@{}*{2}{l}*{2}{c}@{}}
toprule
multicolumn{2}{c}{Observed variable} &
thead{Lowest \ possible value} &
thead{Highest \ possible value} \
midrule
multirow{4}{*}{makecell[l]{Blue rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{3}{*}{makecell[l]{Ball: \ position}}
& x &
$-5.75e-1$ & $5.75e-1$ \
& y &
$-3.55e-1$ & $3.55e-1$ \
& z &
$-infty$ & $infty$ \
bottomrule
end{tabular}
caption{Observation space bounds}
end{table}
end{document}









share|improve this question






















  • I might remove those entries and make a new table, with a caption mentioning "For Goalkeeper, Defense, Midfield, and Attack".
    – Teepeemm
    Dec 5 at 16:23















up vote
2
down vote

favorite












I have this long table with a lot of similar entries repeated.



example



I've tried to improve the visual result with some space between rows and grouping the common part of each entry. i.e. the first four observed variables should be:




  • Blue rods revolute position goalkeeper

  • Blue rods revolute position defence

  • Blue rods revolute position midfield

  • Blue rods revolute position attack


However, I'm not satisfied with the visual result. I would try with something similar to the cases environment (i.e. a big "{" between the first and the second column for each group) but I don't know how to do it with table rows.



Of course, if you have a suggestion on how to better compress the data or a suggestion on how to have a better visual effect that doesn't involve the big "{" you're welcome. However, note that the order how the row is important, so I cannot merge "blue rods" and "red rods".



This is the code I used to generate the example:



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{multirow}
usepackage{makecell}

begin{document}
begin{table}[htbp]
centering
begin{tabular}{@{}*{2}{l}*{2}{c}@{}}
toprule
multicolumn{2}{c}{Observed variable} &
thead{Lowest \ possible value} &
thead{Highest \ possible value} \
midrule
multirow{4}{*}{makecell[l]{Blue rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{3}{*}{makecell[l]{Ball: \ position}}
& x &
$-5.75e-1$ & $5.75e-1$ \
& y &
$-3.55e-1$ & $3.55e-1$ \
& z &
$-infty$ & $infty$ \
bottomrule
end{tabular}
caption{Observation space bounds}
end{table}
end{document}









share|improve this question






















  • I might remove those entries and make a new table, with a caption mentioning "For Goalkeeper, Defense, Midfield, and Attack".
    – Teepeemm
    Dec 5 at 16:23













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I have this long table with a lot of similar entries repeated.



example



I've tried to improve the visual result with some space between rows and grouping the common part of each entry. i.e. the first four observed variables should be:




  • Blue rods revolute position goalkeeper

  • Blue rods revolute position defence

  • Blue rods revolute position midfield

  • Blue rods revolute position attack


However, I'm not satisfied with the visual result. I would try with something similar to the cases environment (i.e. a big "{" between the first and the second column for each group) but I don't know how to do it with table rows.



Of course, if you have a suggestion on how to better compress the data or a suggestion on how to have a better visual effect that doesn't involve the big "{" you're welcome. However, note that the order how the row is important, so I cannot merge "blue rods" and "red rods".



This is the code I used to generate the example:



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{multirow}
usepackage{makecell}

begin{document}
begin{table}[htbp]
centering
begin{tabular}{@{}*{2}{l}*{2}{c}@{}}
toprule
multicolumn{2}{c}{Observed variable} &
thead{Lowest \ possible value} &
thead{Highest \ possible value} \
midrule
multirow{4}{*}{makecell[l]{Blue rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{3}{*}{makecell[l]{Ball: \ position}}
& x &
$-5.75e-1$ & $5.75e-1$ \
& y &
$-3.55e-1$ & $3.55e-1$ \
& z &
$-infty$ & $infty$ \
bottomrule
end{tabular}
caption{Observation space bounds}
end{table}
end{document}









share|improve this question













I have this long table with a lot of similar entries repeated.



example



I've tried to improve the visual result with some space between rows and grouping the common part of each entry. i.e. the first four observed variables should be:




  • Blue rods revolute position goalkeeper

  • Blue rods revolute position defence

  • Blue rods revolute position midfield

  • Blue rods revolute position attack


However, I'm not satisfied with the visual result. I would try with something similar to the cases environment (i.e. a big "{" between the first and the second column for each group) but I don't know how to do it with table rows.



Of course, if you have a suggestion on how to better compress the data or a suggestion on how to have a better visual effect that doesn't involve the big "{" you're welcome. However, note that the order how the row is important, so I cannot merge "blue rods" and "red rods".



This is the code I used to generate the example:



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{multirow}
usepackage{makecell}

begin{document}
begin{table}[htbp]
centering
begin{tabular}{@{}*{2}{l}*{2}{c}@{}}
toprule
multicolumn{2}{c}{Observed variable} &
thead{Lowest \ possible value} &
thead{Highest \ possible value} \
midrule
multirow{4}{*}{makecell[l]{Blue rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Blue rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute position}}
& Goalkeeper &
$-pi$ & $pi$ \
& Defense &
$-pi$ & $pi$ \
& Midfield &
$-pi$ & $pi$ \
& Attack &
$-pi$ & $pi$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic position}}
& Goalkeeper &
$-0.9451e-1$ & $0.9451e-1$ \
& Defense &
$-1.82e-1$ & $1.82e-1$ \
& Midfield &
$-0.665e-1$ & $0.665e-1$ \
& Attack &
$-1.11e-1$ & $1.11e-1$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ revolute velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{4}{*}{makecell[l]{Red rods: \ prismatic velocity}}
& Goalkeeper &
$-infty$ & $infty$ \
& Defense &
$-infty$ & $infty$ \
& Midfield &
$-infty$ & $infty$ \
& Attack &
$-infty$ & $infty$ \

&&&\

multirow{3}{*}{makecell[l]{Ball: \ position}}
& x &
$-5.75e-1$ & $5.75e-1$ \
& y &
$-3.55e-1$ & $3.55e-1$ \
& z &
$-infty$ & $infty$ \
bottomrule
end{tabular}
caption{Observation space bounds}
end{table}
end{document}






tables






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 5 at 15:22









gvgramazio

1,442520




1,442520












  • I might remove those entries and make a new table, with a caption mentioning "For Goalkeeper, Defense, Midfield, and Attack".
    – Teepeemm
    Dec 5 at 16:23


















  • I might remove those entries and make a new table, with a caption mentioning "For Goalkeeper, Defense, Midfield, and Attack".
    – Teepeemm
    Dec 5 at 16:23
















I might remove those entries and make a new table, with a caption mentioning "For Goalkeeper, Defense, Midfield, and Attack".
– Teepeemm
Dec 5 at 16:23




I might remove those entries and make a new table, with a caption mentioning "For Goalkeeper, Defense, Midfield, and Attack".
– Teepeemm
Dec 5 at 16:23










3 Answers
3






active

oldest

votes

















up vote
4
down vote



accepted










This is mainly stylistic, but the answer contains also some useful suggestions.



I'd avoid braces, as they add nothing to comprehension. The labels should be aligned to the top row, not in the center, where they're ambiguous. In a table, a blank position means repetition of the value above. This way, the small space between groups is sufficient to make clear what the label refers to.



I'd also divide the table into three sections, adding “Blue rods”, “Red rods” and “Ball” at the top of the sections, in a distinct font for emphasize them.



Using siunitx is essentially mandatory for numeric tables.



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{siunitx}

sisetup{output-exponent-marker=ensuremath{mathrm{e}}}

begin{document}

begin{table}[htbp]
centeringsmall
begin{tabular}{
@{}
l
l
S[table-format=-1.4e1]
S[table-format=1.4e1]
@{}c@{}
}
toprule
multicolumn{2}{@{}c}{Observed variable} & multicolumn{2}{c@{}}{Possible value} \
cmidrule(l){3-4}
&& {Lowest} & {Highest} \

midrule
multicolumn{4}{@{}l@{}}{itshape Blue rods} \

revolute position
& Goalkeeper &
{$-pi$} & {$pi$} \
& Defense &
{$-pi$} & {$pi$} \
& Midfield &
{$-pi$} & {$pi$} \
& Attack &
{$-pi$} & {$pi$} \

addlinespace

prismatic position
& Goalkeeper &
-0.9451e-1 & 0.9451e-1 \
& Defense &
-1.82e-1 & 1.82e-1 \
& Midfield &
-0.665e-1 & 0.665e-1 \
& Attack &
-1.11e-1 & 1.11e-1 \

addlinespace

revolute velocity
& Goalkeeper &
{$-infty$} & {$infty$} \
& Defense &
{$-infty$} & {$infty$} \
& Midfield &
{$-infty$} & {$infty$} \
& Attack &
{$-infty$} & {$infty$} \

addlinespace

prismatic velocity
& Goalkeeper &
{$-infty$} & {$infty$} \
& Defense &
{$-infty$} & {$infty$} \
& Midfield &
{$-infty$} & {$infty$} \
& Attack &
{$-infty$} & {$infty$} \

midrule
multicolumn{4}{@{}l@{}}{itshape Red rods} \

revolute position
& Goalkeeper &
{$-pi$} & {$pi$} \
& Defense &
{$-pi$} & {$pi$} \
& Midfield &
{$-pi$} & {$pi$} \
& Attack &
{$-pi$} & {$pi$} \

addlinespace

prismatic position
& Goalkeeper &
-0.9451e-1 & 0.9451e-1 \
& Defense &
-1.82e-1 & 1.82e-1 \
& Midfield &
-0.665e-1 & 0.665e-1 \
& Attack &
-1.11e-1 & 1.11e-1 \

addlinespace

revolute velocity
& Goalkeeper &
{$-infty$} & {$infty$} \
& Defense &
{$-infty$} & {$infty$} \
& Midfield &
{$-infty$} & {$infty$} \
& Attack &
{$-infty$} & {$infty$} \

addlinespace

prismatic velocity
& Goalkeeper &
{$-infty$} & {$infty$} \
& Defense &
{$-infty$} & {$infty$} \
& Midfield &
{$-infty$} & {$infty$} \
& Attack &
{$-infty$} & {$infty$} \

midrule
multicolumn{4}{@{}l@{}}{itshape Ball} \

position
& x &
-5.75e-1 & 5.75e-1 \
& y &
-3.55e-1 & 3.55e-1 \
& z &
{$-infty$} & {$infty$} \
bottomrule
end{tabular}
caption{Observation space bounds}
end{table}
end{document}


enter image description here






share|improve this answer





















  • I know that a better approach was possible. Your solution is better than what I was looking for.
    – gvgramazio
    Dec 5 at 17:57


















up vote
3
down vote













edited corrected errors in column headers and renew definition for command case



like this?



enter image description here



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs, multirow, makecell}
renewcommandtheadgape{}
usepackage{amsmath}
newcommand{case}[1]%
{$displaystyle
text{makecell[l]{#1}}quad
left{begin{tabular}{l}
Goalkeeper \
Defense \
Midfield \
Attack
end{tabular}right.
$}

begin{document}
begin{table}[htbp]
centering
begin{tabular}{ @{} l *{2}{>{$} c < {$} } @{} }
toprule
thead{Observed variable}
& text{thead{Lowest \ possible value}}
& text{thead{Highest \ possible value}} \
midrule

case{Blue rods: \ prismatic position}
& makecell{-pi \
-pi \
-pi \
-pi}
& makecell{-pi \
-pi \
-pi \
-pi} \
addlinespace
case{Blue rods: \ prismatic position}
& makecell[r]{-0.9451e-1 \
-1.82e-1 \
-0.665e-1 \
-1.11e-1}
& makecell[r]{0.9451e-1 \
1.82e-1 \
0.665e-1 \
1.11e-1} \
addlinespace
case{Red rods: \ prismatic velocity}
& makecell{-infty \
-infty \
-infty \
-infty}
& makecell{infty \
infty \
infty \
infty} \
bottomrule
end{tabular}
caption{Observation space bounds}
label{tab:...}
end{table}
end{document}





share|improve this answer























  • This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
    – gvgramazio
    Dec 5 at 17:55










  • @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
    – Zarko
    Dec 5 at 19:03


















up vote
1
down vote













A solution with a simpler code, based on bigdelim:



documentclass{book}
usepackage[utf8]{inputenc}
usepackage{booktabs}
usepackage{multirow, bigdelim}
usepackage{makecell}
newcommand{e}[1]{,mathrm{e}{#1}}

begin{document}

begin{table}[htbp]
centering
renewcommand{theadfont}{normalsize}
begin{tabular}{@{}l@{ ,}cl*{2}{c}@{}}
toprule
multicolumn{3}{c}{Observed variable} &
thead{Lowest \ possible value} &
thead{Highest \ possible value} \
midrule
addlinespace[1.5ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-pi$ & $pi$ \
Blue rods: & & Defense &
$-pi$ & $pi$ \
revolute position & & Midfield &
$-pi$ & $pi$ \
& & Attack &
$-pi$ & $pi$ \
addlinespace[2ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-0.9451e{-1}$ & $ 0.9451e{-1}$ \
Blue rods: & & Defense &
$-1.82e{-1}$ & $1.82e{-1}$ \
prismatic position & & Midfield &
$-0.665e{-1}$ & $0.665e{-1}$ \
& & Attack &
$-1.11e{-1}$ & $1.11e{-1}$ \
addlinespace[2ex]
multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
& ldelim{{4}{0pt} & Goalkeeper &
$-infty$ & $infty$ \
Blue rods: & & Defense &
$-infty$ & $infty$ \
revolute velocity & & Midfield &
$-infty$ & $infty$ \
& & Attack &
$-infty$ & $infty$ \
addlinespace[2ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-infty$ & $infty$ \
Blue rods: & & Defense &
$-infty$ & $infty$ \
prismatic velocity & & Midfield &
$-infty$ & $infty$ \
& & Attack &
$-infty$ & $infty$ \
addlinespace[2ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-pi$ & $pi$ \
Red rods: & & Defense &
$-pi$ & $pi$ \
revolute position & & Midfield &
$-pi$ & $pi$ \
& & Attack &
$-pi$ & $pi$ \
addlinespace[2ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-0.9451e{-1}$ & $0.9451e{-1}$ \
Red rods: & & Defense &
$-1.82e{-1}$ & $1.82e{-1}$ \
prismatic position & & Midfield &
$-0.665e{-1}$ & $0.665e{-1}$ \
& & Attack &
$-1.11e{-1}$ & $1.11e{-1}$ \
addlinespace[2ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-infty$ & $infty$ \
Red rods: & & Defense &
$-infty$ & $infty$ \
revolute velocity & & Midfield &
$-infty$ & $infty$ \
& & Attack &
$-infty$ & $infty$ \
addlinespace[2ex]
& ldelim{{4}{0pt} & Goalkeeper &
$-infty$ & $infty$ \
Red rods: & & Defense &
$-infty$ & $infty$ \
prismatic velocity & & Midfield &
$-infty$ & $infty$ \
& & Attack &
$-infty$ & $infty$ \
addlinespace[2ex]
multirow{3}{*}{makecell[l]{Ball: \ position}}
& ldelim{{3}{0pt} & x &
$-5.75e{-1}$ & $5.75e{-1}$ \
& & y &
$-3.55e{-1}$ & $3.55e{-1}$ \
& & z &
$-infty$ & $infty$ \
addlinespace[1ex]
bottomrule
end{tabular}
caption{Observation space bounds}
end{table}

end{document}


enter image description here






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463335%2fimprove-formatting-of-table-something-similar-to-the-visual-effect-of-cases-env%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    This is mainly stylistic, but the answer contains also some useful suggestions.



    I'd avoid braces, as they add nothing to comprehension. The labels should be aligned to the top row, not in the center, where they're ambiguous. In a table, a blank position means repetition of the value above. This way, the small space between groups is sufficient to make clear what the label refers to.



    I'd also divide the table into three sections, adding “Blue rods”, “Red rods” and “Ball” at the top of the sections, in a distinct font for emphasize them.



    Using siunitx is essentially mandatory for numeric tables.



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs}
    usepackage{siunitx}

    sisetup{output-exponent-marker=ensuremath{mathrm{e}}}

    begin{document}

    begin{table}[htbp]
    centeringsmall
    begin{tabular}{
    @{}
    l
    l
    S[table-format=-1.4e1]
    S[table-format=1.4e1]
    @{}c@{}
    }
    toprule
    multicolumn{2}{@{}c}{Observed variable} & multicolumn{2}{c@{}}{Possible value} \
    cmidrule(l){3-4}
    && {Lowest} & {Highest} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Blue rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Red rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Ball} \

    position
    & x &
    -5.75e-1 & 5.75e-1 \
    & y &
    -3.55e-1 & 3.55e-1 \
    & z &
    {$-infty$} & {$infty$} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    end{table}
    end{document}


    enter image description here






    share|improve this answer





















    • I know that a better approach was possible. Your solution is better than what I was looking for.
      – gvgramazio
      Dec 5 at 17:57















    up vote
    4
    down vote



    accepted










    This is mainly stylistic, but the answer contains also some useful suggestions.



    I'd avoid braces, as they add nothing to comprehension. The labels should be aligned to the top row, not in the center, where they're ambiguous. In a table, a blank position means repetition of the value above. This way, the small space between groups is sufficient to make clear what the label refers to.



    I'd also divide the table into three sections, adding “Blue rods”, “Red rods” and “Ball” at the top of the sections, in a distinct font for emphasize them.



    Using siunitx is essentially mandatory for numeric tables.



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs}
    usepackage{siunitx}

    sisetup{output-exponent-marker=ensuremath{mathrm{e}}}

    begin{document}

    begin{table}[htbp]
    centeringsmall
    begin{tabular}{
    @{}
    l
    l
    S[table-format=-1.4e1]
    S[table-format=1.4e1]
    @{}c@{}
    }
    toprule
    multicolumn{2}{@{}c}{Observed variable} & multicolumn{2}{c@{}}{Possible value} \
    cmidrule(l){3-4}
    && {Lowest} & {Highest} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Blue rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Red rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Ball} \

    position
    & x &
    -5.75e-1 & 5.75e-1 \
    & y &
    -3.55e-1 & 3.55e-1 \
    & z &
    {$-infty$} & {$infty$} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    end{table}
    end{document}


    enter image description here






    share|improve this answer





















    • I know that a better approach was possible. Your solution is better than what I was looking for.
      – gvgramazio
      Dec 5 at 17:57













    up vote
    4
    down vote



    accepted







    up vote
    4
    down vote



    accepted






    This is mainly stylistic, but the answer contains also some useful suggestions.



    I'd avoid braces, as they add nothing to comprehension. The labels should be aligned to the top row, not in the center, where they're ambiguous. In a table, a blank position means repetition of the value above. This way, the small space between groups is sufficient to make clear what the label refers to.



    I'd also divide the table into three sections, adding “Blue rods”, “Red rods” and “Ball” at the top of the sections, in a distinct font for emphasize them.



    Using siunitx is essentially mandatory for numeric tables.



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs}
    usepackage{siunitx}

    sisetup{output-exponent-marker=ensuremath{mathrm{e}}}

    begin{document}

    begin{table}[htbp]
    centeringsmall
    begin{tabular}{
    @{}
    l
    l
    S[table-format=-1.4e1]
    S[table-format=1.4e1]
    @{}c@{}
    }
    toprule
    multicolumn{2}{@{}c}{Observed variable} & multicolumn{2}{c@{}}{Possible value} \
    cmidrule(l){3-4}
    && {Lowest} & {Highest} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Blue rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Red rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Ball} \

    position
    & x &
    -5.75e-1 & 5.75e-1 \
    & y &
    -3.55e-1 & 3.55e-1 \
    & z &
    {$-infty$} & {$infty$} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    end{table}
    end{document}


    enter image description here






    share|improve this answer












    This is mainly stylistic, but the answer contains also some useful suggestions.



    I'd avoid braces, as they add nothing to comprehension. The labels should be aligned to the top row, not in the center, where they're ambiguous. In a table, a blank position means repetition of the value above. This way, the small space between groups is sufficient to make clear what the label refers to.



    I'd also divide the table into three sections, adding “Blue rods”, “Red rods” and “Ball” at the top of the sections, in a distinct font for emphasize them.



    Using siunitx is essentially mandatory for numeric tables.



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs}
    usepackage{siunitx}

    sisetup{output-exponent-marker=ensuremath{mathrm{e}}}

    begin{document}

    begin{table}[htbp]
    centeringsmall
    begin{tabular}{
    @{}
    l
    l
    S[table-format=-1.4e1]
    S[table-format=1.4e1]
    @{}c@{}
    }
    toprule
    multicolumn{2}{@{}c}{Observed variable} & multicolumn{2}{c@{}}{Possible value} \
    cmidrule(l){3-4}
    && {Lowest} & {Highest} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Blue rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Red rods} \

    revolute position
    & Goalkeeper &
    {$-pi$} & {$pi$} \
    & Defense &
    {$-pi$} & {$pi$} \
    & Midfield &
    {$-pi$} & {$pi$} \
    & Attack &
    {$-pi$} & {$pi$} \

    addlinespace

    prismatic position
    & Goalkeeper &
    -0.9451e-1 & 0.9451e-1 \
    & Defense &
    -1.82e-1 & 1.82e-1 \
    & Midfield &
    -0.665e-1 & 0.665e-1 \
    & Attack &
    -1.11e-1 & 1.11e-1 \

    addlinespace

    revolute velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    addlinespace

    prismatic velocity
    & Goalkeeper &
    {$-infty$} & {$infty$} \
    & Defense &
    {$-infty$} & {$infty$} \
    & Midfield &
    {$-infty$} & {$infty$} \
    & Attack &
    {$-infty$} & {$infty$} \

    midrule
    multicolumn{4}{@{}l@{}}{itshape Ball} \

    position
    & x &
    -5.75e-1 & 5.75e-1 \
    & y &
    -3.55e-1 & 3.55e-1 \
    & z &
    {$-infty$} & {$infty$} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    end{table}
    end{document}


    enter image description here







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 5 at 16:29









    egreg

    705k8618773157




    705k8618773157












    • I know that a better approach was possible. Your solution is better than what I was looking for.
      – gvgramazio
      Dec 5 at 17:57


















    • I know that a better approach was possible. Your solution is better than what I was looking for.
      – gvgramazio
      Dec 5 at 17:57
















    I know that a better approach was possible. Your solution is better than what I was looking for.
    – gvgramazio
    Dec 5 at 17:57




    I know that a better approach was possible. Your solution is better than what I was looking for.
    – gvgramazio
    Dec 5 at 17:57










    up vote
    3
    down vote













    edited corrected errors in column headers and renew definition for command case



    like this?



    enter image description here



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs, multirow, makecell}
    renewcommandtheadgape{}
    usepackage{amsmath}
    newcommand{case}[1]%
    {$displaystyle
    text{makecell[l]{#1}}quad
    left{begin{tabular}{l}
    Goalkeeper \
    Defense \
    Midfield \
    Attack
    end{tabular}right.
    $}

    begin{document}
    begin{table}[htbp]
    centering
    begin{tabular}{ @{} l *{2}{>{$} c < {$} } @{} }
    toprule
    thead{Observed variable}
    & text{thead{Lowest \ possible value}}
    & text{thead{Highest \ possible value}} \
    midrule

    case{Blue rods: \ prismatic position}
    & makecell{-pi \
    -pi \
    -pi \
    -pi}
    & makecell{-pi \
    -pi \
    -pi \
    -pi} \
    addlinespace
    case{Blue rods: \ prismatic position}
    & makecell[r]{-0.9451e-1 \
    -1.82e-1 \
    -0.665e-1 \
    -1.11e-1}
    & makecell[r]{0.9451e-1 \
    1.82e-1 \
    0.665e-1 \
    1.11e-1} \
    addlinespace
    case{Red rods: \ prismatic velocity}
    & makecell{-infty \
    -infty \
    -infty \
    -infty}
    & makecell{infty \
    infty \
    infty \
    infty} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    label{tab:...}
    end{table}
    end{document}





    share|improve this answer























    • This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
      – gvgramazio
      Dec 5 at 17:55










    • @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
      – Zarko
      Dec 5 at 19:03















    up vote
    3
    down vote













    edited corrected errors in column headers and renew definition for command case



    like this?



    enter image description here



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs, multirow, makecell}
    renewcommandtheadgape{}
    usepackage{amsmath}
    newcommand{case}[1]%
    {$displaystyle
    text{makecell[l]{#1}}quad
    left{begin{tabular}{l}
    Goalkeeper \
    Defense \
    Midfield \
    Attack
    end{tabular}right.
    $}

    begin{document}
    begin{table}[htbp]
    centering
    begin{tabular}{ @{} l *{2}{>{$} c < {$} } @{} }
    toprule
    thead{Observed variable}
    & text{thead{Lowest \ possible value}}
    & text{thead{Highest \ possible value}} \
    midrule

    case{Blue rods: \ prismatic position}
    & makecell{-pi \
    -pi \
    -pi \
    -pi}
    & makecell{-pi \
    -pi \
    -pi \
    -pi} \
    addlinespace
    case{Blue rods: \ prismatic position}
    & makecell[r]{-0.9451e-1 \
    -1.82e-1 \
    -0.665e-1 \
    -1.11e-1}
    & makecell[r]{0.9451e-1 \
    1.82e-1 \
    0.665e-1 \
    1.11e-1} \
    addlinespace
    case{Red rods: \ prismatic velocity}
    & makecell{-infty \
    -infty \
    -infty \
    -infty}
    & makecell{infty \
    infty \
    infty \
    infty} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    label{tab:...}
    end{table}
    end{document}





    share|improve this answer























    • This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
      – gvgramazio
      Dec 5 at 17:55










    • @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
      – Zarko
      Dec 5 at 19:03













    up vote
    3
    down vote










    up vote
    3
    down vote









    edited corrected errors in column headers and renew definition for command case



    like this?



    enter image description here



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs, multirow, makecell}
    renewcommandtheadgape{}
    usepackage{amsmath}
    newcommand{case}[1]%
    {$displaystyle
    text{makecell[l]{#1}}quad
    left{begin{tabular}{l}
    Goalkeeper \
    Defense \
    Midfield \
    Attack
    end{tabular}right.
    $}

    begin{document}
    begin{table}[htbp]
    centering
    begin{tabular}{ @{} l *{2}{>{$} c < {$} } @{} }
    toprule
    thead{Observed variable}
    & text{thead{Lowest \ possible value}}
    & text{thead{Highest \ possible value}} \
    midrule

    case{Blue rods: \ prismatic position}
    & makecell{-pi \
    -pi \
    -pi \
    -pi}
    & makecell{-pi \
    -pi \
    -pi \
    -pi} \
    addlinespace
    case{Blue rods: \ prismatic position}
    & makecell[r]{-0.9451e-1 \
    -1.82e-1 \
    -0.665e-1 \
    -1.11e-1}
    & makecell[r]{0.9451e-1 \
    1.82e-1 \
    0.665e-1 \
    1.11e-1} \
    addlinespace
    case{Red rods: \ prismatic velocity}
    & makecell{-infty \
    -infty \
    -infty \
    -infty}
    & makecell{infty \
    infty \
    infty \
    infty} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    label{tab:...}
    end{table}
    end{document}





    share|improve this answer














    edited corrected errors in column headers and renew definition for command case



    like this?



    enter image description here



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs, multirow, makecell}
    renewcommandtheadgape{}
    usepackage{amsmath}
    newcommand{case}[1]%
    {$displaystyle
    text{makecell[l]{#1}}quad
    left{begin{tabular}{l}
    Goalkeeper \
    Defense \
    Midfield \
    Attack
    end{tabular}right.
    $}

    begin{document}
    begin{table}[htbp]
    centering
    begin{tabular}{ @{} l *{2}{>{$} c < {$} } @{} }
    toprule
    thead{Observed variable}
    & text{thead{Lowest \ possible value}}
    & text{thead{Highest \ possible value}} \
    midrule

    case{Blue rods: \ prismatic position}
    & makecell{-pi \
    -pi \
    -pi \
    -pi}
    & makecell{-pi \
    -pi \
    -pi \
    -pi} \
    addlinespace
    case{Blue rods: \ prismatic position}
    & makecell[r]{-0.9451e-1 \
    -1.82e-1 \
    -0.665e-1 \
    -1.11e-1}
    & makecell[r]{0.9451e-1 \
    1.82e-1 \
    0.665e-1 \
    1.11e-1} \
    addlinespace
    case{Red rods: \ prismatic velocity}
    & makecell{-infty \
    -infty \
    -infty \
    -infty}
    & makecell{infty \
    infty \
    infty \
    infty} \
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    label{tab:...}
    end{table}
    end{document}






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 5 at 18:55

























    answered Dec 5 at 16:19









    Zarko

    119k865155




    119k865155












    • This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
      – gvgramazio
      Dec 5 at 17:55










    • @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
      – Zarko
      Dec 5 at 19:03


















    • This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
      – gvgramazio
      Dec 5 at 17:55










    • @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
      – Zarko
      Dec 5 at 19:03
















    This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
    – gvgramazio
    Dec 5 at 17:55




    This is what I've already tried. I discarded this solution because it doesn't use table rows. The consequence is that the vertical space between values is different from the one between cases. Of course, it could be hard-coded, but I'm against solutions that require high maintenance.
    – gvgramazio
    Dec 5 at 17:55












    @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
    – Zarko
    Dec 5 at 19:03




    @gvgramazio, see corrected answer. now (as i see) are removed small discrepancy in vertical aligning of rows. however, contents in cells in last two columns should not bi higher than in the first column.
    – Zarko
    Dec 5 at 19:03










    up vote
    1
    down vote













    A solution with a simpler code, based on bigdelim:



    documentclass{book}
    usepackage[utf8]{inputenc}
    usepackage{booktabs}
    usepackage{multirow, bigdelim}
    usepackage{makecell}
    newcommand{e}[1]{,mathrm{e}{#1}}

    begin{document}

    begin{table}[htbp]
    centering
    renewcommand{theadfont}{normalsize}
    begin{tabular}{@{}l@{ ,}cl*{2}{c}@{}}
    toprule
    multicolumn{3}{c}{Observed variable} &
    thead{Lowest \ possible value} &
    thead{Highest \ possible value} \
    midrule
    addlinespace[1.5ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-pi$ & $pi$ \
    Blue rods: & & Defense &
    $-pi$ & $pi$ \
    revolute position & & Midfield &
    $-pi$ & $pi$ \
    & & Attack &
    $-pi$ & $pi$ \
    addlinespace[2ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-0.9451e{-1}$ & $ 0.9451e{-1}$ \
    Blue rods: & & Defense &
    $-1.82e{-1}$ & $1.82e{-1}$ \
    prismatic position & & Midfield &
    $-0.665e{-1}$ & $0.665e{-1}$ \
    & & Attack &
    $-1.11e{-1}$ & $1.11e{-1}$ \
    addlinespace[2ex]
    multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
    & ldelim{{4}{0pt} & Goalkeeper &
    $-infty$ & $infty$ \
    Blue rods: & & Defense &
    $-infty$ & $infty$ \
    revolute velocity & & Midfield &
    $-infty$ & $infty$ \
    & & Attack &
    $-infty$ & $infty$ \
    addlinespace[2ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-infty$ & $infty$ \
    Blue rods: & & Defense &
    $-infty$ & $infty$ \
    prismatic velocity & & Midfield &
    $-infty$ & $infty$ \
    & & Attack &
    $-infty$ & $infty$ \
    addlinespace[2ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-pi$ & $pi$ \
    Red rods: & & Defense &
    $-pi$ & $pi$ \
    revolute position & & Midfield &
    $-pi$ & $pi$ \
    & & Attack &
    $-pi$ & $pi$ \
    addlinespace[2ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-0.9451e{-1}$ & $0.9451e{-1}$ \
    Red rods: & & Defense &
    $-1.82e{-1}$ & $1.82e{-1}$ \
    prismatic position & & Midfield &
    $-0.665e{-1}$ & $0.665e{-1}$ \
    & & Attack &
    $-1.11e{-1}$ & $1.11e{-1}$ \
    addlinespace[2ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-infty$ & $infty$ \
    Red rods: & & Defense &
    $-infty$ & $infty$ \
    revolute velocity & & Midfield &
    $-infty$ & $infty$ \
    & & Attack &
    $-infty$ & $infty$ \
    addlinespace[2ex]
    & ldelim{{4}{0pt} & Goalkeeper &
    $-infty$ & $infty$ \
    Red rods: & & Defense &
    $-infty$ & $infty$ \
    prismatic velocity & & Midfield &
    $-infty$ & $infty$ \
    & & Attack &
    $-infty$ & $infty$ \
    addlinespace[2ex]
    multirow{3}{*}{makecell[l]{Ball: \ position}}
    & ldelim{{3}{0pt} & x &
    $-5.75e{-1}$ & $5.75e{-1}$ \
    & & y &
    $-3.55e{-1}$ & $3.55e{-1}$ \
    & & z &
    $-infty$ & $infty$ \
    addlinespace[1ex]
    bottomrule
    end{tabular}
    caption{Observation space bounds}
    end{table}

    end{document}


    enter image description here






    share|improve this answer

























      up vote
      1
      down vote













      A solution with a simpler code, based on bigdelim:



      documentclass{book}
      usepackage[utf8]{inputenc}
      usepackage{booktabs}
      usepackage{multirow, bigdelim}
      usepackage{makecell}
      newcommand{e}[1]{,mathrm{e}{#1}}

      begin{document}

      begin{table}[htbp]
      centering
      renewcommand{theadfont}{normalsize}
      begin{tabular}{@{}l@{ ,}cl*{2}{c}@{}}
      toprule
      multicolumn{3}{c}{Observed variable} &
      thead{Lowest \ possible value} &
      thead{Highest \ possible value} \
      midrule
      addlinespace[1.5ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-pi$ & $pi$ \
      Blue rods: & & Defense &
      $-pi$ & $pi$ \
      revolute position & & Midfield &
      $-pi$ & $pi$ \
      & & Attack &
      $-pi$ & $pi$ \
      addlinespace[2ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-0.9451e{-1}$ & $ 0.9451e{-1}$ \
      Blue rods: & & Defense &
      $-1.82e{-1}$ & $1.82e{-1}$ \
      prismatic position & & Midfield &
      $-0.665e{-1}$ & $0.665e{-1}$ \
      & & Attack &
      $-1.11e{-1}$ & $1.11e{-1}$ \
      addlinespace[2ex]
      multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
      & ldelim{{4}{0pt} & Goalkeeper &
      $-infty$ & $infty$ \
      Blue rods: & & Defense &
      $-infty$ & $infty$ \
      revolute velocity & & Midfield &
      $-infty$ & $infty$ \
      & & Attack &
      $-infty$ & $infty$ \
      addlinespace[2ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-infty$ & $infty$ \
      Blue rods: & & Defense &
      $-infty$ & $infty$ \
      prismatic velocity & & Midfield &
      $-infty$ & $infty$ \
      & & Attack &
      $-infty$ & $infty$ \
      addlinespace[2ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-pi$ & $pi$ \
      Red rods: & & Defense &
      $-pi$ & $pi$ \
      revolute position & & Midfield &
      $-pi$ & $pi$ \
      & & Attack &
      $-pi$ & $pi$ \
      addlinespace[2ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-0.9451e{-1}$ & $0.9451e{-1}$ \
      Red rods: & & Defense &
      $-1.82e{-1}$ & $1.82e{-1}$ \
      prismatic position & & Midfield &
      $-0.665e{-1}$ & $0.665e{-1}$ \
      & & Attack &
      $-1.11e{-1}$ & $1.11e{-1}$ \
      addlinespace[2ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-infty$ & $infty$ \
      Red rods: & & Defense &
      $-infty$ & $infty$ \
      revolute velocity & & Midfield &
      $-infty$ & $infty$ \
      & & Attack &
      $-infty$ & $infty$ \
      addlinespace[2ex]
      & ldelim{{4}{0pt} & Goalkeeper &
      $-infty$ & $infty$ \
      Red rods: & & Defense &
      $-infty$ & $infty$ \
      prismatic velocity & & Midfield &
      $-infty$ & $infty$ \
      & & Attack &
      $-infty$ & $infty$ \
      addlinespace[2ex]
      multirow{3}{*}{makecell[l]{Ball: \ position}}
      & ldelim{{3}{0pt} & x &
      $-5.75e{-1}$ & $5.75e{-1}$ \
      & & y &
      $-3.55e{-1}$ & $3.55e{-1}$ \
      & & z &
      $-infty$ & $infty$ \
      addlinespace[1ex]
      bottomrule
      end{tabular}
      caption{Observation space bounds}
      end{table}

      end{document}


      enter image description here






      share|improve this answer























        up vote
        1
        down vote










        up vote
        1
        down vote









        A solution with a simpler code, based on bigdelim:



        documentclass{book}
        usepackage[utf8]{inputenc}
        usepackage{booktabs}
        usepackage{multirow, bigdelim}
        usepackage{makecell}
        newcommand{e}[1]{,mathrm{e}{#1}}

        begin{document}

        begin{table}[htbp]
        centering
        renewcommand{theadfont}{normalsize}
        begin{tabular}{@{}l@{ ,}cl*{2}{c}@{}}
        toprule
        multicolumn{3}{c}{Observed variable} &
        thead{Lowest \ possible value} &
        thead{Highest \ possible value} \
        midrule
        addlinespace[1.5ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-pi$ & $pi$ \
        Blue rods: & & Defense &
        $-pi$ & $pi$ \
        revolute position & & Midfield &
        $-pi$ & $pi$ \
        & & Attack &
        $-pi$ & $pi$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-0.9451e{-1}$ & $ 0.9451e{-1}$ \
        Blue rods: & & Defense &
        $-1.82e{-1}$ & $1.82e{-1}$ \
        prismatic position & & Midfield &
        $-0.665e{-1}$ & $0.665e{-1}$ \
        & & Attack &
        $-1.11e{-1}$ & $1.11e{-1}$ \
        addlinespace[2ex]
        multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Blue rods: & & Defense &
        $-infty$ & $infty$ \
        revolute velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Blue rods: & & Defense &
        $-infty$ & $infty$ \
        prismatic velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-pi$ & $pi$ \
        Red rods: & & Defense &
        $-pi$ & $pi$ \
        revolute position & & Midfield &
        $-pi$ & $pi$ \
        & & Attack &
        $-pi$ & $pi$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-0.9451e{-1}$ & $0.9451e{-1}$ \
        Red rods: & & Defense &
        $-1.82e{-1}$ & $1.82e{-1}$ \
        prismatic position & & Midfield &
        $-0.665e{-1}$ & $0.665e{-1}$ \
        & & Attack &
        $-1.11e{-1}$ & $1.11e{-1}$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Red rods: & & Defense &
        $-infty$ & $infty$ \
        revolute velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Red rods: & & Defense &
        $-infty$ & $infty$ \
        prismatic velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        multirow{3}{*}{makecell[l]{Ball: \ position}}
        & ldelim{{3}{0pt} & x &
        $-5.75e{-1}$ & $5.75e{-1}$ \
        & & y &
        $-3.55e{-1}$ & $3.55e{-1}$ \
        & & z &
        $-infty$ & $infty$ \
        addlinespace[1ex]
        bottomrule
        end{tabular}
        caption{Observation space bounds}
        end{table}

        end{document}


        enter image description here






        share|improve this answer












        A solution with a simpler code, based on bigdelim:



        documentclass{book}
        usepackage[utf8]{inputenc}
        usepackage{booktabs}
        usepackage{multirow, bigdelim}
        usepackage{makecell}
        newcommand{e}[1]{,mathrm{e}{#1}}

        begin{document}

        begin{table}[htbp]
        centering
        renewcommand{theadfont}{normalsize}
        begin{tabular}{@{}l@{ ,}cl*{2}{c}@{}}
        toprule
        multicolumn{3}{c}{Observed variable} &
        thead{Lowest \ possible value} &
        thead{Highest \ possible value} \
        midrule
        addlinespace[1.5ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-pi$ & $pi$ \
        Blue rods: & & Defense &
        $-pi$ & $pi$ \
        revolute position & & Midfield &
        $-pi$ & $pi$ \
        & & Attack &
        $-pi$ & $pi$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-0.9451e{-1}$ & $ 0.9451e{-1}$ \
        Blue rods: & & Defense &
        $-1.82e{-1}$ & $1.82e{-1}$ \
        prismatic position & & Midfield &
        $-0.665e{-1}$ & $0.665e{-1}$ \
        & & Attack &
        $-1.11e{-1}$ & $1.11e{-1}$ \
        addlinespace[2ex]
        multirow{4}{*}{makecell[l]{Blue rods: \ revolute velocity}}
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Blue rods: & & Defense &
        $-infty$ & $infty$ \
        revolute velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Blue rods: & & Defense &
        $-infty$ & $infty$ \
        prismatic velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-pi$ & $pi$ \
        Red rods: & & Defense &
        $-pi$ & $pi$ \
        revolute position & & Midfield &
        $-pi$ & $pi$ \
        & & Attack &
        $-pi$ & $pi$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-0.9451e{-1}$ & $0.9451e{-1}$ \
        Red rods: & & Defense &
        $-1.82e{-1}$ & $1.82e{-1}$ \
        prismatic position & & Midfield &
        $-0.665e{-1}$ & $0.665e{-1}$ \
        & & Attack &
        $-1.11e{-1}$ & $1.11e{-1}$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Red rods: & & Defense &
        $-infty$ & $infty$ \
        revolute velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        & ldelim{{4}{0pt} & Goalkeeper &
        $-infty$ & $infty$ \
        Red rods: & & Defense &
        $-infty$ & $infty$ \
        prismatic velocity & & Midfield &
        $-infty$ & $infty$ \
        & & Attack &
        $-infty$ & $infty$ \
        addlinespace[2ex]
        multirow{3}{*}{makecell[l]{Ball: \ position}}
        & ldelim{{3}{0pt} & x &
        $-5.75e{-1}$ & $5.75e{-1}$ \
        & & y &
        $-3.55e{-1}$ & $3.55e{-1}$ \
        & & z &
        $-infty$ & $infty$ \
        addlinespace[1ex]
        bottomrule
        end{tabular}
        caption{Observation space bounds}
        end{table}

        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 5 at 18:05









        Bernard

        164k769192




        164k769192






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463335%2fimprove-formatting-of-table-something-similar-to-the-visual-effect-of-cases-env%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Cabo Verde

            Gyllenstierna