
이거 재현 가능할까요쾌적한 정리 환경사용 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}