]> git.lyx.org Git - lyx.git/blob - lib/layouts/theorems-named.module
f84c7e94502860019ab4ac04e99612549ce231bd
[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 'Additional Theorem Text' argument.
6 #DescriptionEnd
7 #Original Author: John Perry
8
9 Format 68
10
11 ProvideStyle Theorem*
12         Category              Reasoning
13         LatexType             Environment
14         Margin                First_Dynamic
15         LatexName             thm*
16         LabelType             Static
17         LabelString           "Theorem."
18         NextNoIndent          1
19         ResetArgs             1
20         Argument 1
21                 LabelString    "Additional Theorem Text"
22                 Tooltip        "Additional text appended to the theorem header"
23         EndArgument
24         LabelSep              xx
25         ParIndent             MMM
26         ParSkip               0.4
27         ItemSep               0.2
28         TopSep                0.7
29         BottomSep             0.7
30         ParSep                0.3
31         Align                 Block
32         AlignPossible         Left
33         Font
34           Shape               Italic
35           Size                Normal
36         EndFont
37         LabelFont
38           Shape               Up
39           Series              Bold
40         EndFont
41         Preamble
42           \theoremstyle{plain}
43           \newtheorem*{thm*}{\protect\theoremname}
44         EndPreamble
45         LangPreamble
46           \providecommand{\theoremname}{_(Theorem)}
47         EndLangPreamble
48         BabelPreamble
49           \addto\captions$$lang{\renewcommand{\theoremname}{_(Theorem)}}
50         EndBabelPreamble
51         Requires              amsthm
52 End
53
54
55 Style "Named Theorem"
56   CopyStyle Theorem*
57   Category Reasoning
58   LabelString "Named Theorem."
59   LatexName namedthm
60   Preamble
61     \newcommand\thmsname{\protect\theoremname}
62     \newcommand\nm@thmtype{theorem}
63     \theoremstyle{plain}
64     \newtheorem*{namedtheorem}{\thmsname}
65     \newenvironment{namedthm}[1][Undefined Theorem Name]{
66       \ifx{#1}{Undefined Theorem Name}\renewcommand\nm@thmtype{theorem*}
67       \else\renewcommand\thmsname{#1}\renewcommand\nm@thmtype{namedtheorem}
68       \fi
69       \begin{\nm@thmtype}}
70       {\end{\nm@thmtype}}
71   EndPreamble
72 End
73