]> git.lyx.org Git - lyx.git/blob - lib/layouts/theorems-named.module
Add module for named theorems. Thanks to John Perry. Fixes bug #6279.
[lyx.git] / lib / layouts / theorems-named.module
1 #% Do not delete the line below; configure depends on this
2 #\DeclareLyXModule{Named Theorems}
3 #DescriptionBegin
4 # Facilitates the use of named theorems. The name of the theorem
5 # goes into the "Short Title" inset.
6 #DescriptionEnd
7 #Requires: theorems-ams | theorems-starred
8 #Original Author: John Perry
9
10 Style "Named Theorem"
11   CopyStyle Theorem*
12   Category Theorem
13   LabelString "Named Theorem."
14   LatexName namedthm
15   Preamble
16     \newcommand\thmsname{Theorem}
17     \newcommand\nm@thmtype{theorem}
18     \theoremstyle{plain}
19     \newtheorem*{namedtheorem}{\thmsname}
20     \newenvironment{namedthm}[1][Undefined Theorem Name]{
21       \ifx{#1}{Undefined Theorem Name}\renewcommand\nm@thmtype{theorem*}
22       \else\renewcommand\thmsname{#1}\renewcommand\nm@thmtype{namedtheorem}
23       \fi
24       \begin{\nm@thmtype}}
25       {\end{\nm@thmtype}}
26     \makeatother
27   EndPreamble
28 End
29