22
There are five typical arrangements of equations within the web template, the first four are all variations of a theme and the last one is very simple:
Full equation
Full equation with background shading
Basic equation
Basic equation with background shading
An inline equation
The only difference between these is in the HTML, I show the HTML and an example for each type along with some notes in the following sections:
This is the one we’ve already looked at:
<div class="formulae" id="js--e99-01"> <div class="formulae-header">Equation Header</div> <div class="formulae-container"> <div class="formulae-equ"> `sum_(i=1)^n i^3=((n(n+1))/2)^2` </div> <div class="formulae-num">(99.1) </div> <div class="formulae-caption">Equation caption</div> </div>
It looks like this:
This is the same as the above but with background shading.
<div class="formulae" id="js--e99-01"> <div class="formulae-header formulae-bkgd">Equation Header</div> <div class="formulae-container formulae-bkgd"> <div class="formulae-equ"> `f(a) = 1/(2pii) oint_gamma f(z)/(z-a)dz` </div> <div class="formulae-num">(99.1) </div> <div class="formulae-caption">Equation caption</div> </div>
It looks like this:
The class formulae-bkgd has been added to the formulae-header and formulae-container div elements.
The basic equation is the same as the full equation, but does not have a heading line or a caption:
<div class="formulae" id="js--e99-01"> <div class="formulae-container"> <div class="formulae-equ"> `x=(-b +- sqrt(b^2 – 4ac))/(2a)` </div> <div class="formulae-num">(99.1) </div> </div> <div class="formulae-caption"> </div> </div>
It looks like this:
The formulae-caption div still exists (it gives spacing after the equation), but if no caption is required, just leave the div empty.
This is the same as the previous, but with shading:
<div class="formulae" id="js--e99-01"> <div class="formulae-container formulae-bkgd "> <div class="formulae-equ"> `x=(-b +- sqrt(b^2 – 4ac))/(2a)` </div> <div class="formulae-num">(99.1) </div> </div> <div class="formulae-caption"> </div> </div>
It looks like this:
The formulae-caption div still exists (it gives spacing after the equation), but if no caption is required, just leave the div empty.
TThe class formulae-bkgd has been added to the formulae-container div element.
Equations can be placed directly in a line of text.
An inline equation does not need any formatting, there is no class associated with it, just add a <span>...</span> element and put the equation in it (underlined in red below):
<p class="hyp">Inline equations <span>`f(a) = 1/(2pii) oint f(z)/(z-a)dz`</span> are possibe too.
It looks like this:
Inline equations `f(a) = 1/(2pii) oint f(z)/(z-a)dz` are possibe too.
Equation numbers are entirely optional, the formulae-num div however is not; if equation numbers are not required, leave the div empty:
<div class="formulae-num"></div>