I see many questions where the macro \bf is used to generate a bold output. Is this a good use of \bf?
- 28,066
1 Answers
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.
- 28,066
\bf, which is why he also answered immediately – daleif Mar 09 '22 at 20:42\bf,\it, …) ever be resurrected in LaTeX? – Werner Mar 09 '22 at 21:51\bfin math mode. Please extend your answer to tell folk what to do if they come across\bfin other than math mode (as I tried to do in my answer).. – Peter Wilson Mar 11 '22 at 19:05\mathbf, the whole answer applied equally to text and math but I addedor\textbf{set}in text.to make it clearer for you. – David Carlisle Mar 11 '22 at 19:10\mathbf. I'm very happy with your current answer. – Peter Wilson Mar 12 '22 at 18:16