GeneralUse of mdframed

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
psionman
Posts: 30
Joined: Thu Nov 10, 2011 3:33 pm

Use of mdframed

Post by psionman »

I am trying to produce framed definition theorems etc. It works well if I use the documentclass book, but not if I use amsbook (the latter sorts out page numbering problems)

The problem is that no space appears between the boxed definition and the text. Can anyone help?

Code: Select all

\documentclass[a4paper,11pt, fleqn]{amsbook}
\usepackage{lipsum}
\usepackage{mdframed}
\newmdtheoremenv{defn}{Definition}[chapter]

\begin{document}
\lipsum[1]


\begin{defn}
\textbf{Prime numbers} \label {Defn:Prime} \lipsum[2]
\end{defn}

\lipsum[3]

\end{document}

Recommended reading 2024:

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

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

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Use of mdframed

Post by esdd »

Try

Code: Select all

\documentclass[a4paper,11pt, fleqn]{amsbook}
\usepackage{lipsum}
\usepackage{mdframed}
\newmdtheoremenv[
  innertopmargin=0pt,
  skipabove=\baselineskip,
  aftersingleframe=\bigskip,afterlastframe=\bigskip
]{defn}{Definition}[chapter]

\begin{document}
\lipsum[1]

\begin{defn}
\textbf{Prime numbers} \label {Defn:Prime} \lipsum[2]
\end{defn}

\lipsum[3]

\end{document}
amsbookmd.PNG
amsbookmd.PNG (31.83 KiB) Viewed 6846 times
Best regards
Elke
psionman
Posts: 30
Joined: Thu Nov 10, 2011 3:33 pm

Re: Use of mdframed

Post by psionman »

Thanks Elke. That fixed it
Post Reply