1 #\DeclareLyXModule{Standard Theorems (Numbered by Type)}
2 #\DeclareCategory{Maths}
4 #Defines some theorem environments for use with non-AMS classes. Contrary to the
5 #plain Theorem module, the different theorem types provided here each have a separate
6 #counter (e.g., theorem 1, theorem 2, lemma 1, proposition 1, theorem 3, lemma 2, ...,
7 #as opposed to theorem 1, theorem 2, lemma 3, proposition 4, ...).
8 #The numbering's scope is the whole document. For chapter- and section-wide numbering,
9 #use one of the 'within Sections'/'within Chapters' modules, respectively.
11 #Excludes: theorems-std | theorems-ams | theorems-ams-bytype
13 # Author: Paul Rubin <rubin@msu.edu> (hacked from Richard Kimberly Heck's theorems-std.module)
14 # Edited sep '22 by Udi Fogiel <udifoglle@gmail.com>
18 Input theorems-counters-bytype.inc
20 Input theorems-labels.inc
21 Input theorems-proof-std.inc
25 \def\lyx@reverse@two#1#2{#2#1}
27 \def\lyx@definition{definition}
28 \def\lyx@remark{remark}
29 \newcommand\theoremstyle[1]{%
31 \ifx\lyx@style\lyx@plain
32 \def\lyx@headfont{\bfseries}%
33 \def\lyx@bodyfont{\itshape}%
35 \ifx\lyx@style\lyx@definition
36 \def\lyx@headfont{\bfseries}%
37 \def\lyx@bodyfont{\upshape}%
39 \ifx\lyx@style\lyx@remark
40 \def\lyx@headfont{\itshape}%
41 \def\lyx@bodyfont{\upshape}%
47 \@begintheorem{\normalfont\csname lyx@\@firstoftwo#2@headfont\endcsname \@secondoftwo#2}{\begingroup\upshape\csname the#1\endcsname\endgroup.}\normalfont\csname lyx@\@firstoftwo#2@bodyfont\endcsname\ignorespaces
50 \@opargbegintheorem{\normalfont{\csname lyx@\@firstoftwo#2@headfont\endcsname \@secondoftwo#2}}{\begingroup\csname lyx@\@firstoftwo#2@headfont\endcsname\upshape\csname the#1\endcsname\endgroup}{#3\lyx@reverse@two{\begingroup\normalfont\csname lyx@\@firstoftwo#2@headfont\endcsname.\endgroup}}\normalfont\csname lyx@\@firstoftwo#2@bodyfont\endcsname\ignorespaces
52 \def\lyx@othm#1[#2]#3{\@othm{#1}[#2]{{#1}{#3}}}
53 \def\lyx@nthm#1#2{\@ifnextchar[{\@xnthm{#1}{{#1}{#2}}}{\@ynthm{#1}{{#1}{#2}}}}
54 \renewcommand\newtheorem[1]{%
55 \expandafter\let\csname lyx@#1@headfont\expandafter\endcsname\lyx@headfont
56 \expandafter\let\csname lyx@#1@bodyfont\expandafter\endcsname\lyx@bodyfont
57 \@ifnextchar[{\lyx@othm{#1}}{\lyx@nthm{#1}}}
58 \newcommand\lyx@starred@newtheorem[2]{\newtheorem{#1}{#2}\expandafter\def\csname the#1\endcsname{\unskip}}
59 \newcommand\lyx@reg@newtheorem[2]{\newtheorem{#1}{#2}}
60 \newcommand\lyx@newtheorem{\@ifstar{\lyx@starred@newtheorem}{\lyx@reg@newtheorem}}
62 \newtheorem{thm}{\protect\theoremname}