2

I see many questions where the macro \bf is used to generate a bold output. Is this a good use of \bf?

Peter Wilson
  • 28,066
  • this is a duplicate of the question just asked or at least the accepted answer at https://tex.stackexchange.com/a/636367/1090 applies equally to text and math mode use. – David Carlisle Mar 09 '22 at 19:49
  • 1
    @DavidCarlisle I think Peter just wanted to create something that could be referred to whenever people ask about \bf, which is why he also answered immediately – daleif Mar 09 '22 at 20:42
  • Define "good.". – David G. Stork Mar 09 '22 at 21:11
  • @DavidCarlisle Please see the edited version of my answer. – Peter Wilson Mar 09 '22 at 21:15
  • @PeterWilson well your answer isn't wrong but I don't think it says anything different to the text of the answer posted yesterday, as I say while the question yesterday asked about math use he answer (that it may not be defined) applied equally to text or math – David Carlisle Mar 09 '22 at 22:05
  • @DavidCarlisle I know I'm a GOM and please make allowances for that. Putting myself as a new LaTeX user i did not see anything in your answer that dealt with other the \bf in math mode. Please extend your answer to tell folk what to do if they come across \bf in other than math mode (as I tried to do in my answer).. – Peter Wilson Mar 11 '22 at 19:05
  • @PeterWilson apart from literally the last word, \mathbf, the whole answer applied equally to text and math but I added or\textbf{set}in text. to make it clearer for you. – David Carlisle Mar 11 '22 at 19:10
  • @DavidCarlisle Thank you. As a long time LaTeX user I understood that your answer had general applicability. What I was concerned about was newcomers who might not realise that there were text equivalents of \mathbf. I'm very happy with your current answer. – Peter Wilson Mar 12 '22 at 18:16

1 Answers1

5

No, it is not a good use and should not be used at all in any modern LaTeX (post 1993) document.

BEGIN EDIT re comments

Other questions have been asked about this, for example about using \bf when typesetting maths, and with specific answers. This is an attempt to provide a generic answer not dependant on the particular desired typography.

END EDIT

\bf has not been defined in LaTeX2e since 1993, although it is still defined if you use TeX, not LaTeX.

Instead use:

I say \textbf{boldly go} onwards or I say {\bfseries boldly go} onwards. In math use \mathbf{boldly go}

Some classes or packages may define \bf or suggest using something else. For example the book, report and article classes define their version of \bf for compatibilty reasons with pre-1993 created documents.

The memoir class, and maybe many others, does not recognise \bf and will give warnings if it is used (although there is a class option that lets you use it).

Essentially, do not employ \bf. And package writers should certainly avoid it.

Peter Wilson
  • 28,066