Skribilo comes with an equation formatting package. This package may be loaded by adding the following form at the top of your document:
It allows the inclusion of (complex) equations in your documents, such as, for example, the following:To start with, let's have a look at a concrete example. Ex. 36: Example of a simple equation using the verbose syntax
... produces:
Fortunately, the eq package allows for the use of a much simpler syntax. Ex. 37: Example of a simple equation
... produces:
It is possible to create
equation display blocks,
where several equations are displayed and aligned according to a
particular operator.
(
p
[
This
paragraph
contains this
equation:
,(eq
:inline?
#t '(/ alpha
beta)). This is actually an ,(
emph
[
inline
]
) equation, meaning that
it
occurs within a paragraph. Typesetting has to be adjusted
accordingly.
]
)
(eq-display
(
p
[
This is an equation display block, within which equations can be
aligned with one another.
]
)
(eq
:ident
"eq-limit-b-over-l"
:renderer
(and %have-lout? 'lout)
:align-with
'=
'(= (limit (/
lambda beta) 0
(apply IPL n k))
;; non-simplified
(/ (expt (+ alpha beta) k)
(* beta
(sum
:from
(= x 0)
:to
(- k 1)
(* (combinations k x)
(expt beta (- k 1 x))
(expt alpha x)))))))
[
This equation can be simplified as
follows:
]
(eq
:ident
"eq-limit-b-over-l-simplified"
:renderer
(and %have-lout? 'lout)
:align-with
'=
'(=
;; simplified
(/ (expt (+ alpha beta) k)
(- (expt (+ alpha beta) k)
(expt alpha k)))
(limit (/
lambda beta) 0
(apply IPL n k)))))
... produces:
This paragraph contains this equation: α / β. This is actually an inline equation, meaning that it occurs within a paragraph. Typesetting has to be adjusted accordingly.
This is an equation display block, within which equations can be aligned with one another.
The options available for the top-level
eq
markup
are summarized here:
(
eq [
:number
#t
] [
:mul-style
'space
] [
:div-style
'over
] [
:renderer
] [
:align-with
] [
:inline?
'auto
] [
:class
"eq"
] [
:ident
]
)
auto
, Skribilo will
automatically determine whether the equation is to be "in-line".
Otherwise, it should be a boolean indicating whether the equation is to
appear "in-line", i.e., within a paragraph. If the engine supports it,
it may adjust various parameters such as in-equation spacing
accordingly.
lout
#f
, then the
equation is left unnumbered. Note that this option is only taken into
account for displayed equations.
lout
space
,
cross
,
asterisk
or
dot
.
lout
over
,
fraction
,
div
and
slash
. Per-
eq:/
:div-style
options override this setting.
lout
eq-display
block,
this should be a symbol specifying according to which operator equations
are to be aligned with one another.
lout
Equation display blocks can be defined using
eq-display
. Display blocks define the scope of the alignment among
equations as specified by the
:align-with
options of
eq
.
(
eq-display [
:class
"eq-display"
] [
:ident
]
)