5

I want to draw a arrow head on a arch but the size sounds like too bit and direction not correct!

\documentclass[tikz,convert={size=50x50,outfile=\jobname.gif}]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\def\centerarc[#1](#2)(#3:#4:#5)% Syntax: [draw options] (center) (initial angle:final angle:radius)
    { \draw[#1] ($(#2)+({#5*cos(#3)},{#5*sin(#3)})$) arc (#3:#4:#5); }
\begin{document}
\begin{tikzpicture}[line width=4pt,>=triangle 60]
\def\r{0.35}
\draw[draw=black] (-1,-1) rectangle (1,1);
%\draw (0,0) circle (\r);
\centerarc[->,line cap=round](0,0)(330:30:\r)
\end{tikzpicture}
\end{document}

I know the size is too small! I wish to use it as a icon.

enter image description here

8

There are many reasons why the arrows library is said to be superseded by arrows.meta, this is one of them. The IMHO most elegant way to add such a big arrow to this tiny arc is to bend it.

\documentclass[tikz,convert={size=50x50,outfile=\jobname.gif}]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending}
\usetikzlibrary{calc}
\def\centerarc[#1](#2)(#3:#4:#5)% Syntax: [draw options] (center) (initial angle:final angle:radius)
    { \draw[#1] ($(#2)+(#3:#5)$) arc (#3:#4:#5); }
\begin{document}
\begin{tikzpicture}[line width=4pt,>={Triangle[bend]}]
\def\r{0.35}
\draw[draw=black] (-1,-1) rectangle (1,1);
%\draw (0,0) circle (\r);
\centerarc[->,line cap=round](0,0)(330:30:\r)
\end{tikzpicture}
\end{document}

enter image description here

If I were to make this an icon, I probably would use a slightly smaller arrow.

\documentclass[tikz,convert={size=50x50,outfile=\jobname.gif}]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending}
\usetikzlibrary{calc}
\def\centerarc[#1](#2)(#3:#4:#5)% Syntax: [draw options] (center) (initial angle:final angle:radius)
    { \draw[#1] ($(#2)+(#3:#5)$) arc (#3:#4:#5); }
\begin{document}
\begin{tikzpicture}[line width=4pt,>={Triangle[bend,length=10pt,width=10pt]}]
\def\r{0.35}
\draw[draw=black] (-1,-1) rectangle (1,1);
%\draw (0,0) circle (\r);
\centerarc[->,line cap=round](0,0)(330:30:\r)
\end{tikzpicture}
\end{document}

enter image description here

2

Customize arrow tip maybe workaround this issue but need manually adjust the yoffset and rotation angle case by case!

\documentclass[tikz,convert={size=50x50,outfile=\jobname.gif}]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,bending}
\usetikzlibrary{calc}
\def\centerarc[#1](#2)(#3:#4:#5) {\draw[#1] (#2)++(#3:#5) arc (#3:#4:#5); }
 \pgfarrowsdeclare{myarr}{myarr}% My arrow tip
 { \pgfarrowsleftextend{-2\pgflinewidth}
  \pgfarrowsrightextend{2\pgflinewidth}}
 {\pgftransformrotate{-40}%angle
  %\pgftransformxshift{1\pgflinewidth}
 \pgftransformyshift{\pgflinewidth} 
  \pgfpathmoveto{\pgfpoint{2\pgflinewidth}{0\pgflinewidth}} %A
  \pgfpathlineto{\pgfpoint{0\pgflinewidth}{1.5\pgflinewidth}} %B
  \pgfpathlineto{\pgfpoint{0\pgflinewidth}{-1.5\pgflinewidth}} %C
  \pgfpathclose
  \pgfusepathqfill}
\begin{document}
\begin{tikzpicture}[line width=4pt,>=myarr]
\def\r{0.35}
\draw[draw=black] (-1,-1) rectangle (1,1);
\centerarc[->,line cap=round](0,0)(330:30:\r)
\end{tikzpicture}
\end{document}

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.