# How to write ':' and '_' in equation? [closed]

$$\label{eq:policy} $$\text{[DIP:10.1.0.17] \rightarrow F \rightarrow L}$$$$


Gives me many errors like ! Missing $inserted and Bad math environment delimiter. How do I remove these errors? - ## closed as too localized by yo', Thorsten, lockstep, mafp, diabonasMay 10 '13 at 8:48 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question. Remove the $$ and $$ from equation environment -- it's already math-mode. If it were me, though, I would go through and see what actually needs to be in math-mode - the code is a bit wonky as it stands. – Sean Allred May 10 '13 at 4:41 It seems like you're lacking some basic fundamentals of math mode in LaTeX. Perhaps consider reading the Not So Short Introduction to LaTeX. Also, you might consider it useful to view Which manuals are on your “TeX Reference” shelf? – Werner May 10 '13 at 4:56 ## 3 Answers You've got your math-modes mixed up. Consider: $$% 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$$ % 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: $$\label{eq:policy} \text{[DIP:10.1.0.17]} \rightarrow \text{F} \rightarrow \text{L}$$  To add an underscore, use it as a control sequence: $$\label{eq:policy} \text{[DIP:10.1.0.17]} \rightarrow \text{F} \rightarrow \text{L\_}$$  (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'.)

-
You can borrow my output image from my answer if you don't mind. –  kiss my armpit May 10 '13 at 4:56
@Bugbusters Thanks! –  Sean Allred May 10 '13 at 4:58

## Version 1:

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

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

\end{document}


## Version 2:

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

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

\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 4:43
$$\label{eq:policy} \text{[DIP:10.1.0.17] \rightarrow F \rightarrow L}$$

or

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


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.

-