1

I have used the following script-

Let's consider That you are constructing \bf{rational numbers}for the first time using natural numbers and so we don't have any idea about the \bf{division operator}

And the ouput produced is -

Let’s consider That you are constructing rational numbers for the first time using natural numbers and so we don’t have any idea about the divi sion operator .

But I want only want the characters in between \bf{} to have bold font. How to do it ??

1 Answers1

5

\bf should never be used, it has been deprecated about 25 years ago.

Anyway, its syntax was like {\bf rational numbers}, but don't do this.

The correct syntax is

\textbf{rational numbers}

Compare closely the three lines (the first shows the issue, due to \bf being a declaration that goes on until the scope in which it appears ends). The second and third lines differ slightly, but significantly (and the last line is the correct one).

\documentclass{article}

\begin{document}

\begingroup % for scoping the issue
Some \bf{big stuff} here
\endgroup

Some {\bf big stuff} here

Some \textbf{big stuff} here

\end{document}

enter image description here

The same can be seen, perhaps better, with \it and \textit (same as for \bf and \textbf):

\documentclass{article}

\begin{document}

\begingroup % for scoping the issue
Some \it{big stuff} here
\endgroup

Some {\it big stuff} here

Some \textit{big stuff} here

\end{document}

enter image description here

TeXnician
  • 33,589
egreg
  • 1,121,712