27

Round corner is not working in mdframed environment although I followed the example shown in the mdframed package. Below is my code

\documentclass[10pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[usenames]{color} 
\usepackage[usenames]{xcolor}
\usepackage{mdframed} 
\usepackage{lipsum}

\begin{document}


\mdfsetup{%
   middlelinecolor=red,
   middlelinewidth=2pt,
   backgroundcolor=red!20,
   roundcorner=20pt}

   \begin{mdframed}
   \lipsum[3]
   \end{mdframed}

\end{document}

1 Answer 1

39

You have to pass framemethod=TikZ (or framemethod=pstricks if working with xelatex/latex...) option to \usepackage{mdframed} like

\usepackage[framemethod=TikZ]{mdframed}

Without any options, the frame is set to default in which roundcorner is equal to 0pt.

Full code:

\documentclass[10pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
%\usepackage[usenames]{color}
\usepackage[usenames]{xcolor}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}

\begin{document}


\mdfsetup{%
   middlelinecolor=red,
   middlelinewidth=2pt,
   backgroundcolor=red!20,
   roundcorner=20pt}

   \begin{mdframed}
   \lipsum[3]
   \end{mdframed}

\end{document}

enter image description here

2
  • framemethod=pstricks does not seem to work with XeLaTeX, but framemethod=TikZ works great.
    – Rafal
    Nov 26, 2014 at 11:04
  • If you read this, odds are that you really want: \begin{mdframed}[backgroundcolor=red,roundcorner=3pt]{ ...content... }\end{mdframed}. It sets the frame parameters only for the content and not globally. Anyways, good solution, thanks!
    – peterh
    Mar 25, 2021 at 23:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .