aboutsummaryrefslogtreecommitdiff
path: root/src/guile/skribilo/engine/lout.scm
diff options
context:
space:
mode:
authorLudovic Court`es2007-06-04 12:43:42 +0000
committerLudovic Court`es2007-06-04 12:43:42 +0000
commit5617d303ebb53291567f5b8199afb2d95db8e89b (patch)
tree9d244dc13e2f08140b39cdc246f252054ec7e2d9 /src/guile/skribilo/engine/lout.scm
parentb373074b4418c06082e28479c88ec750a4501710 (diff)
downloadskribilo-5617d303ebb53291567f5b8199afb2d95db8e89b.tar.gz
skribilo-5617d303ebb53291567f5b8199afb2d95db8e89b.tar.lz
skribilo-5617d303ebb53291567f5b8199afb2d95db8e89b.zip
Fixed handling of figure numbering in `ref'.
* src/guile/skribilo/ast.scm (markup-number-string): Don't use a hierarchical numbering scheme for figures. * src/guile/skribilo/engine/lout.scm (ref): Use `markup-number-string' rather than `@NumberOf' to determine the number of a figure. This guarantees numbering consistency. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-55
Diffstat (limited to 'src/guile/skribilo/engine/lout.scm')
-rw-r--r--src/guile/skribilo/engine/lout.scm39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index e00d213..aebde57 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -2441,30 +2441,25 @@
;* ref ... @label ref@ */
;*---------------------------------------------------------------------*/
(markup-writer 'ref
- :options '(:text :chapter :section :subsection :subsubsection
- :figure :mark :handle :ident :page)
+ :options '(:text :page text kind
+ :chapter :section :subsection :subsubsection
+ :figure :mark :handle :ident)
+
:action (lambda (n e)
- (let ((url (markup-option n :url))
- (text (markup-option n :text))
- (mark (markup-option n :mark))
- (handle (markup-option n :handle))
- (chapter (markup-option n :chapter))
- (section (markup-option n :section))
- (subsection (markup-option n :subsection))
- (subsubsection (markup-option n :subsubsection))
+ (let ((ident (markup-option n 'text))
+ (kind (markup-option n 'kind))
+ (text (markup-option n :text))
(show-page-num? (markup-option n :page)))
- ;; A handle to the target is automagically passed
- ;; as the body of each `ref' instance (see `api.scm').
+ ;; A handle to the target is passed as the body of each
+ ;; `ref' instance (see `package/base.scm').
(let* ((target (handle-ast (markup-body n)))
- (ident (markup-ident target))
- (title (markup-option target :title))
- (number (markup-option target :number)))
+ (title (markup-option target :title)))
(lout-debug "ref: target=~a ident=~a" target ident)
(if text (output text e))
;; Marks don't have a number
- (if (eq? (markup-markup target) 'mark)
+ (if (eq? kind 'mark)
(printf (lout-page-of ident))
(begin
;; Don't output a section/whatever number
@@ -2474,10 +2469,14 @@
;; we don't even know how to reference them
;; anyway.
(if (not text)
- (printf " @NumberOf { ~a }"
- (lout-tagify ident)))
- (if show-page-num?
- (printf (lout-page-of ident)))))))))
+ (let ((number
+ (if (eq? kind 'figure)
+ (markup-option target :number)
+ (markup-number-string target))))
+ (display " ")
+ (display number))
+ (if show-page-num?
+ (printf (lout-page-of ident))))))))))
;*---------------------------------------------------------------------*/