
Ich möchte, dass das „Ja“ unten perfekt ausgerichtet ist. Wenn in der Tabelle jetzt Sterne vor dem „Ja“ stehen, wird der Text nach links verschoben. Ich möchte jedoch, dass jede Spalte mit „Ja“ so ausgerichtet ist, dass jedes „Y“ in „Ja“ direkt über dem anderen „Y“ in den anderen „Ja“s in der Spalte steht, unabhängig von der Anzahl der Sterne davor.
Ich habe versucht \phantom
, einige Sterne mit - zu versehen, aber es funktioniert nicht.
Minimalbeispiel:
\documentclass{article}
\usepackage{longtable}
\usepackage{dcolumn}
\usepackage{booktabs}
\usepackage{lscape}
\newcommand{\C}[1]{\multicolumn{1}{c}{#1}}
\newcommand*{\SuperScriptSameStyle}[1]{%
\ensuremath{%
\mathchoice
{{}^{\displaystyle #1}}%
{{}^{\textstyle #1}}%
{{}^{\scriptstyle #1}}%
{{}^{\scriptscriptstyle #1}}%
}%
}
\newcommand*{\oneS}{\SuperScriptSameStyle{*}}
\newcommand*{\twoS}{\SuperScriptSameStyle{**}}
\newcommand*{\threeS}{\SuperScriptSameStyle{*{*}*}}
\newcommand\Ya{\C{Yes}}
\newcommand\Yb{\C{Yes\oneS}}
\newcommand\Yc{\C{Yes\twoS}}
\newcommand\Yd{\C{Yes\threeS}}
\newcolumntype{d}[1]{D{.}{.}{#1}} % "decimal" column type
\begin{document}
\begin{landscape}
\begin{longtable}{@{} l @{\extracolsep{\fill}} *{7}{d{6}} @{}}
\cmidrule[\heavyrulewidth]{1-8}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa} \\
\cmidrule{1-8}
\endfirsthead
\multicolumn{2}{@{}l}{\emph{(continued)}} \\
\cmidrule[\heavyrulewidth]{1-8}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa}
& \multicolumn{1}{c}{Column 1aa} \\
\cmidrule{1-8}
\endhead
\cmidrule[\heavyrulewidth]{1-8}
\multicolumn{8}{r@{}}{\emph{(continued)}}
\endfoot
\cmidrule[\heavyrulewidth]{1-8}
\endlastfoot
\multicolumn{5}{@{}l}{\emph{Estimates}} \\
$\tau = 0.05$ & -0.078 & -0.959 & -0.695 & -1.754\oneS & 0.339 & -2.925 & 2.553 \\
$\tau = 0.10$ & -0.046 & -0.868 & -0.649 & -1.066 & -0.272 & -4.288\twoS & -0.245 \\
$\tau = 0.50$ & -0.424 & -0.910 & -0.786 & -1.625\oneS & 1.569\twoS & -3.569\twoS & 0.086 \\
$\tau = 0.90$ & -1.008\twoS & 0.001 & -1.924\threeS & 0.906 & 0.284 & -2.444 & 1.552 \\
$\tau = 0.95$ & -0.911\twoS & 0.930 & -2.230\threeS & -0.321 & 1.363 & -2.903 & 0.479 \\
& & & & & & & \\
$F:\tau \in \{0.05,0.50\}$ & 0.467 & 0.002 & 0.018 & 0.013 & 1.325 & 0.078 & 1.855 \\
$F:\tau \in \{0.50,0.95\}$ & 0.842 & 2.808\oneS & 5.230\twoS & 1.447 & 0.031 & 0.022 & 0.028 \\
$F:\tau \in \{0.05,0.95\}$ & 2.484 & 2.952\oneS & 3.918\twoS & 1.378 & 0.483 & 0.000 & 0.572 \\
& & & & & & & \\
\multicolumn{5}{@{}l}{\emph{\underline{Sigs}}} \\
$\tau = 0.05$ & \Yb & \Yd & \Ya & \Yd & \Ya & \Yd & \Yd \\
$\tau = 0.10$ & \Ya & \Yd & \Ya & \Yd & \Ya & \Yd & \Ya \\
$\tau = 0.50$ & \Yd & \Ya & \Ya & \Ya & \Ya & \Ya & \Ya \\
$\tau = 0.90$ & \Yd & \Yb & \Yb & \Ya & \Ya & \Yc & \Ya \\
$\tau = 0.95$ & \Yd & \Yc & \Yd & \Yc & \Yd & \Yd & \Yd \\
\end{longtable}
\end{landscape}
\end{document}
Antwort1
Eine Möglichkeit hierfür besteht darin, die Sterne in einem r
Licht über lap
(oder \rlap
) zu platzieren, so dass sie horizontal keinen Platz einnehmen. Kurz gesagt, \rlap
ist gleichbedeutend mit \makebox[0pt][l]
:
\newcommand*{\oneS}{\rlap{\SuperScriptSameStyle{*}}}
\newcommand*{\twoS}{\rlap{\SuperScriptSameStyle{**}}}
\newcommand*{\threeS}{\rlap{\SuperScriptSameStyle{*{*}*}}}