-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeoremtypes.sty
32 lines (27 loc) · 951 Bytes
/
theoremtypes.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
\ProvidesPackage{theoremtypes}
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage{xparse}
\RequirePackage{hyperref}
\newcommand{\NewTheoremType}[2]{%
\newtheorem*{#1*}{#2}%
\newtheorem{#1**}[theoremCounter]{#2}%
\NewDocumentEnvironment{#1}{o}%
{\IfValueTF{##1}
{\begin{#1**}[##1]}% if argument is present
{\begin{#1**}}% else
\label{\thetheoremCounter}}%
{\end{#1**}}%
}
\newtheorem{theoremCounter}%
{This is just a counter, which should not appear in the document}%
% change this to "chapter", "section", or similar depending on the desired enumeration
[section]
%Syntax: \NewTheoremType{Environment Name}{Header of Environment}
\NewTheoremType{corollary}{Corollary}
\NewTheoremType{lemma}{Lemma}
\NewTheoremType{proposition}{Proposition}
\NewTheoremType{remark}{Remark}
\NewTheoremType{theorem}{Theorem}
\theoremstyle{definition}
\NewTheoremType{definition}{Definition}