Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
5  
Use \textbf{Some text in bold}. –  Ali Mehrizi May 16 '12 at 5:16
3  
    
\bf is 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 7:45

2 Answers 2

up vote 15 down vote accepted

You should not use \bf. Instead use {\bfseries ....}.

\documentclass{article}
\usepackage{amsmath}
\begin{document}


{\bfseries NTn} = Number of lines

$\boldmath{NTn} + \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}

enter image description here

share|improve this answer
    
Thanks, but what if I need to bold the following: $NT_n$ ? {\bfseries $NT_n$} doesn't work..... –  ngramsky May 16 '12 at 5:16
1  
@ngramsky, for math mode, use `\mathbf{e^{j\pi}=-1}'. –  Ali Mehrizi May 16 '12 at 5:22
    
For bolding math you can use \boldmath, \boldsymbol or \pmb. For mor details see here –  adn May 16 '12 at 5:23
    
@ngramsky: see the edited answer. –  Harish Kumar May 16 '12 at 5:29

For regular, bold and italics math, use the bm package:

enter image description here

\documentclass{article}
\usepackage{bm}% http://ctan.org/pkg/bm
\begin{document}
$NTn=\bm{NTn}=\mbox{Number of lines}$
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.