0

How can I have an amsmath Theorem environment where the name of the environment is passed as an argument?

e.g.

\begin{note}[Name of the Theorem]
    Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
    sed diam nonumy eirmod tempor invidunt ut labore et dolore
    magna aliquyam erat, sed diam voluptua.
\end{note}
\begin{note}[A different name]
    Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
    sed diam nonumy eirmod tempor invidunt ut labore et dolore
    magna aliquyam erat, sed diam voluptua.
\end{note}

resulting in this:enter image description here

Thanks in advance!

EDIT: Added a second example for clarity

1 Answers1

0

See the tutorial about the Pythagorean theorem on this page.

You can add a theorem title using brackets:

\begin{theorem}[Pythagorean theorem]

EDIT: here is an exemple, but I am not sure that is what you are looking for.

\documentclass{report}

\usepackage{amsmath} \newtheorem{theorem}{Theorem} \newtheorem{theoremApple}{Apple} \newtheorem{theoremBanana}{Banana}

\begin{document}

\begin{theorem}[Apple] The apple is red. \end{theorem} \begin{theorem}[Banana] The banana is yellow. \end{theorem}

\begin{theoremApple} The apple is red. \end{theoremApple} \begin{theoremBanana} The banana is yellow. \end{theoremBanana} \begin{theoremApple} Actually, the apple is green. \end{theoremApple}

\end{document}

resulting in

enter image description here

Karlo
  • 3,257