[Tex/LaTex] LaTeX Error: Environment example undefined

ieee-styleieeeconfieeetran

I need to use the keyword example in IEEEtran template but I get this error:

Error: LaTeX Error: Environment example undefined.
Error: LaTeX Error: \begin{document} ended by \end{example}.

Here is my test script:

\documentclass[conference]{IEEEtran}

\begin{document}

\begin{example} Here is my example \end{example}

\end{document}

Can you clarify how can I solve this issue?

Best Answer

You have to define your theorem-like environments with \newtheorem.

\documentclass[conference]{IEEEtran}
\newtheorem{example}{Example}
\begin{document}
\begin{example} Here is my example \end{example}
\end{document}

enter image description here