I'm having trouble with either formatting newmdtheoremenv
environments, or adding mdtheorem
environments to a table of theorems, depending on how you look at it.
My MWE:
\documentclass{article}
\usepackage{amsthm,thmtools}
\usepackage{mdframed}
\usepackage{xcolor}
\usepackage{mdframed}
\mdfdefinestyle{guidelinestyle}{%
linecolor=black,
linewidth=1pt,
frametitlerule=true,
frametitlefont=\sffamily\bfseries,
frametitlebackgroundcolor=gray!20,
innertopmargin=\topskip,
}
% \newmdenv[style=guidelinestyle]{asEnv}{asEnv}[section]
\newmdtheoremenv[style=guidelinestyle]{asTheoremEnv}{asTheoremEnv}[section]
\mdtheorem[style=guidelinestyle]{asTheorem}{asTheorem}[section]
\begin{document}
\expandafter\csname ver@mdframed.sty\endcsname
%\listoftheorems[ignoreall,show=xxx] % this is how I actually display it in my document
\listoftheorems
\section{My section}
% \begin{asEnv}[As environment, it appears in ToTh]
% But it doesn't look like what I want.
% \end{asEnv}
\begin{asTheoremEnv}[As theoremEnv, it appears in ToTh]
But it doesn't look like what I want.
\end{asTheoremEnv}
\begin{asTheorem}[As theorem, it does not appear in ToTh]
But it looks a lot better!
\end{asTheorem}
\end{document}
This produces a document that looks like:
I have found this issue which describes the same problem, but as it dates back to April 2012 and my version of mdframed
is from 2013, I think it should not be applicable (and I cannot see in what version it should have been solved).
What I'd want instead, is the environment to look like the latter in the document, but appear in the table of theorems.
Is there somebody who can help me with getting this to work?
I don't really care about what exact packages are being used, if
- it appears in the list of theorems, and
- the theorems have a border and some kind of highlighted title bar
Best Answer
You can teach
thmtools
to use\mdtheorem
as its\newtheorem
command. A hint is in thethmtools
documentation about how it treats thethmbox
option.If you introduce a new
mdthm
key as:then you can write
passing the
mdframed
options as the argument tomdthm
. This produces the theorem style you request and entries in the list of theorems: