이 ntheorem 솔루션을 amsthm + thmtools로 포팅하는 방법은 무엇입니까?

이 ntheorem 솔루션을 amsthm + thmtools로 포팅하는 방법은 무엇입니까?

이거 재현 가능할까요쾌적한 정리 환경사용 amsthm하고 thmtools?

답변1

mdframed프레임을 그리는 데 패키지를 사용할 수도 있습니다 . 정리 설정은 원하는 패키지로 수행할 수 있습니다. 정리 환경을 설정한 후 환경을 \surroundwithmdframed. 필요한 스타일의 경우 짧은 선의 길이가 0.25cm인 다음 정의를 사용할 수 있습니다. 물론 이것은 더 우아하게 수행될 수 있습니다.

calc코드를 단순화하기 위해 TikZ 라이브러리를 사용하고 있습니다 .

\usepackage[framemethod=TikZ]{mdframed}
\usetikzlibrary{calc}
\makeatletter
\newrobustcmd*\mdf@tikzbox@tfl@spare[1]{%three or four borders
    \clip(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);%
    \begin{scope}[mdfcorners]%
       \clip[preaction=mdfouterline]%
            [postaction=mdfbackground]%
            [postaction=mdfinnerline]#1;%
    \end{scope}%
    \path[mdfmiddleline,mdfcorners]($(O|-P)-(0,0.25cm)$)--(O|-P)--(P)--($(P)-(0,0.25cm)$);
    \path[mdfmiddleline,mdfcorners]($(P|-O)+(0,0.25cm)$)--(P|-O)--(O)--($(O)+(0,0.25cm)$);
  }%
\newrobustcmd*\changelinestyle{\let\mdf@tikzbox@tfl\mdf@tikzbox@tfl@spare}
\makeatother
\surroundwithmdframed[settings=\changelinestyle]{theorem}

이 정의를 통해 의 모든 옵션이 mdframed허용됩니다.

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{thmtools}
\declaretheorem[]{theorem}

\usepackage[framemethod=TikZ]{mdframed}
\usetikzlibrary{calc}
\makeatletter
\newrobustcmd*\mdf@tikzbox@tfl@spare[1]{%three or four borders
    \clip(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);%
    \begin{scope}[mdfcorners]%
       \clip[preaction=mdfouterline]%
            [postaction=mdfbackground]%
            [postaction=mdfinnerline]#1;%
    \end{scope}%
    \path[mdfmiddleline,mdfcorners]($(O|-P)-(0,0.25cm)$)--(O|-P)--(P)--($(P)-(0,0.25cm)$);
    \path[mdfmiddleline,mdfcorners]($(P|-O)+(0,0.25cm)$)--(P|-O)--(O)--($(O)+(0,0.25cm)$);
  }%
\newrobustcmd*\changelinestyle{\let\mdf@tikzbox@tfl\mdf@tikzbox@tfl@spare}
\makeatother
\surroundwithmdframed[settings=\changelinestyle,middlelinecolor=blue,roundcorner=3pt,middlelinewidth=1.2pt]{theorem}

\usepackage{lipsum}
\begin{document}
\lipsum[2]

\begin{theorem}%
If~$G$ is a connected graph of order $n\geq 3$ and size~$m$, then
\[
    g(G)\geq \frac{m}{6}-\frac{n}{2}+1.%
\]
\end{theorem}%

\lipsum[2]

\end{document}

관련 정보