Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to design a a theorem style using the code below. However, I would like to be able to write the name of the Theorem right after the phrase. I mean I'd like to have


Theorem 1 (First Theorem)

bla bla bla

on the bar on top of the frame. Do you have any ideas how to do it? Thanks!

\documentclass{article}

\usepackage{lipsum}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shadows}

\mdtheorem[roundcorner=5pt,backgroundcolor=gray!10,
 shadow=true,frametitlerule=true,
 middlelinewidth=1pt,frametitlerulewidth=1pt,
innertopmargin=\topskip,
apptotikzsetting={\tikzset{mdfbackground/.append style={left color=gray!10!white,right color=white},
mdfframetitlebackground/.append style ={left color=white,right color=gray!10!white}}}]{Theorem}{Theorem}

\begin{document}    

\begin{Theorem}
If $a^m=a^n$ then $m=n$ or $a=1$ or $a=-1$ and $m$, $n$ are even integers.
\end{Theorem}
\end{document}
share|improve this question
    
Welcome to TeX.SX! Do you want to get rid of the double colon? If not, my answer shows how it could be done. –  LaRiFaRi Jul 17 at 10:26

1 Answer 1

up vote 5 down vote accepted
% arara: pdflatex

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shadows}

\mdtheorem[roundcorner=5pt,backgroundcolor=gray!10,
 shadow=true,frametitlerule=true,
 middlelinewidth=1pt,frametitlerulewidth=1pt,
innertopmargin=\topskip,
apptotikzsetting={\tikzset{mdfbackground/.append style={left color=gray!10!white,right color=white},
mdfframetitlebackground/.append style ={left color=white,right color=gray!10!white}}}]{Theorem}{Theorem}

\begin{document}    

\begin{Theorem}[(First Theorem)]
If $a^m=a^n$ then $m=n$ or $a=1$ or $a=-1$ and $m$, $n$ are even integers.
\end{Theorem}
\end{document}

enter image description here

share|improve this answer
    
Thanks a lot LaRiFaRi! –  LatexQuest Jul 17 at 11:55
    
You are very welcome. If it helps you, you should upvote this answer (or future answers) and accept it as such. This is how we say thank you here and we get this topic closed. –  LaRiFaRi Jul 17 at 11:56
1  
Sure! Sorry, I'm quite new here. How do I do that? Thanks. –  LatexQuest Jul 17 at 12:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.