7

I want to make a half circle border, as an arrow head in a tikz diagram.

Does anyone have an idea how to make this style?

Galadude
  • 143
  • Something like this is already available in the arrows tikz library. Check out section 23.4 in the current pgf manual: http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf – qubyte Mar 03 '12 at 10:33
  • Have a look at this question: http://tex.stackexchange.com/questions/42611/list-of-available-tikz-libraries-with-a-short-introduction – Marco Daniel Mar 03 '12 at 10:42

1 Answers1

8

Using the arrows library and a dash of PGF code, you can do the following (adapted from an example in the manual, see section 74.2).

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}

% Code for the new arrow tip, called halfcirc.
\pgfarrowsdeclare{halfcirc}{halfcirc}
{
\arrowsize=0.2pt
\advance\arrowsize by .5\pgflinewidth
\pgfarrowsleftextend{-4\arrowsize-.5\pgflinewidth}
\pgfarrowsrightextend{.5\pgflinewidth}
}
{
\arrowsize=0.2pt
\advance\arrowsize by .5\pgflinewidth
\pgfsetdash{}{0pt} % do not dash
\pgfsetroundjoin % fix join
\pgfsetroundcap % fix cap
\pgfpathmoveto{\pgfpoint{-4\arrowsize}{4\arrowsize}}
\pgfpatharc{90}{-90}{4\arrowsize}
\pgfusepathqstroke
}

% Declare a reversed version called revhalfcirc.
\pgfarrowsdeclarereversed{revhalfcirc}{revhalfcirc}{halfcirc}{halfcirc}

% Demonstration of the arrow tip.
\begin{tikzpicture}
\draw[help lines] (-3,-2) grid (3,2);
\draw[line width=10pt, revhalfcirc-halfcirc] (-2,0) -- (0,0);
\end{tikzpicture}

\end{document}

enter image description here

qubyte
  • 17,299
  • If you want a semicircles instead (filled or unfilled) this is also pretty straight forward. I can easily adjust the answer to suit you if you want something slightly different from the above. – qubyte Mar 03 '12 at 11:53
  • I could really use filled and unfilled semicircles if you find the time. However, I am using the new arrows.meta library. Not sure if that affects things. – Neil G Feb 07 '14 at 07:52
  • Also, in the new arrows.meta library, the above arrowheads are called Arc Barb and Arc Barb[reversed]. – Neil G Feb 07 '14 at 07:54
  • This is an old answer to an old question. You should open a new question that references this answer. – qubyte Feb 07 '14 at 12:25