# error: 'missing $inserted' even though all$ are paired

The error is coming up even when the \newcommand 's (and \QQ 's) are removed. I'm very new to LaTeX so simple explanations would be really appreciated. Thanks!

• Welcome! Never post screen shots of codes. And there are for instance several \in outside a math environment, so the error is understandable. Also the definitions of \CC and so on can be traded for loading amsfonts or dsfont, which provide the commands \mathbb or \mathds, respectively.
– user194703
May 4 '20 at 2:00
• Not relevant but this question is from Principles of Mathematical Analysis by Rudin May 4 '20 at 2:00
• Oh I see. Thanks Schrodinger's cat! (cool name) I'll edit the post by removing the image and adding the code as text. May 4 '20 at 2:04
• @Schrödinger'scat amssymb (already loaded) loads amsfonts provides \mathbb (just an observation) May 4 '20 at 2:04
• To be clear: it is not sufficient to pair $ signs, you also need to make sure to use math commands such as \in are in math mode. @Au101 Good catch! – user194703 May 4 '20 at 2:06 ## 1 Answer The problem is that you have the \in outside of the math environment. Check the following MWE and how the second one produces your error while the first doesn't. \documentclass{article} \begin{document} \newcommand{\CC}{\textsf{C\kern-1ex C}} This will not produce error$r \in \CC$. While this$r\$ \in \CC will.
\end{document}

• Isn't precisely the content of the comment?
– user194703
May 4 '20 at 2:06
• It is, just showing how to solve it with code.