Skip to content

Commit

Permalink
Less boilerplate code
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Apr 27, 2024
1 parent 03d61e1 commit cd32b7c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 27 deletions.
25 changes: 23 additions & 2 deletions trees/base-macros.tree
Original file line number Diff line number Diff line change
@@ -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{
Expand All @@ -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}
}
10 changes: 4 additions & 6 deletions trees/latex-preamble.tree
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
\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
% because LaTeX is running in `build` directory
\input{../trees/preamble}
\stopverb
}

\p{They are used by [[base-macros]].}
2 changes: 1 addition & 1 deletion trees/refs/lawson2016spin.tree
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\title{Spin Geometry}
\date{2019-03-05}
\date{2024-04-26}
\taxon{reference}

% \author{todo}
Expand Down
5 changes: 5 additions & 0 deletions trees/refs/wiki-0001.tree
Original file line number Diff line number Diff line change
@@ -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).}
9 changes: 1 addition & 8 deletions trees/spin-0002.tree
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
\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

$$
\operatorname{Spin}(V, q)=\operatorname{Pin}(V, q) \cap \mathrm{Cl}^0(V, q)
$$

}
13 changes: 3 additions & 10 deletions trees/spin-0003.tree
Original file line number Diff line number Diff line change
@@ -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)$.

}
\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)$.
}

0 comments on commit cd32b7c

Please sign in to comment.