aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/engine/lout.scm83
1 files changed, 57 insertions, 26 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 49df54d..d0819bf 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -557,7 +557,7 @@
;*---------------------------------------------------------------------*/
-;* lout-engine ... */
+;* lout-engine ... */
;*---------------------------------------------------------------------*/
(define lout-engine
(make-engine 'lout
@@ -613,6 +613,14 @@
;; current language is chosen.
(abstract-title #t)
+ ;; For books.
+ (publisher #f)
+ (edition #f)
+ (before-title-page #f)
+ (on-title-page #f)
+ (after-title-page #f)
+ (at-end #f)
+
;; Whether to optimize pages.
(optimize-pages? #f)
@@ -1011,6 +1019,10 @@
(markup-writer 'breakable-space :before " &1s\n" :action #f)
+;;;
+;;; Document.
+;;;
+
(define (lout-page-orientation orientation)
;; Return a string representing the Lout page orientation name for symbol
;; `orientation'.
@@ -1025,6 +1037,46 @@
orientation)
(cdr which))))
+(define (output-report-options doc e)
+ ;; Output document options specific to the `report' document type.
+ (let ((cover-sheet? (engine-custom e 'cover-sheet?))
+ (abstract (engine-custom e 'abstract))
+ (abstract-title (engine-custom e 'abstract-title)))
+ (display (string-append " @CoverSheet { "
+ (if cover-sheet? "Yes" "No")
+ " }\n"))
+
+ (if abstract
+ (begin
+ (if (not (eq? abstract-title #t))
+ (begin
+ (display " @AbstractTitle { ")
+ (cond
+ ((not abstract-title) #t)
+ (else (output abstract-title e)))
+ (display " }\n")))
+
+ (display " @Abstract {\n")
+ (output abstract e)
+ (display "\n}\n")))))
+
+(define (output-book-options doc engine)
+ ;; Output document options specific to the `book' document type.
+ (define (output-option lout opt)
+ (let ((val (engine-custom engine opt)))
+ (if val
+ (begin
+ (format #t " ~a { " lout)
+ (output val engine)
+ (display " }\n")))))
+
+ (output-option "@Edition" 'edition)
+ (output-option "@Publisher" 'publisher)
+ (output-option "@BeforeTitlePage" 'before-title-page)
+ (output-option "@OnTitlePage" 'on-title-page)
+ (output-option "@AfterTitlePage" 'after-title-page)
+ (output-option "@AtEnd" 'at-end))
+
;*---------------------------------------------------------------------*/
;* document ... */
@@ -1119,31 +1171,10 @@
(display (if date-line "Yes" "No")))
(display " }\n")))
- ;; Lout reports make it possible to choose whether to prepend
- ;; a cover sheet (books and docs don't). Same for a date
- ;; line.
- (if (eq? doc-type 'report)
- (let ((cover-sheet? (engine-custom e 'cover-sheet?))
- (abstract (engine-custom e 'abstract))
- (abstract-title (engine-custom e 'abstract-title)))
- (display (string-append " @CoverSheet { "
- (if cover-sheet?
- "Yes" "No")
- " }\n"))
-
- (if abstract
- (begin
- (if (not (eq? abstract-title #t))
- (begin
- (display " @AbstractTitle { ")
- (cond
- ((not abstract-title) #t)
- (else (output abstract-title e)))
- (display " }\n")))
-
- (display " @Abstract {\n")
- (output abstract e)
- (display "\n}\n")))))
+ ;; Output options specific to one of the document types.
+ (case doc-type
+ ((report) (output-report-options n e))
+ ((book) (output-book-options n e)))
(format #t " @OptimizePages { ~a }\n"
(if (engine-custom e 'optimize-pages?)