6

I would like to typeset a squiggly arrow (similar to \leadsto or \rightsquigarrow) with a double head (similar to twoheadrightarrow). I found all kind of posts for straight arrows that provide a solution by combining two horizontally shifted arrows, but this does not work for squiggly arrows, because you cannot superimpose those as easily as straight arrows. I know that what I want is doable with tikzcd (and also plain tikz, I guess), but I would like to use it in usual math mode.

2

2 Answers 2

8

I've never been a fan of clipping but sometimes you just have to go with it...

\documentclass{article}

\usepackage{amssymb}
\usepackage{trimclip}

\makeatletter
\newcommand*{\twoheadrightsquigarrow}{\rightsquigarrow\joinrel\mathrel{\mathpalette\@twoheadrightsquigarrow\relax}}
\newcommand*{\@twoheadrightsquigarrow}[2]{%
   \clipbox{{.7\width} 0pt 0pt {-.2\height}}{$\m@th#1\rightsquigarrow$}%
}

\begin{document}

$a \twoheadrightsquigarrow b$\par
$\scriptstyle a \twoheadrightsquigarrow b$\par
$\scriptscriptstyle a \twoheadrightsquigarrow b$

\end{document}

enter image description here

The four parameters passed to \clipbox are the margins in the order left/bottom/right/top. The negative top border (then really a padding) is necessary because the arrow head leaks slightly outside the box:

\fboxrule.1pt
\fboxsep-\fboxrule
\fbox{$\rightsquigarrow$}

enter image description here

Without the top padding the arrow head would be then partially cut off.

1
  • Dear campa your question is perfectly valid. I have only thought about the idea and providing a restricted code considering that the user, from his reputation, is not a very experienced LaTeX user. I just drew the symbol and declared it as a new command; in fact I have written that my idea can be improved. So you are also allowed to improve it if you prefer my answer. I will be happy to appreciate and add to my mind other very useful information. I have so much appreciate your impeccable answer. I like Trimclip :-)
    – Sebastiano
    Commented Jul 8, 2021 at 14:42
4

This is a simple idea done with tikz-cd that is possible to improved it. To have the squeeze arrow with two heads I have done a code with this package (see the option squiggly recalled with the \usetikzlibrary{decorations.pathmorphing}). After I have put column sep=1.2em to decrease (if you like you can increase the lenght) the lenght of the arrow and I have used \mkern-10mu to have a low space between the LHS and RHS.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
$cACCD{\begin{tikzcd}[column sep=1.2em]{\mkern-10mu}\arrow[r,two heads,squiggly]&{\mkern-10mu}\end{tikzcd}} bVFGHc$
\end{document}

enter image description here

2
  • 1
    Nice (+1) but would it be possible to make it scale correctly across math styles?
    – campa
    Commented Jul 8, 2021 at 12:24
  • @campa You will found the comment below your excellent answer.
    – Sebastiano
    Commented Jul 8, 2021 at 14:43

You must log in to answer this question.

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