How to only round selected corners in a fancytitle box with Tikz

Posted by Christian Jonassen on Stack Overflow See other posts from Stack Overflow or by Christian Jonassen
Published on 2010-06-06T10:14:43Z Indexed on 2010/06/06 10:22 UTC
Read the original article Hit count: 536

Filed under:
|
|

If you take a look at http://www.texample.net/tikz/examples/boxes-with-text-and-math/ the boxes there are with rounded corners. In the examples, both the box itself and the title is a box. I want the title box to not have the bottom corners rounded.

On page 120 in the manual, there is a description of how to draw with and without rounded corners. However, I want to use this in a fancytitle. It looks a bit silly to have the fancytitle as a box where all corners are rounded when it is as wide as the box itself.

  \begin{tikzpicture}[baseline=-2cm]
    \node [mybox] (box){
      \begin{minipage}[t!]{0.50\textwidth}
        Help, I'm a box
      \end{minipage}
    };
    \node[fancytitle, text width=0.5423\textwidth, text centered, rounded corners] at (box.north) {Help, I'm a title};
  \end{tikzpicture}

The style I use is this

  \tikzstyle{mybox} = [draw=red, fill=blue!20, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
  \tikzstyle{fancytitle} = [fill=red, text=white]

© Stack Overflow or respective owner

Related posts about latex

Related posts about rounded-corners