3
\begin{equation}
\label{eq:policy}
\(\text{[DIP:10.1.0.17] $\rightarrow$ F $\rightarrow$ L}\)
\end{equation}

Gives me many errors like ! Missing $ inserted and Bad math environment delimiter. How do I remove these errors?

Bruce
  • 239

3 Answers3

6

You've got your math-modes mixed up.

Consider:

\begin{equation}
                                 % In math mode now!
  \(                             % in math mode... again?
    \text{                       % text exits math mode temporarily
      [DIP:10.1.0.17]
      $                          % wait, back in math mode?
      \rightarrow$               % and out again
      F
      $                          % back in math mode
      \rightarrow$               % and out again
      L}                         % back in (out of \text)
  \)                             % and out
\end{equation}                   % and out again??

(Spaces added for clarity.)

You main problem was math-mode-inception. You can't enter math mode twice (nor exit it twice).

Consider using the following instead:

\begin{equation}
  \label{eq:policy}
  \text{[DIP:10.1.0.17]} \rightarrow \text{F} \rightarrow \text{L}
\end{equation}

output

To add an underscore, use it as a control sequence:

\begin{equation}
  \label{eq:policy}
  \text{[DIP:10.1.0.17]} \rightarrow \text{F} \rightarrow \text{L\_}
\end{equation}

underscore

(By the way, this control-sequence technique is used for most special characters ($%#_{}&) - see Escape character in LaTeX. If you have experience in programming C-like languages, think of it as an 'escape'.)

Sean Allred
  • 27,421
2

Version 1:

enter image description here

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}

\(\text{[DIP:10.1.0.17] $\rightarrow$ F $\rightarrow$ L\_}\)

\end{document}

Version 2:

enter image description here

\documentclass[preview,border=12pt]{standalone}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\text{[DIP:10.1.0.17] $\rightarrow$ F $\rightarrow$ L\_}
\label{eq:something}
\end{equation}

\end{document}

Note that you need to change the document class to meet your requirement.

  • Good answer, but this doesn't really explain what went wrong -- it would be helpful for learning's sake, at least. – Sean Allred May 10 '13 at 04:43
2
\begin{equation}
\label{eq:policy}
\text{[DIP:10.1.0.17] $\rightarrow$ F $\rightarrow$ L}
\end{equation}

or

\begin{equation}
\text{[DIP:10.1.0.17]} \rightarrow F \rightarrow L
\end{equation}

Your main error was that you tried to enter math mode inside of an equation environment, where you were already in math mode. For the first display above I just removed your \( and \); for the second one, I also made the \text apply to only the business in between the square brackets. That way, the F and the L appear as math symbols.