# What are the relative strong and weak points between tcolorbox and mdframed?

I think practically we will not use both tcolorbox and mdframed in a single input file. Correct me if I am wrong. So we have to choose either tcolorbox or mdframed. However, without knowing the strong and weak points of both, we can only choose one by gambling.

Shortly speaking, what are the weak and strong points of both packages? The answers really influence the path of my life in TeX.

• I remember Marco Daniel saying that tcolorbox is more advanced than mdframed. My memory may bad though. Kindly excuse if I am wrong. – user11232 Oct 1 '13 at 2:05
• – clemens Oct 2 '13 at 8:54
• Very interested in an answer to this question as well. – Ingo Oct 21 '13 at 9:22

I have the understanding that tcolorbox capabilities are a superset of mdframed. While mdframed tries to give you tools to create colorful frames, they look pale and simpler to me comparing to tcolorbox ones.

I think with enough tikz ninja skills you can achieve pretty much what you want with both, but somehow the tcolorbox syntax and options are simpler to me.

Also, tcolorbox has this "upper part/lower part" capabilities that mdframed lacks and creating a simple colored frame with a title seems simpler with tcolorbox.

From the documentation of mdframed

\mdfdefinestyle{theoremstyle}{%
linecolor=red,middlelinewidth=2pt,%
frametitlerule=true,%
apptotikzsetting={\tikzset{mdfframetitlebackground/.append style={%
frametitlerulecolor=green!60,
frametitlerulewidth=1pt,
innertopmargin=\topskip,
}
\mdtheorem[style=theoremstyle]{definition}{Definition}
\begin{definition}[Inhomogeneous linear]
\ExampleText
\end{definition}
\begin{definition*}[Inhomogeneous linear]
\ExampleText
\end{definition*}


the equivalent in tcolorbox documentation:

\tcbuselibrary{theorems}
\newtcbtheorem[number within=section]{mytheo}{My Theorem}%
{colback=green!5,colframe=green!35!black,fonttitle=\bfseries}{th}

\begin{mytheo}{This is my title}{theoexample}
This is the text of the theorem. The counter is automatically assigned and,
in this example, prefixed with the section number. This theorem is numbered with
\ref{th:theoexample} and is given on page \pageref{th:theoexample}.
\end{mytheo}


@claudio-fiandrino mentioned that mdframe boxes can be customized with tikz. This is also the case with tcolorbox, since it relies on tikz.

\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black, width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=ske}
This is my content.
\end{tcolorbox}
This is my content.
\end{tcolorbox}


• Actually, like tikz, the tcolorbox package relies on pgf, a lower level framework. But Tikz support can be loaded as a library. – mhelvens Oct 22 '13 at 0:46

For what it's worth: I've been using mdframed for quite a while… I didn't know tcolorbox existed! After browsing the tcolorbox documentation for a couple of minutes, I'm itching to convert my documents.

It seems to me like an extremely well-crafted package. It is natively based on pgf, and uses pgfkeys properly to provide its own range of options, which is to me a mark of quality. It also offers a suite of libraries to extend functionality, such as full tikz support.

In contrast, the mdframed interface has always felt a bit clumsy and frustrating to me. And support for custom TikZ options seems to be 'tacked on', rather than properly implemented. In addition, I've had it conflict with other packages on more than one occasion.

I read little doc about tcolorbox, and some doc on mdframed, i mainly use mdframed for my environments. In my opinion, one can change frameline with mdframed using tikz/pgf easily, there are many illustrations on stackexchange given by Gonzalo Medina and someone else. As for tcolorbox, it seems that there is little example code, but the tcolorbox's documentation is very beautifully made.

• Also tcolorbox allows to easily change the so called skin with custom TikZ/PGF frames. – Claudio Fiandrino Oct 2 '13 at 8:47
• i have changed my mind, tcolorbox is flexible – huizhan wang Dec 9 '13 at 12:52