[Tex/LaTex] How to create an unnumbered theorem

environmentsnumberingtheorems

I'm looking for a way to create a new theorem without numbering. I found Theorem without numbering and tried the accepted answer, but I get the error "Command * already defined".

This is the code I'm using:

\documentclass[11pt]{article}

\usepackage{mdframed}

\newtheorem*{hulprule}{Rule settings}
\newenvironment{drule}[3]
    {\begin{mdframed}[backgroundcolor=lightgray]\begin{hulprule}\begin{enumerate}[-]
                    \item \textbf{Events}:{#1}
                    \item \textbf{Conditions}:{#2}
                    \item \textbf{Actions}:{#3}}
    {\end{enumerate}\end{hulprule}\end{mdframed}}

\begin{document}

\begin{drule}
        {test}
        {test}
        {test}
    \end{drule}

\end{document}

Strangely enough, the drule environment works perfectly without the *.

How can I solve this?

Best Answer

You're missing \usepackage{amsthm}. I'd improve the definition, though, with enumitem instead of enumerate:

\documentclass[11pt]{article}
\usepackage{amsthm,enumitem,xcolor}
\usepackage{mdframed}

\definecolor{lightgray}{gray}{0.9}

\newtheorem*{hulprule}{Rule settings}
\newenvironment{drule}[3]
 {\begin{mdframed}[backgroundcolor=lightgray]%
  \begin{hulprule}\leavevmode
  \begin{itemize}[label=\textbf{--},itemindent=-1em]
    \item \textbf{Events}: #1
    \item \textbf{Conditions}: #2
    \item \textbf{Actions}: #3}
 {\end{itemize}%
  \end{hulprule}%
  \end{mdframed}}

\begin{document}

\begin{drule}
  {test}
  {test}
  {test}
  \item something else
  \item another
\end{drule}

\end{document}

A simple hyphen should never be used for marking an item; over a grey background a dash becomes barely noticeable, so it's better to boldface it. Adjust the itemindent to suit.

enter image description here