3

I got a similar problem to How to draw frame with rounded corners around box

I try to make round boxex for a poster presentation, I could nearly succeed using mdframed-package with tikz-option. But the innerline is almost not rounded and I can't see the reason why. Some small example-code:

\documentclass{beamer}
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}

\usepackage[absolute,overlay]{textpos}
\usepackage[framemethod=tikz]{mdframed}

\tikzset{contour/.style = {rounded corners = 2ex}}

\definecolor{posterbackground}{RGB}{255,245,225}    %beige
%\definecolor{blockborder}{RGB}{0,128,0}    %green
%\definecolor{blockborder}{RGB}{0,0,0}      %black
\definecolor{blockborder}{RGB}{235,235,235} %light grey

\mdfdefinestyle{frameborderstyle}%
{innerlinewidth=0.1em, innerlinecolor=black, middlelinewidth=1.0em, middlelinecolor=blockborder, outerlinewidth=0.1em, outerlinecolor=black, frametitlerule=false, innertopmargin=\topskip, backgroundcolor=posterbackground, roundcorner=0.5em}
%{outerlinecolor=blockborder, outerlinewidth=10pt, innerlinewidth=5pt, backgroundcolor=posterbackground, roundcorner=50pt}
\newenvironment{textframe}[4][]%
{\colorlet{currentcolor}{.} \fboxrule0.2em\fboxsep1.0em \begin{textblock*}{#2}(#3,#4) \begin{mdframed}[style=frameborderstyle, frametitle=#1]}
{\end{mdframed} \end{textblock*} \vspace{2.0ex}}

\begin{document}
 \begin{frame}{blabla}
 \begin{textframe}{1500pt}{50pt}{670pt}
  this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame this is written in a textpos-frame
 \end{textframe}
 \end{frame}
\end{document}

inner corners stay edged even after using of roundcorner-keyword

What am I doing wrong?

4

You have to understand the calculation of the arc by TikZ. This is important because mdframed has no extra modification for the inner arc. Of course I can implement it.

Let's take the following mwe:

\documentclass{article}

\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
 \draw[line width=2ex,rounded corners = 1ex] (0,0) rectangle (7,4);
\end{tikzpicture}
\end{document}

The line width is 2ex and the arc is 1ex. The result is:

As you can see the inner arc isn't there. If you you increase rounded corners greater than 2ex you will get:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
 \draw[line width=2ex,rounded corners = 3ex] (0,0) rectangle (7,4);
\end{tikzpicture}
\end{document}

Related to your example: Your are using innerlinewidth=0.1em, middlelinewidth=1.0em and outerlinewidth=0.1em which leads to the width 1.2em. On the other hand you are specifying roundcorner=0.5em. As explained 0.5em is too small.

So you can either use a greater dimension for roundcorner or you redefine some internal commands to specify an inner arc.

  • ah how complex, thanks for the explanation :-) – Alice Jun 26 '13 at 8:35

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.