3.11 Skribilo User Manual — Figures |
The figure
markup shown below produces floating
figures. Well, whether the figure is really ``floating'' depends on the
engine used (see Chapter 13): printed
output as produced by the lout and latex engines do
produce floating figures, but on-line output as produced by the html engine does not.
(figure [:multicolumns] [:number #t
] [:legend] [:class "figure"
] [:ident] body
)
body
The body of the figure.Skribe is a functional programming language. |
Skribilo has no built-in facility to display the list of figures. Instead, it provides a general machinery for displaying any kind of lists of items contained in a document. This is described in the section [?section Resolve: ./figure.skb:65:10:] and Introspection. For the sake of simplicity, an example showing how to display the list of figures of a document is included below.
(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)))))))))))
... produces:
This is a unnumbered figure (section Figures) |
1 The great Penguin (section Figures) |