Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Something like this is already available in the arrows tikz library. Check out section 23.4 in the current pgf manual: ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/… –  qubyte Mar 3 '12 at 10:33
    
Have a look at this question: tex.stackexchange.com/questions/42611/… –  Marco Daniel Mar 3 '12 at 10:42
add comment

1 Answer

up vote 6 down vote accepted

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

share|improve this answer
    
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 3 '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 7 at 7:52
    
Also, in the new arrows.meta library, the above arrowheads are called Arc Barb and Arc Barb[reversed]. –  Neil G Feb 7 at 7:54
    
This is an old answer to an old question. You should open a new question that references this answer. –  qubyte Feb 7 at 12:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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