4

I want to write this simple equation in latex

    2/|w|

In which |w| is the norm of w,,

I tried with

     \frac{2}{\|w\|}

And get error "Missing $ inserted"

then I use this

  \frac{2}{$\|w\|$}

And still get same error..

Does someone know how to solve this problem??

1
  • 6
    \frac is a math command so $\frac{2}{\|w\|}$ Commented Mar 28, 2014 at 15:33

1 Answer 1

10

You'll need to include the whole thing in a math environment, as \frac is a math command.

\documentclass[]{article}

\usepackage[width=2in]{geometry}
\begin{document}

Inline: $ \frac{2}{\|w\|}$ \\[2em]

Display:
\[ \frac{2}{\|w\|} \]

Numbered Display:
\begin{equation} \frac{2}{\|w\|} \end{equation}

\end{document}

Result:

formulas

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .