In the spirit of this question, how do I make a custom arrow tip using the new arrows.meta TikZ library? I would like to make a semicircular tip that accepts the open option, ideally, and perhaps other options like length (or radius or whatever the Circle arrow tip accepts).

  • A semicircular tip (as Arc Barb[]) is already opened... – Paul Gaborit Feb 8 '14 at 8:56
  • @PaulGaborit: Arc Barb extends back onto the line. I'd like it to like this ------------D with the perpendicular edge and the open space. – Neil G Feb 8 '14 at 9:45
  • 1
    Please don't edit questions to include answers. Either add an answer of your own or edit an existing one. The question space should be reserved for ..., well, questions, really. – cfr Aug 1 '16 at 0:20

The documentation for declaring new arrow tips is fairly comprehensive, but there appear to some errors in the examples. I'm not an expert on the arrows.meta stuff but the following appears to be the minimal requirements to get things started:

    \ifpgfarrowopen o\fi%  
  setup code={
    % The line end value:
    \advance\pgf@x by-.5\pgflinewidth
    % The hull point:
    \advance\pgfutil@tempdima by.5\pgflinewidth
  drawing code={
  defaults={ length=10pt }


\draw [help lines] grid (3,2);
\draw [semicircle-{semicircle[open]}] (0,0) -- (3,2);
\draw [very thick, {semicircle[length=40pt,open]}-{semicircle[length=20pt]}] 
  (0,2) -- (3,0);


enter image description here

| improve this answer | |
  • Thank you. Is there any way to make it so that the border is unnecessary? The other arrow tips automatically extend the border. No problem if that's difficult, but it's definitely nice to have :) – Neil G Feb 9 '14 at 13:28
  • @NeilG just add \pgfarrowshullpoint{0pt}{0pt} \pgfarrowshullpoint{0pt}{-.25\pgfarrowlength} \pgfarrowshullpoint{0pt}{.25\pgfarrowlength} to the setup code. The documentation explains what they do. – Mark Wibrow Feb 9 '14 at 14:07
  • Hmm, I need to add 0.5 \pgflinewidth I believe. How do I do that? – Neil G Feb 9 '14 at 14:39
  • You probably need to use a temporary dimension to do the calculation, for example, \pgfutil@tempdima=0.25\pgfarrowlength \advance\pgfutil@tempdima by.5\pgflinewidth \pgfarrowshullpoint{\pgfutil@tempdima}{\pgfutil@tempdima}. Don't forget to change the catcode of @ though. – Mark Wibrow Feb 10 '14 at 7:15
  • Thank you. I don't know what "changing the catcode of @" means though :( – Neil G Feb 10 '14 at 7:15

I made some improvements to Mark's answer so that semicircle is totally consistent with Circle.

    length  = +2.39365pt +3.191538,
    line width = +0pt 1 1,
  setup code={
    % Cap the line width at 1/2th of the length
    \pgfutil@tempdima.5\pgfarrowlength\advance\pgfutil@tempdima by-.5\pgfarrowlinewidth
    \pgfutil@tempdimb.5\pgfarrowlength\advance\pgfutil@tempdimb by.5\pgfarrowlinewidth
        \pgfarrowssetlineend{.5\pgfarrowlength\advance\pgf@x by-.5\pgfarrowlinewidth}
    % The hull:
    % The following are needed in the code:
  drawing code = {
  parameters = {
    \ifpgfarrowopen o\fi%
    \ifpgfarrowroundjoin j\fi%
| improve this answer | |

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.