דילוג לתוכן

משפטים והוכחות ב-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}
סודר על ידי Scissor LaTeX: משפט מוגדר עם ההוכחה שלו

גוף המשפט מסודר בנטוי. ההוכחה מסתיימת בריבוע בשוליים הימניים.

שמות, תוויות והפניות

ארגומנט אופציונלי אחרי \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: משפט עם שם, למה והפניה

כמה סוגים של טענות

מגדירים כמה סוגים שצריך: משפט, למה, טענה, מסקנה, הגדרה, הערה, דוגמה. ב-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}
סודר על ידי Scissor LaTeX: הגדרה, טענה והערה

משפטים בלי מספור

\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}
סודר על ידי Scissor LaTeX: טענה בלי מספור עם \newtheorem*

מספור וסגנונות

בהתקנת TeX יש ל-\newtheorem שני ארגומנטים אופציונליים למספור, ול-amsthm יש את \theoremstyle. זה מה ש-Scissor LaTeX עושה איתם:

כותביםהתקנת TeXScissor LaTeX
\newtheorem{theorem}{Theorem}Theorem 1, 2, 3עובד
\newtheorem{theorem}{Theorem}[section]Theorem 1.1, 1.2, 2.1Theorem 1, 2, 3: חלק הסעיף לא נלקח בחשבון
\newtheorem{lemma}[theorem]{Lemma}ה-Lemma חולקת את המונה של המשפטל-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}
סודר על ידי Scissor LaTeX: [section] ומונה משותף: כל סוג סופר בעצמו

בהתקנת 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.