2

I'd like to write a curved arrow along a line, like this one. How can I write it?enter image description here

3
  • Welcome to TSE. What did you try? Apr 11 at 12:32
  • 1
    It's not clear what you want. There are so many ways to draw arrows. Can you show us the context? What is it supposed to mean? I suggest you edit your question to add a complete "Minimal Working Example" (MWE) that has a straight arrow where you want the curved one so we can understand your request.
    – Sandy G
    Apr 11 at 12:55
  • 1
    There is \rcurvearrowup from the MnSymbol package. Apr 11 at 13:12

2 Answers 2

5

There exist many ways to draw arrows. For example directly by the \pdfliteral primitive:

x%
\leavevmode\hbox to6pt{%
   \pdfliteral{q 1 J .35 0 0 .35 -2 -2 cm
      10 0 m 20 10 20 20 10 30 c S 10 30 m 13 20 l 19 24 l h B Q}\hss}

\bye
3
  • If I can trust the source, this only works when one uses pdflatex engine to compile a document.
    – Celdor
    Apr 11 at 14:41
  • 2
    Or pdftex. Or luatex when \def \pdfliteral {\pdfextension literal} or xetex when \def\pdfliteral#1{\special{pdf:literal #1}}.
    – wipet
    Apr 11 at 15:00
  • Would you like to explain anything about what's going on in the code block? Apr 11 at 22:51
5

Try this code:

\documentclass[tikz]{standalone}
\def\centerarc[#1](#2)(#3:#4:#5);%
% #1 : options for drawing
% #2 : center of arc
% #3 : start angle for arc
% #4 : end angle for arc
% #5 : radius of arc
{

    \draw[#1]([shift=(#3:#5)]#2) arc (#3:#4:#5);
}
\begin{document}
\begin{tikzpicture}
    \draw[gray!20] (0,0) grid (3,3);% comment if not needed
    \draw (1,1)--(2,2);% comment if not needed
    \draw (1,2)--(2,1);% comment if not needed
    \centerarc[cyan,line width=1pt,-latex](1,1.5)(-26.565:26.565:1.118cm);
\end{tikzpicture}   
    
\end{document}

Output:

enter image description here

More help for the code from this picture:

enter image description here

EDIT: Other examples. Code:

\documentclass[tikz]{standalone}
\def\centerarc[#1](#2)(#3:#4:#5);%
% #1 : options for drawing
% #2 : center of arc
% #3 : start angle for arc
% #4 : end angle for arc
% #5 : radius of arc
{

    \draw[#1]([shift=(#3:#5)]#2) arc (#3:#4:#5);
}
\begin{document}
\begin{tikzpicture}
    \draw[gray!20] (0,0) grid (3,3);% comment if not needed
    %\draw (1,1)--(2,2);% comment if not needed
    %\draw (1,2)--(2,1);% comment if not needed
    \filldraw[cyan] (1,1.5) circle(1pt);
    \draw[cyan,dotted] (2,2)--(1,1.5)--(2,1);
    \centerarc[cyan,line width=1pt,-latex](1,1.5)(-26.565:26.565:1.118cm);
    \filldraw[magenta] (0,1) circle(1pt);
    \draw[magenta,dotted] (1,0)--(0,1)--(1,2);
    \centerarc[magenta,line width=1pt,-latex](0,1)(-45:45:1.412);
    \filldraw[green] (1,0) circle(1pt);
    \draw[green,dotted] (3,1)--(1,0)--(0,2);
    \centerarc[green,line width=1pt,-latex](1,0)(26.565:116.565:2.236);
\end{tikzpicture}   
    
\end{document}

Output:

enter image description here

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.