9

I wanted to draw a long \mapsto-like arrow like this:

enter image description here

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
    \node (sequence) at (0,0) {
        $\sqrt[4]{2} 
        \mapsto \sqrt[4]{2}\,i 
        \mapsto -\sqrt[4]{2} 
        \mapsto -\sqrt[4]{2}\,i$
    };
    \draw[|->,looseness=3] 
        (sequence.mid east) 
        to[out=0,in=0] (sequence.south east) 
        -- (sequence.south west) 
        to[out=180,in=180] (sequence.mid west);
\end{tikzpicture}

\end{document}

But, that's not pretty. The head of long arrow is too small and the tail is too big.

Could you teach me how to adjust the arrow?

0

2 Answers 2

9

enter image description here

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{arrows.meta}
\tikzset{|/.tip={Bar[width=.8ex,round]}}

\begin{document}

\begin{tikzpicture}
    \node (sequence) at (0,0) {
        $\sqrt[4]{2} 
        \mapsto \sqrt[4]{2}\,i 
        \mapsto -\sqrt[4]{2} 
        \mapsto -\sqrt[4]{2}\,i$
    };
    \draw[|->,looseness=3] 
        (sequence.mid east) 
        to[out=0,in=0] (sequence.south east) 
        -- (sequence.south west) 
        to[out=180,in=180] (sequence.mid west);
\end{tikzpicture}

\end{document}
0
8

Another option is to use the built-in mapsto arrow from tikz-cd. The advantage here is that you don't have to guess lengths for the arrow:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}[
  column sep=1em,
  every arrow/.style={draw,mapsto}
]
\sqrt[4]{2}\ar[r] & \sqrt[4]{2}\,i\ar[r] & -\sqrt[4]{2}\ar[r] & -\sqrt[4]{2}\,i
  \arrow[lll,rounded corners,to path={ -| ([xshift=2ex,yshift=-2.5ex]\tikztostart.east) -- ([xshift=-2ex,yshift=-2.5ex]\tikztotarget.west) |- (\tikztotarget) }]
\end{tikzcd}

\end{document}

enter image description here

3
  • 1
    How beautiful! The attached picture has a hangnail(?) at the below right corner. But, actually, this code gives a very clean and elegant picture.
    – P.-S. Park
    Commented Jun 28, 2015 at 10:06
  • @P.-S.Park True. I've fixed the problem; the code is even shorter now! Commented Jun 29, 2015 at 22:39
  • 1
    How is it possible to use tikz-cd's mapsto arrow in a normal tikz environment as well?
    – ComFreek
    Commented Apr 21, 2020 at 16:54

You must log in to answer this question.

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