# A longer dash like the line from rightarrow without an arrow tip

I want to use arrows to talk about edges in graphs. For example I write $\to \to$ to represent two adjacent directed edges.

An undirected edge followed by a directed edge would be represented by something like $- \to$, but this looks bad, because the line $-$ is shorter than $\to$.

How do you make $-$ longer? Line drawing commands like rule or \tikz\draw do not look right, because they make a rectangle with sharp corners unlike the rounded corners of \to. (or perhaps making $\to$ shorter is the better way?)

Here's a solution:

\documentclass{article}

\usepackage{mathtools}
\newcommand{\mathdash}{\relbar\mkern-9mu\relbar}

\begin{document}

$\begin{array}{l} A - B \\A \rightarrow B \\ A \mathdash B\\ \end{array}$%

\end{document}


• Not perfect. How do you prevent the line breaking algorithm from splitting this symbol into two symbols when the box is too small? \parbox{1em}{$\mathdash$} – BeniBela Jun 8 '18 at 22:16