5

I wonder if there is a horizontal line math symbol that

  • has the same length as \longto, \longmapsto, etc but does not contain any arrow tips, and
  • is a \mathrel?

I am currently using \mathrel{-\!-} and have difficulty figuring out the length of the line.

Symbol 1
  • 36,855

2 Answers2

5

If one ignore the broken \longmapsto length under \scriptscriptstyle, this should do:

enter image description here

\documentclass{article}

\DeclareDocumentCommand{\longdash}{}{% \mathrel{\relbar\mkern-6.5mu\relbar\mkern-6.5mu\relbar}}

\begin{document}

$a \longmapsto b_{a \longmapsto b_{a \longmapsto b}}$

$a \longdash b_{a \longdash b_{a \longdash b}}$

\end{document}

Werner
  • 603,163
3

Here's a way that also avoids the hole in \scriptscriptstyle:

\documentclass{article}

\makeatletter \DeclareRobustCommand{\longdash}{% \mathrel{\mathpalette\longvdash@\relax}% } \DeclareRobustCommand{\longvdash}{\mapstochar\longdash} \newcommand{\longvdash@}[2]{% \begingroup \sbox\z@{$\m@th#1\longrightarrow$}% \hb@xt@\wd\z@{\dashfill{#1}}% \endgroup } \newcommand{\dashfill}[1]{% modelled on \rightarrowfill $\m@th#1% \smash-\mkern-7mu \cleaders\hbox{$#1\mkern-2mu\smash-\mkern-2mu$}\hfill \mkern-7mu\smash-$% } \makeatother

\begin{document}

$a \longrightarrow b_{a \longrightarrow b_{a \longrightarrow b}}$

$a \longmapsto b_{a \longmapsto b_{a \longmapsto b}}$

$a \longdash b_{a \longdash b_{a \longdash b}}$

$a \longvdash b_{a \longvdash b_{a \longvdash b}}$

\end{document}

enter image description here

egreg
  • 1,121,712