5

I would like to write the following equation in LaTeX:

enter image description here

Here is my code:

\begin{equation}
       R =  \left\Vert\norm\overrightarrow{q_1c}\right\Vert=\left\Vert\norm\overrightarrow{q_2c}\right\Vert
\end{equation}

Although the result as my expectation, I meet the "Undefined control Sequence" error:

enter image description here

Could you help me fix this problem. Thanks in advance.

Davislor
  • 44,045

1 Answers1

12

You've been informed that \norm is an "undefined control sequence". You further mention, in a comment, that you load the amsmath and amssymb packages. (Aside: Since the amssymb package loads the amsfonts package automatically, you don't need to load the amsfonts package explicitly.)

You have two main options:

  1. Remove the two \norm directives from the code. And, while you're at it, do remove the \left and \right sizing directives as well, as they don't do anything here except create code clutter.

    \documentclass{article} % or some other suitable document class
    \usepackage{amsmath,amssymb}
    \usepackage{old-arrows} % optional (for smaller arrowheads)
    

    \begin{document} \begin{equation} R = \Vert\overrightarrow{q_1c}\Vert = \Vert\overrightarrow{q_2c}\Vert \end{equation} \end{document}

  2. Remove the \left\Vert and \right\Vert directives and define a macro called \norm. I'd like to suggest you load the mathtools package -- a superset of the amsmath package -- for its \DeclarePairedDelimiter macro to define \norm.

    \documentclass{article} % or some other suitable document class
    \usepackage{mathtools,amssymb}
    \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} % define a "\norm" macro
    \usepackage{old-arrows} % optional (for smaller arrowheads)
    

    \begin{document} \begin{equation} R = \norm{\overrightarrow{q_1c}} = \norm{\overrightarrow{q_2c}} \end{equation} \end{document}

With both approaches, you'll get the following output:

enter image description here

Of the two approaches, the second is definitely more "LaTeX-y" as the code (here: \norm{...}) emphasizes the meaning of what you're inputting. This conforms better to LaTeX's design philosophy of distinguishing as much as possible between higher-level meaning and lower-level typesetting aspects of the code.

Mico
  • 506,678