-
Notifications
You must be signed in to change notification settings - Fork 1
/
spamsthm.sty
96 lines (78 loc) · 2.73 KB
/
spamsthm.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
%% Generic LNCS-style theorems also without LNCS.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{spamsthm}
\let\if@sp@envcntsect\iffalse
\let\if@sp@envcntsame\iffalse
\let\if@sp@envcntswap\iffalse
\DeclareOption{envcountsect}{\let\if@sp@envcntsect\iftrue}
\DeclareOption{envcountsame}{\let\if@sp@envcntsame\iftrue}
\DeclareOption{envcountswap}{\let\if@sp@envcntswap\iftrue}
\ProcessOptions
\ifx\spnewtheorem\undefined
%% NON-LLNCS SETUP.
\RequirePackage{amsthm}
\def\th@major{\thm@notefont{\bf}\itshape}
\def\th@normal{\thm@notefont{\bf}\normalfont}
\def\th@minor{\thm@headfont{\it}\thm@notefont{\it}\normalfont
\thm@preskip\topsep \divide\thm@preskip\tw@ \thm@postskip\thm@preskip}
\let\theorem=\undefined
\let\lemma=\undefined
\let\definition=\undefined
\let\example=\undefined
\let\proposition=\undefined
\let\note=\undefined
\theoremstyle{major}
\if@sp@envcntswap
\swapnumbers
\fi
\if@sp@envcntsect
\newtheorem{theorem}{Theorem}[section]
\else
\newtheorem{theorem}{Theorem}
\fi
\if@sp@envcntsame
\def\spamsnewtheorem#1#2{\newtheorem{#1}[theorem]{#2}}
\else\if@sp@envcntsect
\def\spamsnewtheorem#1#2{\newtheorem{#1}{#2}[section]}
\else
\def\spamsnewtheorem#1#2{\newtheorem{#1}{#2}}
\fi\fi
\spamsnewtheorem{lemma}{Lemma}
\spamsnewtheorem{corollary}{Corollary}
\spamsnewtheorem{conjecture}{Conjecture}
\theoremstyle{normal}
\spamsnewtheorem{definition}{Definition}
\spamsnewtheorem{example}{Example}
\spamsnewtheorem{scenario}{Scenario}
\spamsnewtheorem{proposition}{Proposition}
\spamsnewtheorem{property}{Property}
\spamsnewtheorem{notation}{Notation}
\spamsnewtheorem{exercise}{Exercise}
\spamsnewtheorem{problem}{Problem}
\spamsnewtheorem{question}{Question}
\spamsnewtheorem{solution}{Solution}
\theoremstyle{minor}
\spamsnewtheorem{remark}{Remark}
\spamsnewtheorem{note}{Note}
\spamsnewtheorem{case}{Case}
\theoremstyle{normal}
\newenvironment{one-off}[2][normal]{\theoremstyle{#1}\spamsnewtheorem{one-off@#2}{#2}\def\end@one@off{\csname endone-off@#2\endcsname}\csname one-off@#2\endcsname}{\end@one@off}
\else
%% LLNCS TWEAKS
%% Put number before theorems :)
\if@sp@envcntswap
\def\@spbegintheorem#1#2#3#4{\trivlist
\item[\hskip\labelsep{#3#2\ #1\@thmcounterend}]#4}
\def\@spopargbegintheorem#1#2#3#4#5{\trivlist
\item[\hskip\labelsep{#4#2\ #1}]{#4(#3)\@thmcounterend\ }#5}
\fi
\if@sp@envcntsame
\def\spamsnewtheorem#1#2{\spnewtheorem{#1}{#2}{\bfseries}{\rmfamily}}
\else\if@sp@envcntsect
\def\spamsnewtheorem#1#2{\spnewtheorem{#1}{#2}{\bfseries}{\rmfamily}}
\else
\def\spamsnewtheorem#1#2{\spnewtheorem{#1}{#2}{\bfseries}{\rmfamily}}
\fi\fi
\newenvironment{one-off}[2][normal]{\spnewtheorem{one-off@#2}[theorem]{#2}{\itshape}{\rmfamily}\def\end@one@off{\csname endone-off@#2\endcsname}\csname one-off@#2\endcsname}{\end@one@off}
\fi