3.10 Standard Markups -- Figure


main page
top:Skribe User Manual
index:Index
markups:Standard Markups


Standard Markups
Markup index
3.1Document
3.2Sectioning
3.3Table of contents
3.4Ornaments
3.5Line breaks
3.6Font
3.7Justification
3.8Enumeration
3.9Frame and color
3.10Figure
3.11Image
3.12Table
3.13Footnote
3.14Characters, Strings and Symbols


Chapters
1Getting Started
2Syntax & Values
3Standard Markups
4References and Hyperlinks
5Indexes
6Bibliography
7Computer programs
8Standard Library
9Engines
10Editing Skribe Programs
11Skribe compiler
12Compiling Texi documents
13List of examples
14Table of contents
prototype
(figure [:ident] [:class] [:legend] [:number #t] [:multicolumns] body)
optionenginesdescription
:identhtml latex The node identifier.
:classhtml latex 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] 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:
This is a unnumbered figure (section Figure)
1 The great Penguin (section Figure)

This Html page has been produced by Skribe.
Last update Tue Feb 28 02:32:12 2006.