
¿Es posible reproducir esto?ambiente agradable teoremausando amsthm
y thmtools
?
Respuesta1
También puedes utilizar el paquete mdframed
para dibujar el marco. El establecimiento de los teoremas se puede realizar mediante su paquete favorito. Después de configurar el entorno de su teorema, puede rodear el entorno con \surroundwithmdframed
. Para el estilo que necesita, puede utilizar la siguiente definición según la cual las líneas cortas tienen una longitud de 0,25 cm. Por supuesto, esto se puede hacer de forma más elegante.
Para simplificar el código estoy usando la calc
biblioteca de 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}
A través de esta definición mdframed
se permiten todas las opciones.
\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}