# Is there any way to remove the “Theorem” in theorem block titles?

I'm writing a beamer presentation and using the theorem environment in the standard manner:

\begin{theorem}[Subject]
this is text
\end{theorem}


Which creates the textbox with the proper look but my problem is with the title, right now it is Theorem (Subject) while I would like it to be only Subject.

I'm thinking there should be a way to change the title while still using theorem.

-
And what about block environment in beamer? It would typeset what you want. –  m0nhawk Dec 28 '12 at 20:17
Honestly it's just that I've already written a lot of theorem in the slides and I don't have any experience with block. –  George Bora Dec 28 '12 at 20:46

Yes you can achieve that with amsthm, cf. the following minimal working example.

\documentclass{beamer}
\usepackage{etoolbox}

\newcommand\mybeamerthm[2]{%
\newtheorem*{#1}{#2}%
\AtBeginEnvironment{#1}{%
\setbeamercolor{block body}{fg=yellow,bg=blue!40}%
}%
}

\begin{document}
\begin{frame}
\frametitle{test}

\mybeamerthm{subj}{Subject}
\begin{subj}
theorem on subject
\end{subj}

\mybeamerthm{foo}{bar}
\begin{foo}
theorem on bar
\end{foo}
\end{frame}
\end{document}

-
beamer preloads amsthm, so there should be no reason to load it explicitly. –  Werner Dec 28 '12 at 20:20
Depends on whether or not you set the noamsthm option to the documentclass, but since i didn't set it you are of course right. I changed the answer –  Max Dec 28 '12 at 20:27
I would also be tempted to define subj in the document preamble, rather than in the frame. It's just good practice to separate content from structure. Add in the reference to beamer loading amsthm, and I'll delete my comments. –  Werner Dec 28 '12 at 20:30
This is what I'm looking for but I forgot to add in the theorem block I switched some colors like the answer in this question tex.stackexchange.com/questions/87216/… . Which environment would I need to replace theorem with in this case? –  George Bora Dec 28 '12 at 20:57
With the updated solution you could even create a command/environment that takes the name of the theorem and creates the correct environment on the fly and squeezes the content in between. If you like it nasty you could even redefine theorem to that so you don't have to edit your document. That would be rather on the dark side though and i strongly advise against it. –  Max Dec 28 '12 at 21:21
show 2 more comments