[Tex/LaTex] Could not get round corner working in mdframed

mdframed

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}

Best Answer

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

Related Question