# Theorem style with name as argument

Is there some way to get a theorem type which will make a theorem with the name passed as a parameter? In other words, is there a way to define "named" such that

\begin{named}[NAME]
text
\end{named}


will print

"NAME: text"?

I tried using the definition \newtheorem*{named}{}, but that results in

"(NAME): text", which is quite different from what I am trying to do.

I know that I could also create a new instance of \newtheorem for each named theorem I want to use, but that is clunky and inconvenient. Is there a better way?

-

Here's one possible solution using thmtools as a front-end for amsthm:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
spaceabove=\topsep, spacebelow=\topsep,
notefont=\bfseries, notebraces={}{},
bodyfont=\normalfont\itshape,
name={\ignorespaces},
numbered=no,
{mystyle}
\declaretheorem[style=mystyle]{named}

\begin{document}

\begin{named}[NAME]
\lipsum[4]
\end{named}

\begin{named}[OTHERNAME]
\lipsum[4]
\end{named}

\end{document}


And without using thmtools, you can say something like:

\documentclass{article}
\usepackage{amsthm}
\usepackage{lipsum}

\makeatletter
\newtheoremstyle{mystyle}%
{\topsep}{\topsep}
{\itshape}{}
{\bfseries}{:}
{0.5em}
{\thmname{\@ifempty{#3}{#1}\@ifnotempty{#3}{\MakeUppercase{#3}}}}
\makeatother

\theoremstyle{mystyle}
\newtheorem*{named}{NAME}% here the second argument is the default name

\begin{document}

\begin{named}
\lipsum[4]
\end{named}

\begin{named}[Othername]
\lipsum[4]
\end{named}

\end{document}


With the second approach, you can set the default name for the structure in the second argument of \newtheorem*.

-
Thank you. This is precisely I was looking for. – yrudoy Aug 5 '12 at 17:37