I would like to have a style for theorems identical to lstlisting with frame=lines but I could not find a option for
declaretheorem to do so. Going away from thmtools is not easy as I have already plenty of other theorems (in different styles).
\documentclass{article}
\usepackage[usenames,dvipsnames,table]{xcolor}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{listings}
\declaretheorem[style=definition,numbered=no,shaded={rulecolor=Black,rulewidth=0.5pt,margin=0.5em,bgcolor={rgb}{1,1,1}}]{theorem}
\lstset{frame=lines}
\begin{document}
\begin{lstlisting}
Test
\end{lstlisting}
\begin{theorem}
\end{theorem}
\end{document}
I would like to have the "Theorem." in the same box as "Test" and still use declaretheorem (as I need it for many different styles).
Thank you!


amsthmandntheorem. Note the latter has anamsthmoption, which predefines the same layout as amsthm. Also, one superiority ofntheoremis its automatic placement of the end-of-proof symbol (even when the proof in question ends up with a mulitline equation). – Bernard Jul 29 '17 at 10:16