Debian Codegraph @

texmf-dist/doc/latex/rbt-mathnotes/rbt-mathnotes.tex

raw
1 %% rbt-mathnotes.tex
2 %% Copyright 2021 Rebecca B. Turner.
3 %
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License, either version 1.3
6 % of this license or (at your option) any later version.
7 % The latest version of this license is in
8 % http://www.latex-project.org/lppl.txt
9 % and version 1.3 or later is part of all distributions of LaTeX
10 % version 2005/12/01 or later.
11 %
12 % This work has the LPPL maintenance status `maintained'.
13 %
14 % The Current Maintainer of this work is Rebecca B. Turner.
15 %
16 % This work consists of the files:
17 % README.md
18 % rbt-mathnotes.tex
19 % rbt-mathnotes.sty
20 % rbt-mathnotes.cls
21 % rbt-mathnotes-util.sty
22 % rbt-mathnotes-messages.sty
23 % rbt-mathnotes-hw.cls
24 % rbt-mathnotes-formula-sheet.cls
25 % examples/cheat-sheet.tex
26 % examples/multivar.tex
27 % examples/topology-hw-1.tex
28 % and the derived files:
29 % rbt-mathnotes.pdf
30 % examples/cheat-sheet.pdf
31 % examples/multivar.pdf
32 % examples/topology-hw-1.pdf
33
34 \documentclass{ltxguidex}
35
36 \errorcontextlines=10
37 \usepackage{longtable}
38 \usepackage{changepage}
39 \usepackage{metalogo}
40 \usepackage{changelog}
41 \newcommand{\mn}{\ctan{rbt-mathnotes}}
42
43 \makeatletter
44 \renewcommand{\SX@explpreset}{
45 language=[LaTeX]TeX,
46 numbers=none,
47 }
48 \makeatother
49
50 %\setmainfont{Charter}
51 \lstset{basewidth=0.6em}
52
53 \usepackage[
54 nomaketitle,
55 notitles,
56 noxcolor,
57 noenumitem,
58 notheorems,
59 ]{rbt-mathnotes}
60
61 \usepackage{FiraSans}
62 \usepackage{FiraMono}
63
64 \NewDocumentEnvironment{ctandescription}{}
65 {\NewDocumentCommand{\pkg}{m}{\item[\ctan{##1}]}
66 \begin{description}}
67 {\end{description}}
68
69 \author{Rebecca Turner\thanks{\email{[email protected]}, \https{becca.ooo}}}
70 \title{The \mn\ Package}
71 \date{1.0.2 2021/11/29}
72 \begin{document}
73 \maketitle
74
75 \begin{abstract}
76 Rebecca Turner's personal macros and styles for typesetting mathematics
77 notes.
78 \end{abstract}
79
80 \begin{note}
81 Browse the sources, contribute, or complain at \\
82 \https{github.com/9999years/latex-mathnotes}
83 \end{note}
84
85 \tableofcontents
86 \vfill
87 \pagebreak
88
89 \begin{note}
90 Copyright 2021 Rebecca B. Turner.
91
92 This work may be distributed and/or modified under the
93 conditions of the LaTeX Project Public License, either version 1.3
94 of this license or (at your option) any later version.
95 The latest version of this license is in
96 \https{www.latex-project.org/lppl.txt}
97 and version 1.3 or later is part of all distributions of LaTeX
98 version 2005/12/01 or later.
99
100 This work has the LPPL maintenance status `maintained'.
101
102 The Current Maintainer of this work is Rebecca B. Turner.
103
104 This work consists of the files:
105 \begin{itemize}
106 \item \texttt{README.md}
107 \item \texttt{rbt-mathnotes.tex}
108 \item \texttt{rbt-mathnotes.sty}
109 \item \texttt{rbt-mathnotes.cls}
110 \item \texttt{rbt-mathnotes-util.sty}
111 \item \texttt{rbt-mathnotes-messages.sty}
112 \item \texttt{rbt-mathnotes-hw.cls}
113 \item \texttt{rbt-mathnotes-formula-sheet.cls}
114 \item \texttt{examples/cheat-sheet.tex}
115 \item \texttt{examples/multivar.tex}
116 \item \texttt{examples/topology-hw-1.tex}
117 \end{itemize}
118 and the derived files:
119 \begin{itemize}
120 \item \texttt{rbt-mathnotes.pdf}
121 \item \texttt{examples/cheat-sheet.pdf}
122 \item \texttt{examples/multivar.pdf}
123 \item \texttt{examples/topology-hw-1.pdf}
124 \end{itemize}
125 \end{note}
126
127 \vfill
128 \pagebreak
129
130 \section{Package options}
131
132 Some options are enabled by default, and can be disabled by passing
133 |no<option>|. The enabled-by-default options are:
134 \begin{keys}
135 \key{fonts}[\bool][true]
136 \key{stix}[\bool][true]
137 \begin{itemize}
138 \item In \XeTeX\ or \LuaTeX, loads the \ctan{unicode-math} package, and
139 then, if the \option{stix} option is also given, loads the
140 \texttt{STIX2Text} and \texttt{STIX2Math} \textsc{otf} fonts (available
141 in the \ctan{stix2-otf} package).
142
143 The \texttt{STIX2Math} font is loaded with stylistic sets 1 (roundhand
144 script forms instead of chancery script for |\mathcal| Script
145 Alphanumeric Symbols) and 8 (upright, rather than slanted, forms for
146 integrals); see ``Stylistic Sets'' in
147 \href{http://mirrors.ctan.org/fonts/stix2-otf/STIXTwoMath-Regular.pdf}{the
148 \texttt{stix2-otf} documentation} (pp.~51--53) for more information.
149
150 \item In other engines, if the \option{stix} option is also given, loads
151 the \package{stix2} package from \ctan{stix2-type1}.
152 \end{itemize}
153
154 \key{symbols}[\bool][true]
155
156 Defines a collection of ``natural language'' math-mode symbol commands.
157 Most commands are declared with |\ProvideDocumentCommand| so that they
158 won't overwrite custom commands you've already defined.
159
160 Note that symbols may look different depending on the \option{fonts} and
161 \option{stix} options.
162
163 \begin{longtable}{rl}
164 |\lnot| & $\lnot$ \\
165 |\Rational|, |\Rat|, |\Q| & $\Rational$ \\
166 |\Natural|, |\Nat|, |\N| & $\Natural$ \\
167 |\Integer|, |\Int|, |\Z| & $\Integer$ \\
168 |\Complex|, |\Comp|, |\C| & $\Complex$ \\
169 |\Real|, |\R| & $\R$ \\
170 |\powerset| & $\powerset$ \\
171 |\vec{A}| & $\vec{A}$ \\
172 |\intersection|, |\inter| & $\intersection$ \\
173 |\bigintersection|, |\biginter| & $\bigintersection$ \\
174 |\union| & $\union$ \\
175 |\bigunion| & $\bigunion$ \\
176 |\divisible|, |\div| & $a \divisible b$ \\
177 |\notdivisible|, |\ndivisible|, |\notdiv|, |\ndiv| & $a \notdivisible b$ \\
178 |\floor{A}| & $\floor{A}$ \\
179 |\ceil{A}| & $\ceil{A}$ \\
180 |\emptyset|, |\es| & $\emptyset$ \\
181 |\after| & $g \after f$ \\
182 |\cross| & $a \cross b$ \\
183 |\img| & $\img f$ \\
184 |\pre| & $\pre f$ \\
185 |\Stab| & $\Stab f$ \\
186 |\FixPt| & $\FixPt f$ \\
187 |\id| & $\id$ \\
188 |\injection|, |\inj| & $\injection$ \\
189 |\surjection|, |\surj| & $\surjection$ \\
190 |\bijection|, |\bij| & $\bijection$ \\
191 |\restriction|, |\restr| & $f \restr_{\N}$ \\
192 |\dd[y]{x}| & $\dd[y]{x}$ \\
193 |\pd[y]{x}| & $\pd[y]{x}$ \\
194 |\curl| & $\curl$ \\
195 |\dive| & $\dive$ \\
196 \end{longtable}
197
198 \key{maketitle}[\bool][true]
199 Redefines |\maketitle| and related commands. The provided |\maketitle|
200 command will automatically insert a |\thanks| if any email, course,
201 instructor, institution, or semester is supplied with the |\mathnotes|
202 command.
203
204 \key{titles}[\bool][true]
205 No-op; may set the format of sectioning commands in the future.
206
207 \key{xcolor}[\bool][true]
208 Load the \ctan{xcolor} package and defines several colors with the |MN|
209 prefix.
210
211 \key{theorems}[\bool][true]
212 Set up various theorem environments with the \ctan{ntheorem} and
213 \ctan{mdframed} packages.
214
215 Provides |thm| (Theorem), |lem| (Lemma), |cor| (Corollary), |prop|
216 (Proposition), |defn| (Definition), |notation|, |ex|
217 (Example), |note|, |remark|, |hint|, and |abuse-of-notation| (Abuse of
218 notation) theorem-like environments.
219
220 \key{enumitem}[\bool][true]
221 Loads the \ctan{enumitem} package.
222
223 \end{keys}
224
225 The other options are not enabled by default, and can be enabled by passing
226 |<option>| --- the option name --- as a package option:
227 \begin{keys}
228 \key{listings}[\bool]
229 Loads the \ctan{listings} and \ctan{xcolor} packages.
230 Sets default styles for listings, including setting the default language to
231 |Mathematica|.
232
233 \key{knowledge}\bool]
234 Loads the \ctan{knowledge} package and sets up default styles.
235 Patches lists so that manually placing |\AP| and |\itemAP| commands is
236 unecessary.
237
238 \key{index}[\bool]
239 Sets the |knowledge| key and starts indexing with |\makeindex|.
240
241 \key{footnotes}[\bool]
242 Loads the \ctan{footmisc} package and sets up footnotes.
243
244 \key{figures}[\bool]
245 Loads the \ctan{graphicx} and \ctan{caption} packages and sets up figure
246 captions.
247
248 \key{tabu}[\bool]
249 Loads the \ctan{multirow}, \ctan{booktabs}, \ctan{longtable}, and
250 \ctan{tabu} packages.
251
252 Defines the |\Th| command.
253
254 \key{kindle}[\bool]
255 Sets a small page size and tweaks the layout for Kindle devices; designed in
256 particular for whatever generation of Kindle Paperwhite I have.
257 Only compatible with the \ctan{memoir} document class.
258
259 \end{keys}
260
261 \section{Commands}
262
263 \begin{desc}
264 |\numberthis|
265 \end{desc}
266
267 At the end of a line (before the |\\|) in an \ctan{amsmath} starred
268 environment, gives an equation a number.
269
270 \begin{LTXexample}
271 \begin{alignat*}{2}
272 x &= y \\
273 y &= 2z \numberthis \\
274 z &= 1/w
275 \end{alignat*}
276 \end{LTXexample}
277
278 \begin{desc}
279 |\labelthis{<label>}|
280 \end{desc}
281
282 At the end of a line (before the |\\|) in an \ctan{amsmath} starred
283 environment, gives an equation a number and label for referencing.
284
285 \begin{LTXexample}
286 \begin{alignat*}{2}
287 x &= y \\
288 y &= 2z \labelthis{eq:cool} \\
289 z &= 1/w.
290 \end{alignat*}
291 As we saw in
292 Equation~\ref{eq:cool}, \dots
293 \end{LTXexample}
294
295 \begin{desc}
296 |\newacronym[<command>]{<text>}|
297 \end{desc}
298
299 Defines |\<command>| to be |\textsc{<text>}|; |<command>| defaults to |<text>|
300 if ommitted.
301
302 \begin{LTXexample}
303 \newacronym{nist}
304 \newacronym[\seetan]{ctan}
305
306 \nist\ is not associated
307 with \seetan.
308 \end{LTXexample}
309
310 \begin{desc}
311 |\newacronyms{<acronyms>}|
312 \end{desc}
313
314 Defines a collection of acronym commands together using |\newacronym|;
315 |<acronyms>| is a comma-separated list of acronyms.
316
317 \begin{LTXexample}
318 \newacronyms{apa, mla}
319
320 \apa\ and \mla\ are common
321 citation styles.
322 \end{LTXexample}
323
324 \begin{desc}
325 |\mathnotes{<key-value pairs>}|
326 \end{desc}
327
328 \begin{keys}
329 \key{date}[\m{date}]
330 \key{author}[\m{author}]
331 \key{title}[\m{title}]
332 Sets the date, author, or title; setting these keys are equivalent to using the
333 |\date|, |\author|, and |\title| commands, respectively.
334
335 \key{institution}[\m{institution}]
336 Sets the institution (e.g., Brandeis University) associated with the
337 document.
338 \key{course}[\m{course}]
339 Sets the course (e.g., \textsc{math}~23a) associated with the
340 document.
341 \key{semester}[\m{semester}]
342 Sets the semester (e.g., Fall 2018) associated with the document.
343 \key{instructor}[\m{instructor}]
344 Sets the instructor (e.g., Prof.~Ruth~Charney) associated with the document.
345 \key{email}[\m{email}]
346 Sets the email (e.g., \email{[email protected]}) associated with the author.
347 \end{keys}
348
349 \begin{desc}
350 |\TODO[<item>]|
351 \end{desc}
352
353 Typesets a to-do marker.
354
355 \begin{LTXexample}
356 \TODO
357
358 \TODO[explain in detail]
359 \end{LTXexample}
360
361 \begin{desc}
362 |\email{<email>}|
363 \end{desc}
364 Typesets an email address, with a link if the \ctan{hyperref} package is loaded.
365
366 \begin{LTXexample}
367 \email{[email protected]}
368 \end{LTXexample}
369
370 \begin{desc}
371 |\Th[<column spec>]{<header>}|
372 \end{desc}
373 Typesets a table column header in bold using |\multicolumn|. Especially useful
374 if the column in question is a math or numeric column.
375
376 \m{column spec} defaults to |l| (left-aligned).
377
378 \section{The \texttt{rbt-mathnotes} document class}
379
380 The \mn\ document class is a \ctan{memoir}-based class that automatically loads
381 the \mn\ package.
382
383 \section{The \texttt{rbt-mathnotes-hw} document class}
384
385 The |rbt-mathnotes-hw| document class is based on the |rbt-mathnotes| document
386 class, providing additional commands and styles for typesetting homework
387 assignments. Theorems are given subtler styling that takes up less space on
388 the page. The author name and title are added to the top-left heading.
389
390 \begin{desc}
391 |problem| \\
392 |\begin{problem}[<number or options>]| \\
393 |\prob[<number or options>]{<text>}|
394 \end{desc}
395
396 The |problem| environment (and its matching shorthand |\prob|) typesets a
397 homework problem typesets a homework problem. Problems are added to the table of
398 contents at the chapter-level, which is the top level if I remember correctly.
399
400 \m{number or options} is a list of key-value pairs:
401
402 \begin{keys}
403 \key{number}[\m{number}]
404 Sets the problem's number. For brevity, an unrecognized key with no value
405 is also used as the problem number; this allows concise expressions like
406 |\begin{problem}[4.3a] ...| to specify problem numbers (to match textbook
407 problem numbers, for example). Otherwise, problem numbers
408 start at 1 and count up.
409
410 \key{title}[\m{title}]
411 Sets the problem's ``title''.
412
413 \key{label}[\m{label}]
414 Sets the problem's label (e.g., |prob:n-sheeted-covering|), which can be
415 referred to later with |\ref|.
416 \end{keys}
417
418 If your professor calls them ``exercises'' or something, you can change the
419 string used to refer to them with the |\mathnotes| command, which supports an
420 additional key in |rbt-mathnotes-hw|:
421 \begin{keys}
422 \key{problem string}[\m{problem string}][Problem]
423 The string used to represent a problem in titles and contents entries.
424 \end{keys}
425
426 \pagebreak
427 \section{The \texttt{rbt-mathnotes-formula-sheet} document class}
428
429 Sometimes, exams will let you take any formula sheet of a given size as
430 reference material. The |rbt-mathnotes-formula-sheet| document class (based on the
431 \ctan{article} class) is optimized for getting as much material as possible in
432 that area. A tiny |\maketitle| is provided, as well as a tiny |\section|.
433 Theorem titles are highly abbreviated (``Thm'' instead of ``Theorem''). Lists
434 are rendered without linebreaks between items. Paragraphs are compressed and the
435 page margins are set to a tenth of an inch. The entire document is set in
436 |\scriptsize|.
437
438 Some additional keys are added to the |\mathnotes| command to customize the
439 output:
440
441 \begin{keys}
442 \key{columns}[\m{column count}][3]
443 The number of text columns to set the formula sheet in; use 1 to turn off
444 columns.
445
446 \key{balance columns}
447 If set, the unstarred |multicols| environment is used instead of |multicols*|,
448 which attempts to spread material between each of the columns evenly, to
449 make their vertical sizes as even as possible.
450
451 It doesn't look great --- you want to know when you've filled up one column
452 --- so it's off by default.
453
454 \key{width}[\m{width}][8.5in]
455 \key{height}[\m{height}][11in]
456 Set the paper width and height. The 0.1 inch margins are not customizable.
457 \end{keys}
458
459 \begin{changelog}[author=Rebecca Turner]
460 \begin{version}[v=1.0.2, date=2021-11-27, short]
461 Added license notice to all files.
462 \end{version}
463
464 \begin{version}[v=1.0.1, date=2021-11-24, short]
465 Renamed package from \texttt{mathnotes} to \texttt{rbt-mathnotes} to avoid
466 a file name conflict with
467 \href{http://mirrors.ctan.org/fonts/newtx/doc/mathnotes.pdf}{\texttt{CTAN:/fonts/newtx/doc/mathnotes.pdf}}.
468 \end{version}
469
470 \begin{version}[v=1.0.0, date=2021-11-04, short]
471 Initial release as \texttt{mathnotes}, documented package.
472 \end{version}
473 \end{changelog}
474
475 \end{document}