2

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?

1 Answers1

1

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.