The classical case
With the classical \newtheorem
command of amsthm
, one gets the following result for optional arguments:
from this code
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}[Riemann]
Let $X$... Nulla egestas congue ullamcorper. Suspendisse id dictum est. Quisque ut urna lorem. Sed non aliquet sem, quis sollicitudin ante.
\end{theorem}
\end{document}
The mdframed
case
I would like to get a similar result with mdframed
:the optional argument between brackets, but no change of font and no dot at the end. But by default, here is what I get:
from the code
\documentclass{article}
\usepackage{mdframed}
\mdfdefinestyle{myFramedTheoremStyle}{%
frametitlealignment=\raggedright,
linecolor=red,
linewidth=4pt,
innertopmargin=0pt,
innerbottommargin=10pt,
innerleftmargin=10pt,
innerrightmargin=10pt,
frametitleaboveskip=5pt,
skipbelow=0pt,
font=\itshape
}
\mdtheorem[style=myFramedTheoremStyle]{theorem}{Theorem}
\begin{document}
\begin{theorem}[Riemann]
Let $X$... Nulla egestas congue ullamcorper. Suspendisse id dictum est. Quisque ut urna lorem. Sed non aliquet sem, quis sollicitudin ante.
\end{theorem}
\end{document}
What I have found so far
In the documentation, I have found the following options (of the \mdfdefinestyle
command):
theoremseparator, theoremtitlefont and theoremspace
but there seems to be to attribute for defining what comes after the optional argument. I am looking for an option of the \mdfdefinestyle
command which could be called theoremtextafter
.
My question
I hope something like that exists. Do you know if it is the case? If not, is it possible to find an easy solution?
Thank you.
Best Answer
I don't know the official way of doing it, but here is a hack that does the job which:
theoremtitlefont=\normalfont
to get the correct font in the titlemdframed
theorem to beMDtheorem
, and\newenvironment
calledtheorem
which inserts the desired(
and)
to the theorem name before passing it on to theMDtheorem
.\newenvironment
calledtheorem*
to provide the same functionality without the numbering.Notes:
theorem*
themdframe
styletheoremtitlefont=\normalfont
, did not seem sufficient so had to add a manual\normalfont
.Code: