¿Cómo trasladar esta solución de nteorema a amsthm + thmtools?

¿Cómo trasladar esta solución de nteorema a amsthm + thmtools?

¿Es posible reproducir esto?ambiente agradable teoremausando amsthmy thmtools?

Respuesta1

También puedes utilizar el paquete mdframedpara 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 calcbiblioteca 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 mdframedse permiten todas las opciones.

ingrese la descripción de la imagen aquí

\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}

información relacionada