0

I'm using squiggly arrows with two heads or with tails in diagrams with tikz-cd, and I'd like to use similar-looking arrows inline. I know that there are e.g. \rightsquigarrow and \rightarrowtail in amsmath, but I couldn't find a squiggly arrow with a tail in the symbol list.

What's the easiest way to get such arrows (squiggly with tail or two heads)? I've found answers on how to use inline tikz diagrams for arrows with labels here and here, but this looks pretty complicated and I don't need labels.

Is there a simple and performant way of using tikz arrow shapes inline? Or how else could I create the desired arrows?

  • Unicode defines some squiggly arrows: ⟿⬳⬿⇜⇝. Try out some of the OTF math fonts: texmf /fonts/opentype/public/.... (the Tex Gyre ones, for example) – Cicada Nov 13 '22 at 12:33

2 Answers2

1

The legacy font family lasy has a (repeatable) squiggle in it at slot 58, and arrowhead at slot 59:

squiggle

MWE

\documentclass[12pt]{article}

\usepackage{fonttable}

\begin{document} \xfonttable{U}{lasy}{m}{n}

\newcommand\squiggle{% {\usefont{U}{lasy}{m}{n}\char58\char58\char58\char58\char58\char58\char58\char58\char59} } \newcommand\squigglea{% {\usefont{U}{lasy}{m}{n}\char58} } \newcommand\squiggleb{% {\usefont{U}{lasy}{m}{n}\char59} } \newcommand\squigglec{% {\usefont{U}{lasy}{m}{n}\char58\char59\char59} }

\squiggle :: \squigglea + \squiggleb + \squiggleb = \squigglec

\end{document}

Cicada
  • 10,129
  • great, thanks! and sorry for the late reaction. what makes this font a "legacy font"? – user313032 Dec 19 '22 at 22:11
  • "Legacy" used rather loosely for 128 or 256-slot fontfile accessed via NFSS method, rather than a .ttf/.otf (Unicode) font accessed by name via fontspec. More specifically, in this case, a PostScript (Adobe Type 1) font, from decades ago, made up of a set of metric files, .afm, .pfb, etc - see e.g. ...\texmf-dist\fonts\type1\public\amsfonts\latxfont\lasy10.pfm. ulem package uses it for underwavy, and obsolete latexsym package uses the arrow-head version to define mathematical relational operator \leadsto. – Cicada Dec 20 '22 at 11:13
1

Note: to use squiggle arrows in tikzcd you must load the decorations.pathmorphing library. You can use tikzcd inline using the cramped option:

Here is an inline map \begin{tikzcd}[cramped]A\arrow[r, leftrightsquigarrow]&B\end{tikzcd} with a squiggle.

enter image description here

If you will use this construction frequently, you may want to define a macro. But then you must use ampersand replacement. You can do the same for leftsquigarrow.

enter image description here

To get a tail you can use P\arrow[r, rightsquigarrow, tail]&Q:

enter image description here

You can also change the arrowhead using the squiggly option. For example: P\arrow[r, -stealth, squiggly, tail]

enter image description here

\documentclass{article}

\usepackage{tikz-cd} \usetikzlibrary{decorations.pathmorphing}

\newcommand{\lrsquig}[2]{\begin{tikzcd}[cramped, ampersand replacement=&]#1\arrow[r, leftrightsquigarrow]&#2\end{tikzcd}}

\begin{document} Here is an inline map \lrsquig{A}{B} with a squiggle. It also works in display: [ \lrsquig{X}{Y} ] Here is the next line. \end{document}

Sandy G
  • 42,558