# How to typeset math inline

I would like to have the following inline:

We have these two points \textbf{a_1} and \textbf{a_2} etc


Once I select typeset I get a flag that I am missing $So I tried this next: We have these two points {${\textbf{a_1}}$} and {${\textbf{a_2}}$} etc  I got the same flag ... missing$

Interestingly if I use the following:

We have these two points \textbf{a} and \textbf{b} etc


things work out just fine.

Any suggestions on how to resolve this.

• Welcome to TeX.SX! \textbf is invalid in math mode. If you want to have bold math, use either \mathbf{...} or \boldmath (the later requires \usepackage{amsmath} – Christian Hupfer Apr 21 '16 at 19:56
• welcome to tex.sx. this should work: $\mathbf{a_1}$, and so on. (if you want only the letter to be bold: $\mathbf{a}_1$. this is a comment rather than an answer because i'm not in a position to check.) – barbara beeton Apr 21 '16 at 19:58
• Thank-you to both the answers ... is there a way for me to show that the question has been answered? – Tom Apr 21 '16 at 20:10

The _ is only valid in math mode, it doesn't work outside of it.

\textbf{...} - as the name rather suggests - is a text mode command. Using \textbf{...} - whether within math mode or outside of it - puts you in text mode. The argument of \textbf{...} is typeset in text mode.

As such, you cannot use _ within \textbf{...}.

Try

$\mathbf{a_{1}}$


$\textbf{...}$ isn't allowed since \textbf is meant for text mode only.

There are multiple ways to achieve bold math, depending on the desired output.

\mathbf will print bold in math, but the letters are upright whereas \boldmath and \bm produces italic letters.

There is \boldsymbol (also amsmath) also for symbols that are not printed in bold by \mathbf.

\documentclass{article}
\usepackage{mathtools}
\usepackage{bm}
\begin{document}

We have these two points $\mathbf{a_1}$ and $\mathbf{a_2}$

We have these two points $\bm{a_1}$ and $\bm{a_2}$

\boldmath We have these two points $a_1$ and $a_2$\unboldmath

\end{document}