Vertical alignment of degree unit and other elements in table
You can make \cup
to align with ,
with the help of boxes:
\documentclass{article}
\usepackage{siunitx}
\usepackage{gensymb}
\usepackage{dcolumn}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{calc} %% provides \widthof
\begin{document}
\begin{table}
\centering
\begin{tabular}{cS[table-format=3,table-space-text-post=\si{\degree}]r}
\toprule
\rule[-0.6em]{0pt}{1.7em} Elevation range & \multicolumn{1}{c}{Azimuth resolution} & \multicolumn{1}{c}{$N$} \\ \hline
\rule{0pt}{1.4em} \makebox[\widthof{$(-60\degree,-40\degree)$}][r]{$[-40\degree$}$,$
\makebox[\widthof{$(40\degree,60\degree)$}][l]{$40\degree]$} & 5\si{\degree} & 1224 \\
$(-60\degree,-40\degree) \cup (40\degree,60\degree)$ & 8\si{\degree} & 270 \\
$(-70\degree,-60\degree] \cup [60\degree,70\degree)$ & 10\si{\degree} & 144 \\
$(-80\degree,-70\degree] \cup [70\degree,80\degree)$ & 15\si{\degree} & 96 \\
$(-90\degree,-80\degree] \cup [80\degree,90\degree)$ & 30\si{\degree} & 48 \\
\rule[-0.5em]{0pt}{0.5em} \makebox[\widthof{$(-60\degree,-40\degree)$}][r]{$-90\degree$}$,$
\makebox[\widthof{$(40\degree,60\degree)$}][l]{$90\degree$} & 360\si{\degree} & 2 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
With siunitx
you can have an easier input; I'd prefer \si{\degree}
to \degree
.
\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{
c
S[table-format=3,
table-space-text-post=\si{\degree}
]<{\si{\degree}}
S[table-format=4]
}
\toprule
Elevation range & \multicolumn{1}{c}{Azimuth resolution} & {$N$} \\
\midrule
$[\SI{-40}{\degree},\SI{40}{\degree}]$ & 5 & 1224 \\
$(\SI{-60}{\degree},\SI{-40}{\degree}) \cup
(\SI{40}{\degree},\SI{60}{\degree})$ & 8 & 270 \\
$(\SI{-70}{\degree},\SI{-60}{\degree}] \cup
[\SI{60}{\degree},\SI{70}{\degree})$ & 10 & 144 \\
$(\SI{-80}{\degree},\SI{-70}{\degree}] \cup
[\SI{70}{\degree},\SI{80}{\degree})$ & 15 & 96 \\
$(\SI{-90}{\degree},\SI{-80}{\degree}] \cup
[\SI{80}{\degree},\SI{90}{\degree})$ & 30 & 48 \\
$\SI{-90}{\degree},\SI{90}{\degree}$ & 360 & 2 \\
\bottomrule
\end{tabular}
\end{document}
Using the experimental tabstackengine
package introduced at Writing a table with equally spaced columns, based on the widest column, you can achieve what you requested.
The package extends the stackengine
package to allow tabbing.
I changed the tab and end-of-align characters for tabstackengine
from &
and \\
to *
and /
, so as not to conflict with tabular
.
\documentclass{article}
\usepackage{siunitx}
\usepackage{gensymb}
\usepackage{dcolumn}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{tabstackengine}
\setstackEOL{/}
\setstackTAB{*}
\strutlongstacks{T}
\setstackgap{L}{12pt}
\stackMath
\begin{document}
\begin{table}
\centering
\begin{tabular}{ccr}
\toprule
\rule[-0.6em]{0pt}{1.7em} Elevation range & Azimuth resolution & \multicolumn{1}{c}{$N$} \\ \midrule
\alignLongstack{%
[-40\degree\!\!\!*\,\,,40\degree]/
(-60\degree,-40\degree) *\cup (40\degree,60\degree)/
(-70\degree,-60\degree] *\cup [60\degree,70\degree)/
(-80\degree,-70\degree] *\cup [70\degree,80\degree)/
(-80\degree,-70\degree] *\cup [70\degree,80\degree)/
-90\degree\!\!\!*\,\,,90\degree
}
&\Longstack[r]{5^\circ/8^\circ/10^\circ/15^\circ/30^\circ/360^\circ}%
&\Longstack[r]{1224/270/144/96/48/2}
\\
\bottomrule
\end{tabular}
\end{table}
\end{document}