I'm looking for a way to style a theorem as shown here.
The code there works if I want the theorem number in the heading box, but I also want to be able to pass a custom theorem name to add to that heading box. The optional argument seems to be showing up as part of the #1, so how do I separate it so that I can put it elsewhere?
The code I'm currently using (from the same link given above)
\usepackage{graphicx,textpos, a4wide}
\usepackage{helvet, amssymb}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations}
\usepackage{framed}
\usepackage[framed, amsthm]{ntheorem}
\theoremclass{Theorem}
\theoremstyle{empty}
\newcommand{\thmbox}[1]{
\tikzstyle{thmbox} = [rectangle, rounded corners, draw=black, fill=gray!20, inner sep=15pt, drop shadow={fill=black, opacity=.5}]%
\tikzstyle{fancytitle} =[fill=white, text=black, rectangle, rounded corners, draw= black]%
\noindent%
\begin{tikzpicture}%
\node [thmbox] (box){%
\begin{minipage}{.91\textwidth}%
\textit{#1}%
\end{minipage}%
};%
\node[fancytitle, right=10pt] at (box.north west) {\textbf{Theorem \thetheorem}%
};%
\end{tikzpicture}}
\def\theoremframecommand{\thmbox}
\newshadedtheorem{theorem}{Theorem}
And in the body:
\begin{theorem}[abc]
Hello
\end{theorem}
columns=fullflexible
in the source code? As they are it's impossible to copy-paste the code (and it's unreadable).listings
. You are completely right.