2

I would like to create splitted rounder corner with separate frametitle (attached below) using mdframed or mdframed with tikz. My MWE is:

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[usenames]{xcolor}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\definecolor{emacexmfont}{cmyk}{0.7,0.63,0.7,0}
\definecolor{examplebckcolor}{cmyk}{0,0.2,0.25,0}
\begin{document}
\mdfsetup{%
   middlelinecolor=examplebckcolor,
   middlelinewidth=2pt,
   backgroundcolor=examplebckcolor,
   roundcorner=20pt}
\begin{mdframed}
\lipsum[3]
\lipsum[4]
\end{mdframed}
\end{document}

![enter image description here][1]

  • How about using tcolorbox? – user11232 Nov 22 '14 at 1:38
2

coloured boxes, not to my taste!

A beginning which should give you the idea. See the manual for further options:

\documentclass[10pt]{article}
\usepackage[usenames]{xcolor}
\usepackage[framemethod=TikZ]{mdframed}
\usetikzlibrary{positioning}
\usepackage{lipsum}
\definecolor{emacexmfont}{cmyk}{0.7,0.63,0.7,0}
\definecolor{examplebckcolor}{cmyk}{0,0.2,0.25,0}
\tikzset{
  my example style/.style={font=\sffamily\bfseries, anchor=west, align=left, text=blue},
}
\newcounter{example}
\setcounter{example}{0}
\newenvironment{example}[1][]{% based on example 6 in the manual
  \stepcounter{example}%
  \ifstrempty{#1}%
  {\mdfsetup{%
      frametitle={%
        \begin{tikzpicture}
          \node [my example style, text width=.2\linewidth] {\strut Example~\theexample};
        \end{tikzpicture}%
      }%
    }%
  }%
  {\mdfsetup{%
      frametitle={%
        \begin{tikzpicture}
          \node (some node) [my example style, text width=.2\linewidth] {\strut Example~\theexample:};
          \node [my example style, right=0pt of some node, text=blue!60!cyan, text width=.75\linewidth] {\strut #1};
        \end{tikzpicture}%
      }%
    }%
  }%
  \mdfsetup{%
    frametitlebackgroundcolor=yellow,
    linecolor=white,%
    linewidth=0pt,
    frametitlerule=true,
    frametitlerulewidth=2.5pt,
  }\relax
  \begin{mdframed}%
}{%
  \end{mdframed}%
}
\begin{document}
  \mdfsetup{%
    backgroundcolor=examplebckcolor,
    roundcorner=20pt}
  \begin{example}
    \lipsum[3]
    \lipsum[4]
  \end{example}
  \begin{example}[An Example]
    \lipsum[3]
    \lipsum[4]
  \end{example}
\end{document}

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.