mdframed:在没有顶线、右线等的环境中使用定理样式时出现错误(带有圆角)

mdframed:在没有顶线、右线等的环境中使用定理样式时出现错误(带有圆角)

当在环境中使用定理的样式,并且该环境是一条线,但topline=falserightline=false等时,定理的某些属性不被使用。这里,的 MWE roundcorner

你遇到过这个问题吗?我认为这是 的一个错误mdframed

\documentclass{article}
\usepackage{xcolor}
\usepackage[framemethod=tikz, needspace=1.5cm]{mdframed}

\newmdenv[%
linecolor = red,
topline = false,    % This is where the bug comes from
bottomline = false, % This is where the bug comes from
leftline = false,   % This is where the bug comes from
rightline = true,
]
{rightLineCorner}

\mdfdefinestyle{roundedStyle}{%
roundcorner=10pt,
linewidth=0pt,
backgroundcolor=yellow
}

\mdtheorem[style=roundedStyle]{roundedBox}{Test}


\begin{document}

\begin{rightLineCorner}
\begin{roundedBox}
There should be rounded corners!!!
\end{roundedBox}
\end{rightLineCorner}

\begin{roundedBox}
Just as here!
\end{roundedBox}

\end{document}

在此处输入图片描述

答案1

我不认为这是一个错误,而是一个令人惊讶的功能(我不会认为等topline=false会对圆角产生影响)。

您应该明确覆盖属性topline=falserightline=false等等。

\documentclass{article}
\usepackage{xcolor}
\usepackage[framemethod=tikz, needspace=1.5cm]{mdframed}

\newmdenv[%
linecolor = red,
topline = false,    % This is where the bug comes from
bottomline = false, % This is where the bug comes from
leftline = false,   % This is where the bug comes from
rightline = true,
]
{rightLineCorner}

\mdfdefinestyle{roundedStyle}{%
roundcorner=10pt,
linewidth=0pt,
backgroundcolor=yellow,
topline = true,    
bottomline = true,
leftline = true,
rightline = true
}

\mdtheorem[style=roundedStyle]{roundedBox}{Test}


\begin{document}

\begin{rightLineCorner}
\begin{roundedBox}
There are rounded corners!!!
\end{roundedBox}
\end{rightLineCorner}

\begin{roundedBox}
Just as here!
\end{roundedBox}

\end{document}

在此处输入图片描述

相关内容