I want to draw some round-ended rectangles to use as labels, so I thought a filled arc either end would work (silly me :-)

\draw [fill](0,0) arc[radius=5pt,start angle= 90,end angle=270];
\draw [fill](0,0) rectangle (40,-20);
\draw [fill](40,0) arc[radius=5pt,start angle=270,end angle=90];

But this places the right-hand end-cap above the rectangle, and facing the wrong way. I have obviously misunderstood the implications of the direction angles.

How do I draw a filled arc that points right, not left? (that is, D-shaped, the mirror of the first one).

  • If you load the shapes.misc TiKZ library, you can use the shape rounded rectangle which does exactly what I think you want. – cfr Nov 9 '14 at 20:31
  • I think you want a start angle of 90 and an end angle of -90 (because you want the curve to go in the opposite direction). – cfr Nov 9 '14 at 20:41

This shows how to adjust the angles in your original commands (I've scaled the rectangle down just so the labels show up better) and then demonstrates the use of rounded rectangle from the shapes.misc library.

\usetikzlibrary{shapes.misc, positioning}
    \draw (0,0) arc[radius=5pt,start angle= 90,end angle=270];
    \draw (0,0) rectangle (40pt,-20pt);
    \draw (40pt,0) arc[radius=5pt,start angle=90,end angle=-90];
    \node (1) [draw, rounded rectangle] {rounded rectangle};
    \node (2) [below=of 1, draw, rounded rectangle, rounded rectangle west arc=0pt] {rounded rectangle};
    \node (3) [below=of 2, draw, rounded rectangle, rounded rectangle east arc=0pt] {rounded rectangle};

rounded rectangles - multiple ways

  • Thank you...I didn't even check the documentation for that because I thought it was too unlikely a shape to have been considered! – Peter Flynn Nov 9 '14 at 20:44
  • 1
    @PeterFlynn There are some weird and wonderful shapes in the shapes library. Who would have thought that there would be specific shapes for magnetic tape and chamfered rectangle shapes, for example? – cfr Nov 9 '14 at 20:48

If people come to this question via Google (like me) and want to get only a rectangle with rounded corners:

\draw[rounded corners] (0, 0) rectangle (4, 1) {};

This is an empty rectangle with rounded corners. The rectangle is from (0, 0) - the lower left corner - to (4, 1) - the upper right corner.

  • 1
    +1 Exactly what I needed. Thanks – Joseph R. Feb 7 '19 at 15:58
  • 2
    Also works with \node[rectangle, rounded corners] – juanerasmoe Apr 2 '20 at 19:59

Why not using rounded corners locally/globally on the path?



  (0,0) {[rounded corners=15pt] --
  ++(2,0)  -- 
  ++(0,1)} --
  ++(-2,0) --
\draw[rounded corners=15pt]
  (4,0) rectangle ++(2,1);


enter image description here

  • @Gonzalo Mendina What do -- and plus plus do – Vaibhav Nov 10 '14 at 4:02
  • @gonzalo Medina please how to write under it ? – Vrouvrou Mar 26 '18 at 19:29

A PSTricks solution:




  % right end round
  % left end round
  % both ends round



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.