GeneralDifficulties with mdframed

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulties with mdframed

Post by Cham »

I'm having some troubles with the mdframed package options. Here's a MWE to show the problem :

Code: Select all

\documentclass[12pt,oneside]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{mdframed}
\usepackage{xcolor}

\begin{document}

Bla bla bla bla

\begin{mdframed}[linecolor=gray,roundcorner=12pt,backgroundcolor=brown!15,linewidth=1pt,leftmargin=0cm,rightmargin=0cm,topline=true,bottomline=true,skipabove=12pt]

\subsubsection*{Some title}

Some text just some text.  Some text just some text.  Some text just some text.  Some text just some text.  Some text just some text.  Some text just some text.  Some text just some text.  Some text just some text.  Some text just some text.

\end{mdframed}

Bla bla bla

\end{document}
Here's a picture of the output, showing two problems :
mdframed.jpg
mdframed.jpg (33.61 KiB) Viewed 9627 times
The main problem is the extra space above the subsubsection title. How to remove or adjust that useless space ?

The second problem are the corners. I'm currently unable to add some round corners.

Any ideas about these ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulties with mdframed

Post by Cham »

Adding the option [cmd]innertopmargin=0pt[/cmd] gives a better space above the title. But still unable to make round corners.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Difficulties with mdframed

Post by Stefan Kottwitz »

Try

\usepackage[framemethod=TikZ]{mdframed}

then round corners should work.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Difficulties with mdframed

Post by Cham »

Yes, it's working. But then I lost my shadow and get a weird complicated message instead. I guess these shadow options are incompatible with the round corners : shadow=true,shadowsize=2pt,shadowcolor=gray!30.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Difficulties with mdframed

Post by cgnieder »

Not an answer, just a remark: I used to use mdframed a lot but nowadays I exclusively use tcolorbox: it is more flexible, gives better results. IMHO it is worth the trouble to switch from one to the other.
site moderator & package author
Post Reply