# I'm having trouble defining a new command

so what I want to do is make commands that makes mm, in regular font in my equations. So before \begin{document} I have put \newcommand{cm}{\text{cm}} and then it comes up as Latex Error: No \begin{document}. Can someone tell me what I'm doing wrong?

• Commands begin with a backslash: \newcommand{\cm}{\text{cm}} – Gonzalo Medina Sep 19 '13 at 16:13
• You may want to look at the siunitx package. – egreg Sep 19 '13 at 16:24
• Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. – cmhughes Sep 19 '13 at 16:39

Well, trying to give a complete answer:

1. The correct syntax, as described by MMA is:

\newcommand{<commandname>}[<arguments>]{<definition>}


Please note that the <commandname> must start with \. Example:

\newcommand{\acro}[1]{{\normalfont\slshape #1\/}}

2. Since what it seems you are trying to use is units, you should check the siunitx package, as described by egreg.

The syntax while using the siunitx package is: \SI{quantity}{unit}. For example \SI{3.14}{\metre}`