Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I tried to draw an arrow with the command

\leadsto

But I get the following exception:

! LaTeX Error: Command \leadsto not provided in base LaTeX2e.

So how can I draw such an arrow?

I tried to import latexsym

But then I get this error:

! Missing $ inserted.
<inserted text> 
                $
l.56 ...ecognition, gestures recognition. \leadsto
                                                   Multimodal input system & \\

? 
share|improve this question
add comment

4 Answers

up vote 12 down vote accepted

\leadsto is a math sign and for this only available in math mode.

You must enclose it in dollar signs $...$ (or \(...\) for inline math or use it in display math like \[...\] or the {equation} environment

[…] gestures recognition. $\leadsto$ Multimodal input system & […]
share|improve this answer
add comment

The package amssymb provides \leadsto and many other symbols.

A good resource for finding symbols and the packages providing them is the "Comprehensive LaTeX Symbol List" that probably is already on your disk as part of the TeX distribution.

See also How to look up a math symbol

share|improve this answer
    
I tried this, but then I get the same error as when using latexsym –  RoflcoptrException Oct 3 '11 at 10:06
    
@Roflcoptr No, the error is different; look at Tobi's answer. –  egreg Oct 3 '11 at 10:14
add comment

If you find that you often use this in text mode, I would define a macro as below using the xspace package and always use Leadsto:

\documentclass{article}
\usepackage{amssymb}
\usepackage{xspace}

\newcommand*{\Leadsto}{\ensuremath{\leadsto}\xspace}%

\begin{document}
    Now you can use \Leadsto outside in text mode or $\Leadsto$ in math mode.
\end{document}

The xspace command decides whether to insert a space or not -- see the package documentation. If you don't want to load another package you can use it as \Leadsto{} for the case where you want to insert a trailing space. Alternatively, you could hard code in a space at the end of the definition as I can't think of a case where you'd not have have text following this character -- altough, I prefer the xspace solution.

share|improve this answer
    
Does xspace work well in math mode? That is, will this give the right spacing when used as $x \Leadsto y$? –  Aditya Oct 5 '11 at 16:39
    
Seems to for me. Did you try it and found that it did not? –  Peter Grill Oct 5 '11 at 16:43
add comment

You can load the amsmath and the amsfonts package.

share|improve this answer
    
Good advice, amsfonts provides that symbol. However, the answer doesn't solve the problem of the OP because he didn't use it in math mode even when he loaded latexsym which provides such a symbol. –  Stefan Kottwitz Nov 12 '11 at 10:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.