MHB How do you use theorem environments in LaTeX?

  • Thread starter Thread starter karush
  • Start date Start date
AI Thread Summary
To use LaTeX for homework assignments, the provided code snippet should be included in the document's preamble after the relevant package imports, such as \usepackage{amsthm} or \usepackage{ntheorem}. This code defines various theorem-like environments, including theorems, lemmas, propositions, definitions, and examples. In the body of the document, these environments can be utilized to format mathematical statements clearly. For instance, a theorem can be written using the \begin{theorem} command, followed by the statement and an optional title. It's recommended to experiment with these environments to understand their appearance and functionality better, and to consult the documentation available locally or on ctan.org for further guidance.
karush
Gold Member
MHB
Messages
3,240
Reaction score
5
Im in a class now the teacher wants us do do all the homework in latex

But this was in the preamble
how do you use this?

%THEOREMS ETC
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem*{defn}{Definition}
\newtheorem{cor}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{example}{Example}
\newtheorem{examples}[theorem]{Examples}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{note}[theorem]{}
 
Physics news on Phys.org
You put this code in the preamble of the document, probably after [M]\usepackage{amsthm}[/M] or [M]usepackage{ntheorem}[/M]. In the body of the document you can say:
[latexs]
\begin{theorem}[Pythagoras; Homer Simpson's version]
The sum of the square roots of any two sides of an isosceles triangle is equal to the square root of the remaining side.
\end{theorem}
[/latexs]
and similarly for other defined environments: [M]definition[/M], [M]defn[/M] and so on. I suggest you try using these environments to see what they look like, or read the documentation for the packages mentioned above. The documentation can be found in the local installation or on ctan.org.
 

Similar threads

Replies
3
Views
3K
Replies
2
Views
7K
Replies
7
Views
3K
Replies
4
Views
3K
Replies
5
Views
612
Back
Top