summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--src/guile/skribilo/engine/lout.scm83
2 files changed, 77 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b7d9a5..cf3a624 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,26 @@
 # arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2
 #
 
+2007-09-20 17:20:55 GMT	Ludovic Court`es <ludovic.courtes@laas.fr>	patch-167
+
+    Summary:
+      lout: Add customs for the `book' document type.
+    Revision:
+      skribilo--devo--1.2--patch-167
+
+    * src/guile/skribilo/engine/lout.scm (lout-engine)[publisher, edition,
+      before-title-page, on-title-page, after-title-page, at-end]: New
+      customs.
+      (output-report-options, output-book-options): New.
+      (document): Use them.
+
+    modified files:
+     ChangeLog src/guile/skribilo/engine/lout.scm
+
+    new patches:
+     lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-109
+
+
 2007-09-20 14:16:12 GMT	Ludovic Court`es <ludovic.courtes@laas.fr>	patch-166
 
     Summary:
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?)