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:
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 \neq0$ 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: