I would to define a new "T" shape (i.e. the red and green shapes in the following image) so that I can then draw with TikZ the diagram below.


Unfortunately I cannot figure out how to do. To be honest, I have read the section "Declaring New Shapes" from the PGF manual and I am completely lost with the low level pgf commands.

How could I do? Suggestions on any direction are welcomed.

  • 1
    Easier reading might be makeshape. – Andrew Swann Aug 20 '13 at 15:31
  • 1
    Can you use an -| arrow, e.g. \draw [-|] (0,0) -- +(0,1);? – Torbjørn T. Aug 20 '13 at 15:48
  • @AndrewSwann Cool I didn't know that. Cannot access it now either but still cool :) – percusse Aug 20 '13 at 17:09
  • @TorbjørnT, I tried but it seems that I don't get a T shape as expected. – Laurent Aug 20 '13 at 18:57
  • What do you get? How much of a T it is depends on the length of the line I guess. – Torbjørn T. Aug 20 '13 at 19:01

Finally, I have succeeded to create a "T" shape by adapting existing examples on the Web. Below is the pgf code to define the shape.

    \inheritanchor[from=rectangle]{north east}
    \inheritanchor[from=rectangle]{south east}
    \inheritanchor[from=rectangle]{south west}
    \inheritanchor[from=rectangle]{north west}
        % store lower right in xa/ya and upper right in xb/yb
       \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
       \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
       \advance\pgf@xc by \pgfmathresult pt
| 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.