I'm trying to get the subscript right below the superscript, in a table in Latex. I'm using this code:
\begin{table}[htbp]
\centering
\begin{threeparttable}
\caption{To evaluate the statistical significance of variations in average measures across different countries, we computed p-values using a variety of statistical tests. The subscript numbers \textsubscript{1}, \textsubscript{2}, and \textsubscript{3} represent zones 1, 2, and 3, respectively. The superscript letters \textsuperscript{a}, \textsuperscript{b}, and \textsuperscript{c} denote the statistical tests ANOVA, T-test, and Welch's T-test, respectively. The Anderson-Darling test checks for data normality, while the ANOVA and T-tests are parametric tests for mean differences between groups. A p-value indicates the likelihood of observing the calculated mean value (or a more extreme value) if the null hypothesis is true; a low p-value (typically <0.05) suggests that the differences are statistically significant.}
\label{tab:NewPValues}
\begin{tabular}{@{}l S[table-format=1.3]S[table-format=1.3]S[table-format=1.3] | l S[table-format=1.3]S[table-format=1.3]S[table-format=1.3]@{}}
\toprule
\multicolumn{4}{c|}{\textbf{1928 - 1979}} & \multicolumn{4}{c}{\textbf{1995}} \\
\textbf{p\textsuperscript{a}\textsubscript{a-b-c}} & {\textbf{Country}} & {\textbf{p\textsuperscript{b}}} & {\textbf{p\textsuperscript{c}}} & \textbf{p\textsuperscript{a}\textsubscript{a-b-c}} & {\textbf{Country}} & {\textbf{p\textsuperscript{b}}} & {\textbf{p\textsuperscript{c}}} \\
\midrule
0.256 & {a - b} & 0.049 & 0.115 & 0.467 & {a - b} & 0.321 & 0.874 \\
& {b - c} & 0.198 & 0.572 & & {b - c} & 0.164 & 0.531 \\
& {a - c} & 0.087 & 0.293 & & {a - c} & 0.212 & 0.689 \\
\bottomrule
\end{tabular}
\begin{tablenotes}
\small
\item
\end{tablenotes}
\end{threeparttable}
\end{table}
`
The resulting table is like this:
As you can see the subscript a-b-c is on the right of the superscript a. I want the subscript to be under the superscript and start at the exact same horizontal position. Does anyone know how to achieve this?
Best Answer
I suggest you change both instances of
to
A separate thought: Assuming that
p
is supposed to denote "p-value", I don't understand why you're using bold-facing and text-mode instead of math-mode. E.g., why don't you drop the (borderline vulgar-looking) bold-facing and write$p^{a}_{\text{a-b-c}}$
? (\text
is a macro provided by theamsmath
package.)