# How do I insert bold words inside math mode?

I want to make write an equation that looks like this:

if (x belongs to A) then (B is a subset of C)


I tried using

\documentclass[]{minimal}
\begin{document}
$if x \in A then B \subseteq C$
\end{document}


but it ended up looking pretty ugly, with all the words jumbled together

How can I make the "if" and the "then" appear as separate, bold words to make it clearer that they are keywords? Is there a way to do that from within math mode?

• $\textbf{if } x \in A \textbf{ then } B \subseteq C$ – LaRiFaRi Jun 8 '15 at 22:48

Please avoid mixing text and math if your message can be spelled out as you have here. The easiest way to write this is

If $x\in A$ then $B$ is a subset of $C$. In other words
$$x\in A \implies B \subseteq C$$


But as a complete answer you can write

$\text{\textbf{If }} x \in A \text{\textbf{ then }}B \subseteq C$


As a MWE

\documentclass{article}
\usepackage{mathtools} % <-- fixes, enhances amsmath
\begin{document}
If $x\in A$ then $B$ is a subset of $C$. In other words $$x\in A \implies B \subseteq C$$
$\text{\textbf{If }} x \in A \text{\textbf{ then }}B \subseteq C$
\end{document}


• Why not use simply \texbf{If } and \textbf{ then }? – Bernard Jun 8 '15 at 23:36
• @Bernard -- in the (unlikely) event that bold words occur in a sub/superscript or other environment in a size other than that of the surrounding text, the \text command will choose the appropriate size. – barbara beeton Jun 9 '15 at 13:36
• @barbara beeton: I didn't know that. Never tried either, I confess. – Bernard Jun 9 '15 at 13:41