ทฤษฎีบทและบทพิสูจน์ใน LaTeX ด้วย amsthm
ประกาศแต่ละประเภทในพรีแอมเบิลด้วย \newtheorem{theorem}{Theorem} แล้วเขียน \begin{theorem} ... \end{theorem} ในส่วนเนื้อหา สภาพแวดล้อม proof จาก amsthm พิมพ์ "Proof." และจบด้วยสี่เหลี่ยมเล็ก ๆ
การประกาศและใช้ทฤษฎีบท
\newtheorem{name}{Heading} ในพรีแอมเบิลสร้างสภาพแวดล้อมชื่อ name ซึ่งหัวจะพิมพ์เป็น "Heading" พร้อมเลข ให้โหลด amsthm ด้วย แพ็กเกจนี้ให้สภาพแวดล้อม proof และการประกาศแบบมีดอกจัน
ทฤษฎีบทที่ประกาศแล้วพร้อมบทพิสูจน์
\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}เนื้อความของทฤษฎีบทแสดงเป็นตัวเอียง บทพิสูจน์จบด้วยสี่เหลี่ยมที่ขอบขวา
ชื่อ ป้ายกำกับ และการอ้างอิง
อาร์กิวเมนต์ที่เป็นตัวเลือกหลัง \begin{theorem} ใช้ตั้งชื่อให้ทฤษฎีบท ซึ่งจะพิมพ์ในวงเล็บ ใส่ \label ภายในสภาพแวดล้อมเพื่ออ้างอิงถึงด้วย \ref
ทฤษฎีบทที่มีชื่อ บทตั้ง และการอ้างอิง
\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}ข้อความหลายประเภท
ประกาศได้มากเท่าที่ต้องการ: ทฤษฎีบท บทตั้ง ประพจน์ บทแทรก บทนิยาม ข้อสังเกต ตัวอย่าง ใน Scissor LaTeX แต่ละประเภทมีตัวนับของตัวเอง
บทนิยาม ประพจน์ และข้อสังเกต
\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}ทฤษฎีบทแบบไม่มีเลข
\newtheorem* (จาก amsthm) ประกาศประเภทที่ไม่มีเลข
ข้อความแบบไม่มีเลขด้วย \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}การใส่เลขและสไตล์
ในการติดตั้ง TeX \newtheorem มีอาร์กิวเมนต์ที่เป็นตัวเลือกสองตัวสำหรับการใส่เลข และ amsthm มี \theoremstyle นี่คือสิ่งที่ Scissor LaTeX ทำกับสิ่งเหล่านี้:
| คุณเขียน | การติดตั้ง TeX | Scissor LaTeX |
|---|---|---|
\newtheorem{theorem}{Theorem} | Theorem 1, 2, 3 | ใช้ได้ |
\newtheorem{theorem}{Theorem}[section] | Theorem 1.1, 1.2, 2.1 | Theorem 1, 2, 3: ส่วนของหัวข้อถูกละเว้น |
\newtheorem{lemma}[theorem]{Lemma} | บทตั้งใช้ตัวนับร่วมกับทฤษฎีบท | บทตั้งมีตัวนับของตัวเอง |
\newtheorem*{remark}{Remark} | ไม่มีเลข | ใช้ได้ |
\theoremstyle{definition}, {remark} | เนื้อความตัวตรง | ละเว้น: เนื้อความทุกแบบเป็นตัวเอียง |
\begin{proof} | "Proof." และสี่เหลี่ยม | ใช้ได้ |
\begin{proof}[Proof of Theorem 1] | หัวที่คุณกำหนดเอง | "Proof.": หัวของคุณถูกละเว้น |
\qedhere | สี่เหลี่ยมบนบรรทัดสุดท้ายของสูตรแสดงผล | ไม่รองรับ: สูตรนั้นเป็นสีแดง |
[section] และตัวนับร่วม: แต่ละประเภทนับแยกกัน
\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}ในการติดตั้ง TeX ตัวอย่างนี้พิมพ์ Lemma 1.1, Theorem 1.2 และ Lemma 1.3 ส่วน Scissor LaTeX พิมพ์ Lemma 1, Theorem 1 และ Lemma 2
ไม่ใช้ \newtheorem
เอกสารจำนวนมากที่คัดลอกมาจากที่อื่นใช้ theorem, lemma หรือ definition โดยไม่ได้ประกาศไว้ Scissor LaTeX รู้จักชื่อที่ใช้บ่อยอยู่แล้ว ได้แก่ theorem, lemma, proposition, corollary, definition, remark, example, conjecture, claim, exercise, problem, solution และชื่อย่ออย่าง thm, lem และ defn
สิ่งที่ต่างจากการติดตั้ง TeX
ข้อมูลเพิ่มเติมเกี่ยวกับแพ็กเกจอยู่ในหน้า amsthm คู่มือฉบับเต็มของแพ็กเกจอยู่ที่ ctan.org/pkg/amsthm
ดูเพิ่มเติมที่ amsthm การอ้างอิงไขว้ และ cleveref
คำถามและคำตอบ
ฉันจะนิยามสภาพแวดล้อมทฤษฎีบทใน LaTeX ได้อย่างไร
เขียน \newtheorem{theorem}{Theorem} ในพรีแอมเบิล พร้อมกับ \usepackage{amsthm} แล้วใช้ \begin{theorem} ... \end{theorem}
ฉันจะได้สี่เหลี่ยม QED ท้ายบทพิสูจน์ได้อย่างไร
ใช้สภาพแวดล้อม proof จาก amsthm สี่เหลี่ยมจะถูกเพิ่มที่ท้ายโดยอัตโนมัติ
ฉันจะใส่เลขบทตั้งและทฤษฎีบทร่วมกันได้อย่างไร
ในการติดตั้ง TeX ให้เขียน \newtheorem{lemma}[theorem]{Lemma} Scissor LaTeX ยังไม่รองรับตัวนับร่วม ที่นี่บทตั้งและทฤษฎีบทจึงมีเลขแยกกัน
ทุกตัวอย่างในหน้านี้จัดหน้าโดย Scissor LaTeX ขณะสร้างเว็บไซต์ อัปเดตล่าสุด 2026-11-07