Contents

Boxed theorems

Companion package

Boxed theorems

The declaration \DeclareWebBox makes an environment a box on the web, with a coloured left border; the source of the environmentโ€™s uses does not change, and in print \DeclareWebBox changes nothing. This exampleโ€™s preamble boxes every theorem and proof, and makes one boxed copy of theorem with a colour of its own:

\usepackage[boxed]{reflowtex}
\DeclareWebBox[keytheorem]{theorem}[accent=#c2410c, class=key]

Theorem 1. Every finite integral domain is a field.

Proof. Letbe a finite integral domain andin.

Claim. The mapis a bijection of.

Proof. Ifthen, so, ashas no zero divisors. An injective map of a finite set to itself is onto.

So somehas, andis invertible.

Theorem 2 (Wedderburn). Every finite division ring is a field.

\begin{theorem}
Every finite integral domain is a field.
\end{theorem}
\begin{proof}
Let $D$ be a finite integral domain and $a \neq 0$ in $D$.
\begin{claim}
The map $x \mapsto ax$ is a bijection of $D$.
\end{claim}
\begin{proof}
If $ax = ay$ then $a(x-y) = 0$, so $x = y$, as $D$ has no zero divisors.
An injective map of a finite set to itself is onto.
\end{proof}
So some $x$ has $ax = 1$, and $a$ is invertible.
\end{proof}
\begin{keytheorem}[Wedderburn]
Every finite division ring is a field.
\end{keytheorem}

A nested box, like the claim inside the proof, is a little narrower at each level; the space LA TEX puts around an environment stays outside its box, and a proofโ€™s QED box stays inside.

Three ways to use it

\DeclareWebBox{theorem}                  % every theorem in the document
\DeclareWebBox[keytheorem]{theorem}      % a boxed copy; theorem itself stays plain
\DeclareWebBox{lemma}[accent=#3b8a55]    % with options

Without the optional first argument the environment itself is boxed, everywhere. With it, \DeclareWebBox defines a new environment, a copy that shares the originalโ€™s counter and heading, and boxes only the copy. This is for the few theorems that should stand out, like Wedderburnโ€™s above. The package option boxed boxes every environment made with \newtheorem and every proof.

Options

kind= the look: theorem (the default), proof (the default for an environment named proof), note, or a kind of your own pageโ€™s CSS.

accent= the border colour, as #hex.

background= the fill, as #hex; by default a light tint of the accent.

class= CSS classes for the box, for anything else.

Each box also carries its environmentโ€™s name as data-env, and the defaults are custom properties a page can set:

:root { --latex-theorem-accent: #7a4fb3; --latex-proof-accent: #8a8f98; }
.latex-stream[data-env="definition"] { --latex-box-accent: #3b8a55; }
.latex-stream.key { box-shadow: 0 1px 6px rgb(0 0 0 / 0.08); }