3.10 Skribe User Manual -- Figure
prototype
(figure [:ident] [:class "figure"] [:legend] [:number #t] [:multicolumns] body)
optionenginesdescription
:identhtml latex xml The node identifier.
:classhtml latex xml The node class.
:legendhtml 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.
:numberhtml 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.
:multicolumnshtml latex A boolean that indicates, for back-ends supporting multi-columns rendering (e.g., "TeX"), if the figure spans over all the columns.
argumentdescription
bodyThe body of the figure.
See also
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

3.10.1 List of figures

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: user/figure.skb:6460] and [?section Introspection: user/figure.skb:6461] 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:

This is a unnumbered figure (section Figure)
1 The great Penguin (section Figure)

This Html page has been produced by Skribe.
Last update Wed Aug 4 23:12:33 2004.