3

I'd like to typeset a path from a vertex to another vertex similar to this: screenshot of CLRS

The examples I've found either use TikZ or does not look right. Is there a way to typeset a path identically to how it's done in CLRS: Introduction to Algorithms 3rd edition?

3
  • 1
    Are you talking about the curved arrow with symbol over it?
    – Sigur
    Nov 20, 2018 at 15:59
  • 1
    Like this? $\overset{p}{\rightsquigarrow}$
    – Sigur
    Nov 20, 2018 at 16:00
  • This works well and looks similar, however, the squiggly line has hard corners, not soft. That's what I'm looking for. Nov 20, 2018 at 16:15

1 Answer 1

3

I believe the arrow on your screen shot is \leadsto from latexsym.

\documentclass{article} 
\usepackage{amsmath,latexsym} 
\begin{document} 
$u\overset{p}{\leadsto} v$ 
\end{document}

enter image description here

A potential issue is that latexsym overwrites a bunch of symbols. Apart from \leadsto, these are

\mho,\sqsupset,\Join,\lhd,\Box,\unlhd,\Diamond,\rhd,\unrhd,\sqsubset

If you are cool with that, then there is nothing else to do. If you only want this symbol and otherwise the more standard ones, you could copy this symbol from the latexsym package and give it a new name:

\documentclass{article} 
\usepackage{amsmath}
\ifx\symlasy\undefined 
\DeclareSymbolFont{lasy}{U}{lasy}{m}{n}
\SetSymbolFont{lasy}{bold}{U}{lasy}{b}{n}
\else 
\fi
\DeclareMathSymbol\myleadsto{\mathrel}{lasy}{"3B}
\begin{document} 
$u\overset{p}{\myleadsto} v$ 
\end{document}

which yields the same output as above.

You must log in to answer this question.

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