6

MWE:

\documentclass{article}

\usepackage{bm}

\begin{document}
$$x(t), \bf{x}(t), \bf{x(t)}$$
\end{document}

Result:

enter image description here

Question:

Why are the second and third x(t) typeset the same? In the second expression, it was asked to apply \bf to only x.

EDIT:

I had not payed attention to it when asking the question, but I would like to have a bold and italic x.

  • 6
    Because \bf is a declaration that applies to everything until the end of the current group. Use \mathbf{x}(t) instead. Nowadays (=the last thirty years) one doesn't use \bf anymore. – gernot Apr 10 '17 at 17:15
  • 2
    You probably intended to write \bm instead of \bf. – gernot Apr 10 '17 at 17:17
  • 6
    Better to avoid $$...$$. Use \[...\] instead. Why is [ … ] preferable to $$ … $$? – gernot Apr 10 '17 at 17:18
9

Use \bm instead of \bf. And \[...\] instead of $$...$$.

enter image description here

\documentclass{article}
\usepackage{bm}
\begin{document}
\[x(t), \bm{x}(t), \bm{x(t)}\]
\end{document}
| improve this answer | |
  • 1
    I think the OP wants \mathbf{x} rather than \bm{x} – egreg Apr 10 '17 at 17:38
  • 4
    @egreg It depends on what you mean by "want". Loading the bm package and adding the bm tag indicates that the OP wants to use the bm package, so it seems that \bf is just \bm with a typo. If by "want" you mean "should want" then I have no opinion. I'm neither able to read the OP's subconscious mind, nor am I aware of typographic conventions that dictate \mathbf instead of \bm. – gernot Apr 10 '17 at 17:46
  • @egreg No, I wanted \bm{x} (x italic), but it is true that I had not mentioned it in the question. – Karlo Apr 11 '17 at 9:22
  • 1
    @Karlo Well, you mentioned it in the question. You can hardly be more explicit than\usepackage{bm} and adding the tag bm. – gernot Apr 11 '17 at 9:24
  • @egreg Ah yes, it was a typo apparently. – Karlo Apr 11 '17 at 9:27
11

Because \bf is a (deprecated) switch that is turned on. It doesn't take an argument in the form \bf{x}, but should rather be used {\bfseries x} (instead of {\bf x}. See Does it matter if I use \textit or \it, \bfseries or \bf, etc. and Will two-letter font style commands (\bf, \it, …) ever be resurrected in LaTeX?

Instead, use \boldsymbol (from amsmath) or \mathbf:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\[ x(t), \boldsymbol{x}(t), \mathbf{x}(t), \boldsymbol{x(t)}, \mathbf{x(t)} \]

\end{document}
| improve this answer | |
  • 4
    Note the use of \[...\] (as opposed to $$...$$). See Why is \[\] preferable to $$? – Werner Apr 10 '17 at 17:20
  • 4
    The documentation of amsbsy (automatically loaded by amsmath) explicitly tells to prefer \bm from the bm package. – egreg Apr 10 '17 at 17:37
  • 1
    I'm not sure it's right to call the switches like \bf and \it deprecated: they may be deprecated in LaTeX (not fitting with its philosophy of logical structure), but AFAIK they are still the way to go in plain TeX, and one could argue there is something pleasing about transparently getting exactly the font you asked for: not getting bold italics because of accidental nesting or whatever. – ShreevatsaR Apr 11 '17 at 3:01
  • @ShreevatsaR they're are not deprecated in Plain and ConTeXt but they are in LaTeX. Since the question clearly is about a LaTeX document it would be rather misleading (IMHO) not to call them deprecated under these circumstances. – cgnieder Apr 11 '17 at 9:44

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.