خطأ فادحوضع الرياضيات

البيئة proof غير معرّفة (غياب amsthm)

! LaTeX Error: Environment proof undefined.

ماذا يعني هذا الخطأ

توفر حزمة amsthm البيئات proof وtheorem وlemma وcorollary وdefinition. من دون تحميلها لا يملك LaTeX تعريفًا لهذه البيئات.

التجميع الذكي في FormaTeX

يكتشف التجميع الذكي في FormaTeX بيئات proof وtheorem وlemma وcorollary وdefinition ويضيف ⁦\usepackage{amsthm}⁩ تلقائيًا إلى المقدمة.

الأسباب الشائعة

  • غياب ⁦\usepackage{amsthm}⁩ من المقدمة (preamble)
  • استخدام ⁦\begin{proof}⁩ أو ⁦\begin{theorem}⁩ أو ⁦\begin{lemma}⁩ دون amsthm
  • توقع أن تُعرَّف بيئات المبرهنات تلقائيًا دون amsthm

كيفية الإصلاح

أضف ⁦\usepackage{amsthm}⁩ إلى المقدمة. تحتاج أيضًا إلى تصريح بيئات المبرهنات باستخدام ⁦\newtheorem⁩ قبل استخدامها. أما البيئة proof فتعرّفها amsthm مسبقًا.

أمثلة على الشيفرة

يسبب الخطأ
\documentclass{article}
% Missing \usepackage{amsthm}
\begin{document}

\begin{proof}
  This is the proof.
\end{proof}

\end{document}
تم الإصلاح
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}

\begin{theorem}
  Statement of the theorem.
\end{theorem}
\begin{proof}
  This is the proof.
\end{proof}

\end{document}

أخطاء ذات صلة

جرّب الحل مباشرة

الصق شيفرة LaTeX في الـ playground وجمّعها فورًا.