From cd32b7c7644ff102b1d541eeb6e90a87852e3c88 Mon Sep 17 00:00:00 2001 From: utensil Date: Sat, 27 Apr 2024 22:37:41 +0800 Subject: [PATCH] Less boilerplate code --- trees/base-macros.tree | 25 +++++++++++++++++++++++-- trees/latex-preamble.tree | 10 ++++------ trees/refs/lawson2016spin.tree | 2 +- trees/refs/wiki-0001.tree | 5 +++++ trees/spin-0002.tree | 9 +-------- trees/spin-0003.tree | 13 +++---------- 6 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 trees/refs/wiki-0001.tree diff --git a/trees/base-macros.tree b/trees/base-macros.tree index 7817866..2ebe1e8 100644 --- a/trees/base-macros.tree +++ b/trees/base-macros.tree @@ -1,11 +1,14 @@ \title{basic macros} +\p{Here we define:} + \import{latex-preamble} \alloc\base/tex-preamble -% minitex: a macro for typesetting LaTeX code in a minipage, with the width of an A5 paper, -% so the text size almost matches the size output by native forester code. +\p{\code{minitex}: A macro for typesetting LaTeX code in a minipage, with the width of an A5 paper, +so the text size almost matches the size output by native forester code. This doesn't work very well on mobile yet.} + \def\minitex[body]{ \scope{ \put?\base/tex-preamble{ @@ -25,4 +28,22 @@ \end{minipage} } } +} + +\p{\code{texdef}: A macro for making a \code{minitex} definition with a reference.} + +\p{Usage:} + +\p{ +\startverb +\texdef{name}{reference}{ + definition body in LaTeX +} +\stopverb +} + +\def\texdef[name][reference][body]{ + \title{\name ([[\reference]])} + \taxon{definition} + \minitex{\body} } \ No newline at end of file diff --git a/trees/latex-preamble.tree b/trees/latex-preamble.tree index 8c3c845..a6e0311 100644 --- a/trees/latex-preamble.tree +++ b/trees/latex-preamble.tree @@ -1,12 +1,8 @@ \title{LaTeX preambles} -\p{This tree defines} +\p{Here we define:} -\ol{ - \li{\code{\startverb\latex-preamble/common\stopverb}} -} - -\p{They are used by [[base-macros]].} +\p{\code{latex-preamble/common}: Some common LaTeX preambles.} \def\latex-preamble/common{ \startverb @@ -14,3 +10,5 @@ \input{../trees/preamble} \stopverb } + +\p{They are used by [[base-macros]].} diff --git a/trees/refs/lawson2016spin.tree b/trees/refs/lawson2016spin.tree index 175255d..fb8ea17 100644 --- a/trees/refs/lawson2016spin.tree +++ b/trees/refs/lawson2016spin.tree @@ -1,5 +1,5 @@ \title{Spin Geometry} -\date{2019-03-05} +\date{2024-04-26} \taxon{reference} % \author{todo} diff --git a/trees/refs/wiki-0001.tree b/trees/refs/wiki-0001.tree new file mode 100644 index 0000000..52071b6 --- /dev/null +++ b/trees/refs/wiki-0001.tree @@ -0,0 +1,5 @@ +\title{Clifford algebra (Wikipedia)} +\date{2019-03-05} +\taxon{reference} + +\p{See [Clifford algebra (Wikipedia)](https://en.wikipedia.org/wiki/Clifford_algebra).} \ No newline at end of file diff --git a/trees/spin-0002.tree b/trees/spin-0002.tree index c28fadc..0388e30 100644 --- a/trees/spin-0002.tree +++ b/trees/spin-0002.tree @@ -1,12 +1,6 @@ -\title{Spin group ([[lawson2016spin]])} -\date{2024-04-27} - -\taxon{definition} - \import{base-macros} -\minitex{ - +\texdef{Spin group}{lawson2016spin}{ The Pin group of $(V, q)$ is the subgroup $\operatorname{Pin}(V, q)$ of $P(V, q)$ generated by the elements $v \in V$ with $q(v) = \pm 1$. The associated spin group of $(V, q)$ is then defined by @@ -14,5 +8,4 @@ The associated spin group of $(V, q)$ is then defined by $$ \operatorname{Spin}(V, q)=\operatorname{Pin}(V, q) \cap \mathrm{Cl}^0(V, q) $$ - } diff --git a/trees/spin-0003.tree b/trees/spin-0003.tree index deedf9f..ddc0487 100644 --- a/trees/spin-0003.tree +++ b/trees/spin-0003.tree @@ -1,12 +1,5 @@ -\title{Spin group (The wikipedia page on Clifford Algebras)} -\date{2024-04-27} - -\taxon{definition} - \import{base-macros} -\minitex{ - -The pin group $\operatorname{Pin}_V(K)$ is the subgroup of the Lipschitz group $\Gamma$ of elements of spinor norm 1, and similarly the spin group $\operatorname{Spin}_V(K)$ is the subgroup of elements of Dickson invariant 0 in $\operatorname{Pin}_V(K)$. - -} \ No newline at end of file +\texdef{Spin group}{wiki-0001}{ + The pin group $\operatorname{Pin}_V(K)$ is the subgroup of the Lipschitz group $\Gamma$ of elements of spinor norm 1, and similarly the spin group $\operatorname{Spin}_V(K)$ is the subgroup of elements of Dickson invariant 0 in $\operatorname{Pin}_V(K)$. +}