]> git.lyx.org Git - lyx.git/blobdiff - lib/layouts/theorems-chap.module
Allow literate documents other than noweb to work out of the box. Currently
[lyx.git] / lib / layouts / theorems-chap.module
index 5a747ea6f61e2ac568a0bff827e14b209f556a73..a83b4b5894dca11b6a0fb9bbc695996b653bd9d8 100644 (file)
@@ -1,20 +1,31 @@
-#\DeclareLyXModule{Theorems (Order By Chapter)}
+#\DeclareLyXModule{Theorems (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-std | theorems-ams
+#Excludes: theorems-sec
 
 # Author: Richard Heck <rgheck@comcast.net>
 
-Format 6
+Format 14
 
-Counter
-       Name           theorem
+Counter theorem
        Within         chapter
 End
 
 Style Theorem
        Preamble
-               \newtheorem{thm}{Theorem}[chapter]
+               \ifx\thechapter\undefined
+                       \newtheorem{thm}{\protect\theoremname}
+               \else
+                       \newtheorem{thm}{\protect\theoremname}[chapter]
+               \fi
        EndPreamble
+       LangPreamble
+               \providecommand{\theoremname}{_(Theorem)}
+       EndLangPreamble
+       BabelPreamble
+               \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
+       EndBabelPreamble
 End