-
Notifications
You must be signed in to change notification settings - Fork 241
/
open-logic-envs.sty
174 lines (132 loc) · 4.86 KB
/
open-logic-envs.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
% % The Default OLP Theorems File `open-logic-envs.sty`
% % OpenLogic Project
%
% Description
% ===========
%
% This file contains all theorem and other environments that are meant to
% be configured, changed, or adapted by a user generating their own
% text based on OLP text. **Do not edit this file to customize your
% OLP-derived text!** A file `myversion.tex` adapted from
% `open-logic-complete.tex` (or from any of the contributed example
% master files) will include `myversion-thm.sty` if it exists, and
% otherwise will include this file. So if you'd like to make changes,
% instead **copy this file to `myversion-config.sty` and edit for
% customization**.
\NeedsTeXFormat{LaTeX2e}
% Theorem-like Environments
% -------------------------
% Theorem-like environments are provided for theorem (`thm`),
% definition (`defn`), lemma (`lem`), proposition (`prop`), corollary
% (`cor`), example (`ex`), problem (`prob`), remark (`rem`), and
% convention (`conv`). The definitions make use of the `thmtools`
% package. To change the numbering or style of these environments,
% adjust their definitions. Refer to the [`thmtools`
% documentation](http://www.ctan.org/pkg/thmtools).
\declaretheorem[
style=plain,
name=Theorem,
numberwithin=chapter]{thm}
\declaretheorem[
style=definition,
name=Example,
sibling=thm]{ex}
\declaretheorem[
style=plain,
name=Lemma,
refname={Lemma,Lemmata},
sibling=thm]{lem}
\declaretheorem[
style=plain,
name=Proposition,
sibling=thm]{prop}
\declaretheorem[
style=plain,
name=Corollary,
refname={Corollary,Corollaries},
sibling=thm]{cor}
\declaretheorem[
style=definition,
name=Definition,
sibling=thm]{defn}
\declaretheorem[
style=definition,
name=Problem,
numberwithin=chapter]{prob}
% A wrapper to allow problems with tags, use \begin{probtag}{tags}
\newenvironment{probtag}[1]{\begin{prob}}{\end{prob}}
\declaretheorem[
style=definition,
name=Axiom,
unnumbered]{axiom}
\declaretheorem[
style=remark,
name=Remark]{rem}
\declaretheorem[
style=remark,
name=Note]{note}
\declaretheorem[
style=remark,
name=Case]{case}
\declaretheorem[
style=remark,
name=Convention]{conv}
% These are the names of the environments that `\cref` adds
% automatically. `thmtools` should do that as well, but sometimes it
% doesn't work, so we set them explicitly. Redefine, e.g., if you
% want references to "Prop. 5.4"
\crefname{thm}{Theorem}{Theorems}
\crefname{ex}{Example}{Examples}
\crefname{defn}{Definition}{Definitions}
\crefname{lem}{Lemma}{Lemmata}
\crefname{prop}{Proposition}{Propositions}
\crefname{prob}{Problem}{Problems}
\crefname{rem}{Remark}{Remarks}
\crefname{figure}{Figure}{Figures}
\crefname{table}{Table}{Tables}
% Other Enviroments
% -----------------
% OLP texts make use of a number of environments to encapsulate types
% of discursive text. By default, these environments simply print
% their content without any special treatment. If you want to typeset
% any of them differntly, you can change the definition of the
% environment here. E.g., you might want digressions in asmaller font
% and indented. Refer to the \LaTeX\ documentation for how to
% accomplish this.
% OLP will provide two custom mechanisms for treating environments:
% supressing and deferring. Environments can be supressed by
% redefining them as the `comment` environment. For instance, to not
% print any digressions at all, add the lines
% ```
% \let\digress\comment
% \let\enddigress\endcomment
% ```
% after the definition of `digress`.
% - `explain`: Any explanatory material that's useful especially
% on first reading but might be left out if the material is
% presented only for review or completeness
\newenvironment{explain}{}{}
% - `informal`: Any informal explanation that's useful for
% novice readers but could be left out
\newenvironment{informal}{}{}
% - `intro`: for comments and comparisions to other introductory
% texts, e.g., regarding terminology, conventions, or proof methods.
\newenvironment{intro}{}{}
% - `pedantic`: for pedantic comments which users may want to exclude.
\newenvironment{pedantic}{}{}
% - `digress`: for digressions
\newenvironment{digress}{}{}
% - `history`: for historical notes and remarks
\newenvironment{history}{\paragraph{Historical Remarks}\par}{}
% - `reading`: for further reading
\newenvironment{reading}{\paragraph{Further Reading}\par}{}
% - `editorial`: for editorial remarks, warnings about missing parts, etc.
\newenvironment{editorial}{\begin{framed}}{\end{framed}}
\excludeenv{editorial} % exclude editorial remarks by default
% - `defish`: for definition-like material, e.g., rules
\newenvironment{defish}{\begin{oframed}\noindent}{\end{oframed}}
% - `derivation`: for derivations, a tabular environment with three
% colums for line number, formula, and justification.
\newenvironment{derivation}{%
~\begin{trivlist}\item\begin{tabular}[b]{@{}rll@{}}}
{\end{tabular} \end{trivlist}}