#\DeclareLyXModule{Theorems (Order By Chapter)}
#DescriptionBegin
-#Numbers theorems and the like by chapter.
+#Numbers theorems and the like by chapter. Use this module only with
+#layouts that provide a chapter environment.
#DescriptionEnd
-#Requires: Theorems | Theorems (AMS)
+#Requires: theorems-std | theorems-ams
# Author: Richard Heck <rgheck@comcast.net>
-Format 6
+Format 7
Counter
Name theorem
Style Theorem
Preamble
- \newtheorem{thm}{Theorem}[chapter]
+ \ifx\thechapter\undefined
+ \newtheorem{thm}{Theorem}
+ \else
+ \newtheorem{thm}{Theorem}[chapter]
+ \fi
+
EndPreamble
End