3

I have the following MWE:

    %!TEX TS-program = XeLaTeX
%!TEX encoding = UTF-8 Unicode


% DEFINITIONS ===================================================
\documentclass[
    12pt,
    a4paper,
    twoside,
    headings=normal,
    titlepage=true
]{scrreprt}


\usepackage[centertags]{amsmath}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amsthm}
\usepackage{thmtools}

\usepackage{lipsum}


\declaretheoremstyle[
    headfont=\bfseries, 
    notebraces={[}{]},
    bodyfont=\normalfont\itshape,
    headpunct={},
    postheadspace=\newline,
    postheadhook={\textcolor{red}{\rule[.6ex]{\linewidth}{0.4pt}}\\},
    spacebelow=0,
    spaceabove=0,
    mdframed={
        linecolor=red, 
        outerlinewidth=3pt,
            innertopmargin=0pt,
            roundcorner=5pt, 
            innerbottommargin=0pt, 
            skipabove=-\parskip, 
            skipbelow=0 } 
]{myFramedDefinitionStyle}%

\declaretheorem[
    style=myFramedDefinitionStyle,
    name=Definition,
    numberwithin=chapter
]{example1}

% Basic Command
\ExplSyntaxOn
    \NewDocumentEnvironment{example} { o o }
     {%
      \IfNoValueTF{#1} {\begin{example1}}{ \begin{example1}[#1] }%                                 
      \IfNoValueTF{#2} {}{\label{#2}}%
     }%
     {%
      \end{example1}%
     }%
\ExplSyntaxOff


\begin{document}
\setlength{\parskip}{5mm}
\lipsum[1]
\begin{example}
asdasd
\end{example}
\lipsum[1]
\begin{example}
asdasd
\end{example}
\end{document}  

Which results in this output, and I am really asking what I am doing wrong? Why is parksip messing up the boxes? Also the workaround from LINK does not help? Does anybody know why this mdframed with thmtools behaves so badly?

Thanks a lot! :-)!!

1

I think your problem is that you spelled parskip as parsep. That is, if you change the four instances of \parsep into four \parskips, then it seems to work as you intended (or at least better).

Edited to add: Now you have (inside the mdframed) a negative value of skipabove, so it seems reasonable that it overlaps with the previous paragraph. Try skipabove=2\parskip or something similar.

  • Correct, i did not want this, but as it seems i still get issues with the vertical spaces. It seems it depends on the version of mdframed somehow...? I corrected the parskip parsep issue above – Gabriel May 28 '14 at 20:09
  • This doesn't fix the problem. – Gonzalo Medina May 28 '14 at 23:41
  • correctly, there is still some bad stuff going on? – Gabriel May 29 '14 at 8:42
  • @Gabriel, please see my new edit. – user6969 May 30 '14 at 20:16

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.