If I have a line of text, how do I make just the first word bold?
I tried this:
\bf{NTn} = Number of lines
but it made the entire line bold.
If I have a line of text, how do I make just the first word bold?
I tried this:
\bf{NTn} = Number of lines
but it made the entire line bold.
You should not use \bf. Instead use {\bfseries ....}.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
{\bfseries NTn} = Number of lines
$\mathbf{NTn} + \boldsymbol{\pi} + \pmb{\pi} $ = Number of lines.
\verb|\boldsymbol| and \verb|\pmb| are provided by \verb|amsmath| package. Note that \verb|\mathbf| has no effect on symbols like $+$ or $-$ or $\pi$ etc.
\end{document}

However, it is better to use \bm from bm package for such needs which gives correct results.
\boldmath, \boldsymbol or \pmb. For mor details see here
– adn
May 16 '12 at 05:23
\boldmath works just by chance and throws warnings; \boldsymbol is deprecated and \bm (from the bm package) should be used.
– egreg
Nov 02 '14 at 10:14
\boldmath that, by the way, is not a command taking an argument.
– egreg
Nov 02 '14 at 10:35
For regular, bold and italics math, use the bm package:

\documentclass{article}
\usepackage{bm}% http://ctan.org/pkg/bm
\begin{document}
$NTn=\bm{NTn}=\mbox{Number of lines}$
\end{document}
this works for me
\textbf{BOLD}
\textbf{Some text in bold}. – Ali Mehrizi May 16 '12 at 05:16\textitor\it,\bfseriesor\bf, etc. and Will two-letter font style commands (\bf,\it, …) ever be resurrected in LaTeX? regarding the use of font switches. – Werner May 16 '12 at 05:35\bfis an outdated font switch, not a macro with an argument, i.e. itr works to the end of the group. You would need to use{\bf NTn}instead, but should not use the font commands any longer. Use\textbf{..}or{\bfseries ..}instead. – Martin Scharrer May 16 '12 at 07:45