Scissor LaTeX 中的 amsthm
amsthm 套件在 Scissor LaTeX 中部分可用:\newtheorem、加星號的 \newtheorem*、像 [Mustermann] 這樣的選用附註,以及 proof 環境都能用;\theoremstyle、共用或依章節編號的計數器、證明標題和 \qedhere 則不會套用。
套件的用途
amsthm 讓你用 \newtheorem 宣告類似定理的環境,並提供一個以小方塊結尾的 proof 環境。定理樣式(plain、definition、remark)會改變標題和內文的外觀。
在這裡可用的功能
| 指令 | 在 Scissor LaTeX 中 | 備註 |
|---|---|---|
\newtheorem{name}{Title} | 可用 | 每個名稱都有自己的計數器:1、2、3。 |
\newtheorem{name}[other]{Title} | 部分支援 | 共用計數器會被忽略;這個環境會自己計數。 |
\newtheorem{name}{Title}[section] | 部分支援 | 編號不會在每個章節重設,也不會顯示成 2.1。 |
\newtheorem*{name}{Title} | 可用 | 沒有編號。 |
\begin{theorem}[note] | 可用 | 附註會以括號顯示在編號後面。 |
\theoremstyle{...} | 忽略 | 每個環境都是粗體標題和斜體內文。 |
proof | 部分支援 | 標題一律是「Proof.」;[Proof of Lemma 2] 之類的選用標題會被忽略。以方塊結尾。 |
\qedhere | 不支援 | 包含它的公式會以紅色顯示。 |
\qed, \qedsymbol | 不支援 | 會被略過並在「問題」分頁中註記;證明的方塊只來自 proof 環境。 |
範例
在導言區宣告環境,然後在內文中使用:
\newtheorem、附註和證明
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\begin{document}
\begin{lemma}
Every even number greater than 2 is the sum of two odd numbers.
\end{lemma}
\begin{theorem}[Mustermann]
The number 44 is the sum of two primes.
\end{theorem}
\begin{proof}
Take $44 = 3 + 41$, and both 3 and 41 are prime.
\end{proof}
\end{document}用 \newtheorem* 建立不編號的環境。\theoremstyle{definition} 這一行會被接受,但內文仍然是斜體:
\newtheorem* 和 \theoremstyle
\documentclass{article}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem*{remark}{Remark}
\begin{document}
\begin{definition}
A number is \emph{even} if it is divisible by 2.
\end{definition}
\begin{remark}
By this definition, 0 and 44 are even.
\end{remark}
\end{document}\qedhere 會把方塊移到證明結尾的顯示公式中。這裡不認得它,所以公式會變成紅色:
\qedhere 會顯示紅色公式
\begin{proof}
It remains to compute
\[ 44 = 4 \cdot 11. \qedhere \]
\end{proof}以紅色顯示: 無法讀取公式,因此改為顯示其原始碼。
把 \qedhere 拿掉。方塊就會單獨放在公式後的一行,這樣也是正確的:
不用 \qedhere 的同一個證明
\begin{proof}
It remains to compute
\[ 44 = 4 \cdot 11. \]
\end{proof}相容性
- 從 TeX 安裝環境搬到這裡:文件可以排版。環境共用計數器時編號可能不同,而且每種定理樣式看起來都像
plain。公式變成紅色的地方,請移除\qedhere。 - 從這裡搬到 TeX 安裝環境:只要每個環境都用
\newtheorem宣告過,文件在那裡不需修改就能編譯。
完整手冊在 CTAN 上:ctan.org/pkg/amsthm。如需引導式介紹,請見定理與證明。
常見問題
為什麼我的引理和定理沒有共用同一個計數器?
Scissor LaTeX 給每個環境各自的計數器,並忽略 [theorem] 參數。你的文件仍然可以編譯,只是編號和 TeX 安裝環境中不同。
可以更改證明的標題嗎?
目前還不行。proof 的選用參數會被忽略,標題一律是「Proof.」。你可以改把標題寫成證明的開頭文字。
本頁的每個範例都在建置網站時由 Scissor LaTeX 排版。 最後更新:2026-11-07