5

I am using the following code.

\documentclass[]{article}
\usepackage{amssymb}
\usepackage{amsmath}

\begin{document}
    
    \begin{eqnarray}  \label{eq:linearInterpolant}
        \boldsymbol{\beta}(\bf{s^*}) = \normalfont{c}
    \end{eqnarray}
    
\end{document}

I get the following result

enter image description here

That is, the c character is emboldened despite the boldface have been ended before the c. It seems I should not need the \normalfont but it doesn't work anyway. I would like the c to be non-bold as it is does not represent a vector.

4
  • 7
    \bf should not be used in latex (it has not been defined by default since 1993) if you do use it, it applies to the rest of the expression, it does not take an argument. the c in your example is in the scope of \bf \normalfont does not take an argument either and does nothing in math mode, Oct 18 at 21:31
  • 5
    \mathbf{s} if you want upright, or \bm{s} (from bm package) if you want bold math italic Oct 18 at 21:34
  • 2
    unrelated but eqnarray should have &=& but much better not to use it and use align from amsmath especially as you are already loading that package. Oct 18 at 21:39
  • Thanks, David. I replaced \bf with \mathbf and that fixed the problem. I will look into align from amsmath. Thanks again, Oct 18 at 21:43
15

There are two distinct issues with your code:

  • \bf is a switch and doesn't take an argument. Its scope extends to the end of the current group. (Same for \normalfont, which incidentally is a text-mode command and has no effect when used in math mode.) Hence

    (\bf{s^*}) = \normalfont{c}
    

    works out to be the same as

    (\bf s^*) = c
    

    c is rendered in bold because the scope of \bf includes it.

  • \bf is a hold-over from Plain TeX and shouldn't be used in LaTeX documents created after 1994 [!]. Really. \bf and its close relatives, such as \rm and \it, are no longer defined in the LaTeX kernel. Some document classes still define \bf, but others do not. To maximize the portability of your documents across document classes, you should replace all instances of {\bf ...} with either \textbf{...} or \mathbf{...}, depending on whether text mode or math mode is in use.

In short, you should learn to replace

\boldsymbol{\beta}(\bf{s^*}) = \normalfont{c}

with

\boldsymbol{\beta}(\mathbf{s}^*) = c

and live happily ever after. (Observe that I would only make s bold, but not the superscript asterisk.)

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.