2

I want to make a subscript and bold it.

enter image description here

\begin{table}[h!]
\centering
 \begin{tabular}{cccc}
    \toprule
     \small {\textbf{F}}
     & \small {\textbf{$df_1$}} & \small {\textbf{$df_2$}}
     & \small {\textbf{Sig.}}\\
     \midrule
    2.016 & 3 & 36 & 0.129 \\
    \bottomrule
    \end{tabular}
\end{table}

I tried this:

 & \small {\textbf{df_1$}} & \small {\textbf{df_2$}}

is working, but with error:

Check that your $'s match around math expressions. If they do, then you've probably used a symbol in normal text that needs to be in math mode. Symbols such as subscripts ( _ ), integrals ( \int ), Greek letters ( \alpha, \beta, \delta ), and modifiers (\vec{x}, \tilde{x} ) must be written in math mode. See the full list here.If you intended to use mathematics mode, then use $ … $ for 'inline math mode', $$ … $$ for 'display math mode' or alternatively \begin{math} … \end{math}.
10
  • 4
    Use $\boldsymbol{df_2}$ or \boldmath$df_2$\unboldmath.
    – user194703
    Oct 27 '19 at 16:33
  • 1
    Or $\mathbf{df_1}$.
    – Mico
    Oct 27 '19 at 16:51
  • @Mico But this makes the font upright, so it does no longer look like math. If it is not math stuff, wouldn't \textbf{df\textsubscript{2}} be the cleaner solution?
    – user194703
    Oct 27 '19 at 17:45
  • @Schrödinger'scat - Given the scant information provided by the OP, I'm assuming it's a table related to a test statistic -- an F-test, to be specific, with information about the two degrees-of-freedom parameters and the test's (lack of) significance in the final column. Since the OP seems fine with F and Sig. using an upright bold font, I assumed an upright bold font is fine for df1 and df2 as well. However, I may be wrong.
    – Mico
    Oct 27 '19 at 18:30
  • 1
    I do not exactly know the (La)TeX core difference but obviously \boldsymbol{...} is to be used inside math mode only, while \boldmath is usually (always?) used outside and affects all math bits, e.g. \boldmath Let's talk about $A$ and $B$.\undboldmath will make both A and B bold. So the bottom-line is if you want to know the core level differences, please ask a new question.
    – user194703
    Oct 28 '19 at 17:27
2

Something like this?

enter image description here

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}[h!]
\[ % switch to display math mode -- fewer '$' symbols to type
\begin{array}{@{}cccc@{}} % use 'array', not 'tabular'
    \toprule
       \mathbf{F} & \mathbf{df_1} & \mathbf{df_2} & \mathbf{Sig.}\\
    \midrule
       2.016 & 3 & 36 & 0.129 \\
    \bottomrule
\end{array}
\]
\end{table}
\end{document}
4
  • thanks. Brillant. I am curious, why cannot use \textbf in table, but need to use \mathbf?
    – aan
    Oct 27 '19 at 17:26
  • @aan - To answer your question in depth, I'd have to know more about which text and math fonts you employ in your document. Depending on these font choices, \textbf might indeed be more appropriate than \mathbf. For Computer Modern (the default text and math font) and the letter combinations in the header cells, the difference is minimal.
    – Mico
    Oct 27 '19 at 18:33
  • Thanks. I am using %% Font setup % \usepackage{mathptmx} % \usepackage{lmodern} \usepackage{helvet}
    – aan
    Oct 27 '19 at 23:27
  • @aan - Loading mathptmx (a Times Roman clone) and then Latin Modern (a Computer Modern clone) makes little sense; you might as well omit the \usepackage{mathptmx} instruction. In Latin Modern, the math and text fonts are very similar. Anyway, I thinks it's easier, and far more natural, to write \mathbf{df_1} than it is to write \textbf{df}\textsubscript{\textbf{1}}. The 1 term is very much a math-type subscript rather than a text-type subscript, isn't it?
    – Mico
    Oct 28 '19 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.