-
Notifications
You must be signed in to change notification settings - Fork 0
/
mythm.sty
51 lines (45 loc) · 1.18 KB
/
mythm.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Theorem styles
%
% Defines theorem environments with a continuous counter
%
% written by Jan Leike 2014
%
\usepackage{amsthm}
% From https://wiki.bath.ac.uk/display/latextricks/One-counter+theorems+with+autoref
\usepackage{aliascnt}
\newtheorem{dummy}{***}
\newcommand{\mynewtheorem}[2]{
\newaliascnt{#1}{dummy}
\newtheorem{#1}[#1]{#2}
\aliascntresetthe{#1}
\expandafter\def\csname #1autorefname\endcsname{#2}
}
% For explicit theorem numbering
\newcounter{dummyBackup}
\newcommand{\thmcountershouldbe}[1]{
\setcounter{dummyBackup}{\thedummy}
\setcounter{dummy}{#1}
}
\newcommand{\thmcounterbacktonormal}{
\setcounter{dummy}{\thedummyBackup}
}
% Theorem styles
\theoremstyle{plain}
\mynewtheorem{theorem}{Theorem}
\mynewtheorem{lemma}{Lemma}
\mynewtheorem{corollary}{Corollary}
\theoremstyle{definition}
\mynewtheorem{definition}{Definition}
\mynewtheorem{remark}{Remark}
\mynewtheorem{example}{Example}
% Add boxes to examples and remarks
%\usepackage{etoolbox}
%\AtEndEnvironment{remark}{%
% \renewcommand{\qedsymbol}{$\Diamond$}%
% \qed
%}
%\AtEndEnvironment{example}{
% \renewcommand{\qedsymbol}{$\Diamond$}%
% \qedhere
%}