2

I want to draw a frame around my "thmtools" theorems. Theorems should look like the first example. The problem is that sometimes my theorems are getting quite long and should be spanned over two pages. This only works if I define my frames using the mdframed=... parameter (example 2).

So far so good... The problem is that I use KOMA-Script together with "parskip=half" parameter and the top rule strikes out the first text row if I draw the frames using mdframes=.... How can I fix this? It works if I remove the parskip=half but I don't want this.

\documentclass[parskip=half]{scrbook}
\usepackage{blindtext}
\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[
    shaded={rulecolor=black, bgcolor={rgb}{1,1,1}, rulewidth=1pt}
]{mystylea}

\declaretheoremstyle[
    mdframed={backgroundcolor=white, innertopmargin=0pt, innerbottommargin=1pt, innerleftmargin=1pt, innerrightmargin=1pt, skipabove=1em, skipbelow=1pt, splittopskip=10pt, splitbottomskip=6pt}
]{mystyleb}

\declaretheorem[style=mystylea]{definitiona}
\declaretheorem[style=mystyleb]{definitionb}


\begin{document}
\blindtext
\begin{definitiona}[Definition 1]
  \blindtext
\end{definitiona}
\blindtext
\begin{definitionb}[Definition 2]
  \blindtext
\end{definitionb}
\blindtext
\end{document}
2

You can use innertopmargin=\parskip in \declaretheoremstyle

\documentclass[parskip=half-]{scrbook}
\usepackage{blindtext}
\usepackage{amsthm}
\usepackage{thmtools}

\declaretheoremstyle[
    shaded={rulecolor=black, bgcolor={rgb}{1,1,1}, rulewidth=1pt}
]{mystylea}

\declaretheoremstyle[
    mdframed={backgroundcolor=white,
      innertopmargin=\parskip, 
      innerbottommargin=1pt, innerleftmargin=1pt, innerrightmargin=1pt, 
      skipabove=1em, skipbelow=1pt, 
      splittopskip=10pt, splitbottomskip=6pt}
]{mystyleb}

\declaretheorem[style=mystylea]{definitiona}
\declaretheorem[style=mystyleb]{definitionb}


\begin{document}
\blindtext
\begin{definitiona}[Definition 1]
  \blindtext
\end{definitiona}
\begin{definitionb}[Definition 2]
  \blindtext
\end{definitionb}
\blindtext
\end{document}

enter image description here

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.