|
prototype |
(figure [:ident] [:class] [:legend] [:number #t ] [:multicolumns] body ) |
:ident | html latex | The node identifier. |
:class | html latex | The node class. |
:legend | html latex | The legend of the figure. If no :ident is
provided to the figure, it uses the legend value as an
identifier. In consequence, it is possible to use the
:legend value in
references. |
:number | html latex | If the optional argument :number is a number,
that number is used as the new Scribe compiler figure
counter. If it is #t the compiler automatically
sets a number for that figure. If it is #f the
figure is numberless. |
:multicolumns | html latex | A boolean that indicates, for back-ends
supporting multi-columns rendering (e.g., "TeX"), if the figure
spans over all the columns. |
body | The body of the figure. |
ref document |
Example:
(center
(figure :legend "This is a unnumbered figure"
:ident "fig1"
:number #f
(frame [Skribe is a functional programming language.])))
(center
(figure :legend "The great Penguin"
(image :file "linux.gif")))
|
|
Ex. 13: The figure markup
Produces:
Skribe is a functional programming language. |
Fig. : This is a unnumbered figure

Fig. 1: The great Penguin
|
|
Skribe has no builtin facility for displaying the list of figures.
Instead, it provides a general machinery for displaying any kind of lists
contained in the document. This is described in the section [?section Resolve] and [?section Introspection] but for the
sake of the coherence, this section also contains an example that
shows how to display the list of figures of a document. Example:
(resolve (lambda (n e env)
(let* ((d (ast-document n))
(ex (container-env-get d 'figure-env)))
(table (map (lambda (e)
(tr (td :align 'left
(markup-option e ':number)
" "
(ref :handle (handle e)
:text (markup-option e :legend))
" (section "
(let ((c (ast-section e)))
(ref :handle (handle c)
:text (markup-option c :title)))
")")))
(sort ex
(lambda (e1 e2)
(let ((n1 (markup-option e1 :number))
(n2 (markup-option e2 :number)))
(cond
((not (number? n1))
#t)
((not (number? n2))
#f)
(else
(< n1 n2)))))))))))
|
|
Ex. 14: The figure markup
Produces:
|