Lumaktaw sa nilalaman

Theorems at proofs sa LaTeX gamit ang amsthm

I-declare ang bawat uri sa preamble gamit ang \newtheorem{theorem}{Theorem}, pagkatapos ay isulat ang \begin{theorem} ... \end{theorem} sa body. Nagpi-print ang proof environment mula sa amsthm ng "Proof." at nagtatapos ito sa maliit na parisukat.

Pag-declare at paggamit ng theorem

Gumagawa ang \newtheorem{name}{Heading} sa preamble ng environment na tinatawag na name na ang heading ay ipinapi-print bilang "Heading" na may numero. I-load din ang amsthm; nagbibigay ito ng proof environment at ng starred declarations.

Isang na-declare na theorem kasama ang proof nito

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
The sum of two even numbers is even.
\end{theorem}
\begin{proof}
Let $a = 2k$ and $b = 2m$. Then $a + b = 2(k + m)$,
which is even.
\end{proof}
\end{document}
Na-typeset ng Scissor LaTeX: Isang na-declare na theorem kasama ang proof nito

Itinatakdang italic ang body ng isang theorem. Nagtatapos ang proof sa parisukat sa kanang margin.

Mga pangalan, labels at references

Binibigyan ng pangalan ang theorem ng opsyonal na argument pagkatapos ng \begin{theorem}, na ipinapi-print sa loob ng parentheses. Ilagay ang \label sa loob ng environment para tukuyin ito gamit ang \ref.

Isang theorem na may pangalan, isang lemma at isang reference

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\begin{document}
\begin{lemma}\label{lem:square}
If $n$ is odd, then $n^2$ is odd.
\end{lemma}
\begin{theorem}[Erika Mustermann, 2026]\label{thm:main}
There are infinitely many odd squares.
\end{theorem}
\begin{proof}
Use Lemma~\ref{lem:square} for every odd $n$.
\end{proof}
Theorem~\ref{thm:main} is easy to remember.
\end{document}
Na-typeset ng Scissor LaTeX: Isang theorem na may pangalan, isang lemma at isang reference

Iba't ibang uri ng pahayag

I-declare ang kasing-dami ng uri na kailangan mo: theorem, lemma, proposition, corollary, definition, remark, example. May sariling counter ang bawat uri sa Scissor LaTeX.

Definition, proposition at remark

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{definition}{Definition}
\newtheorem{proposition}{Proposition}
\newtheorem{remark}{Remark}
\begin{document}
\begin{definition}[Even number]
An integer $n$ is \emph{even} if $n = 2k$ for an integer $k$.
\end{definition}
\begin{proposition}
The number 44 is even.
\end{proposition}
\begin{remark}
Zero is even as well.
\end{remark}
\end{document}
Na-typeset ng Scissor LaTeX: Definition, proposition at remark

Theorems na walang numero

Nagde-declare ang \newtheorem* (mula sa amsthm) ng uri na walang numero.

Isang pahayag na walang numero gamit ang \newtheorem*

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem*{conjecture}{Conjecture}
\begin{document}
\begin{conjecture}
Every even number greater than 2 is the sum of two primes.
\end{conjecture}
\end{document}
Na-typeset ng Scissor LaTeX: Isang pahayag na walang numero gamit ang \newtheorem*

Numbering at styles

Sa isang TeX installation, may dalawang opsyonal na argument ang \newtheorem para sa numbering, at may \theoremstyle ang amsthm. Ito ang ginagawa ng Scissor LaTeX sa mga ito:

Isinusulat moTeX installationScissor LaTeX
\newtheorem{theorem}{Theorem}Theorem 1, 2, 3Gumagana
\newtheorem{theorem}{Theorem}[section]Theorem 1.1, 1.2, 2.1Theorem 1, 2, 3: hindi pinapansin ang bahagi ng section
\newtheorem{lemma}[theorem]{Lemma}kahati ng Lemma ang counter ng theoremmay sariling counter ang Lemma
\newtheorem*{remark}{Remark}walang numeroGumagana
\theoremstyle{definition}, {remark}tuwid na bodyHindi pinapansin: italic ang bawat body
\begin{proof}"Proof." at parisukatGumagana
\begin{proof}[Proof of Theorem 1]sarili mong heading"Proof.": hindi pinapansin ang heading mo
\qedhereparisukat sa huling linya ng displayHindi suportado: pula ang formula na iyon

[section] at shared counter: bawat uri ay may sariling bilang

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\begin{document}
\section{Results}
\begin{lemma} A first lemma. \end{lemma}
\begin{theorem} A first theorem. \end{theorem}
\begin{lemma} A second lemma. \end{lemma}
\end{document}
Na-typeset ng Scissor LaTeX: [section] at shared counter: bawat uri ay may sariling bilang

Sa isang TeX installation, Lemma 1.1, Theorem 1.2 at Lemma 1.3 ang ipinapi-print ng halimbawang ito. Lemma 1, Theorem 1 at Lemma 2 ang ipinapi-print ng Scissor LaTeX.

Nang walang \newtheorem

Maraming dokumentong kinopya mula sa ibang lugar ang gumagamit ng theorem, lemma o definition nang hindi dine-declare ang mga ito. Kinikilala pa rin ng Scissor LaTeX ang mga karaniwang pangalan, kabilang ang theorem, lemma, proposition, corollary, definition, remark, example, conjecture, claim, exercise, problem, solution at maiikling anyo gaya ng thm, lem at defn.

Ano ang naiiba sa isang TeX installation

Higit pa tungkol sa package sa amsthm page. Nasa ctan.org/pkg/amsthm ang buong manual ng package.

Tingnan din ang amsthm, Cross-references at cleveref.

Mga tanong at sagot

Paano ako magde-define ng theorem environment sa LaTeX?

Isulat ang \newtheorem{theorem}{Theorem} sa preamble, kasama ang \usepackage{amsthm}. Pagkatapos ay gamitin ang \begin{theorem} ... \end{theorem}.

Paano ko makukuha ang QED na parisukat sa dulo ng proof?

Gamitin ang proof environment mula sa amsthm. Kusang idinadagdag ang parisukat sa dulo.

Paano ko lalagyan ng magkasunod na numero ang lemmas at theorems?

Sa isang TeX installation, isulat ang \newtheorem{lemma}[theorem]{Lemma}. Hindi pa naghahati ng counters ang Scissor LaTeX, kaya magkahiwalay ang numbering ng lemmas at theorems dito.

Bawat halimbawa sa page na ito ay tina-typeset ng Scissor LaTeX kapag binubuo ang site. Huling na-update noong 2026-11-07.