8

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?

7

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}
7

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

  • 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 Jun 28 '15 at 10:06
  • @P.-S.Park True. I've fixed the problem; the code is even shorter now! – Gonzalo Medina Jun 29 '15 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.