diff options
author | Ludovic Court`es | 2007-08-29 13:22:43 +0000 |
---|---|---|
committer | Ludovic Court`es | 2007-08-29 13:22:43 +0000 |
commit | caefe7b373e06bfb842ed99de4bd69d0d46c0488 (patch) | |
tree | 79323122993badc6d0a1a3b8ea49855c4be7784d /src | |
parent | 34c706c18157fdcf474758466cb7d44f10c397b1 (diff) | |
parent | 055a955df3fa1fa77b3e962f3a136f5e364abb20 (diff) | |
download | skribilo-caefe7b373e06bfb842ed99de4bd69d0d46c0488.tar.gz skribilo-caefe7b373e06bfb842ed99de4bd69d0d46c0488.tar.lz skribilo-caefe7b373e06bfb842ed99de4bd69d0d46c0488.zip |
lout: Provide support for separate first-paragraph gap style.
* src/guile/skribilo/engine/lout.scm (lout-engine)[first-paragraph-gap]:
New custom.
(paragraph)[first-paragraph?]: New. Use it to honor
`first-paragraph-gap'.
git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-158
Diffstat (limited to 'src')
-rw-r--r-- | src/guile/skribilo/engine/lout.scm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm index 5285c76..d2a34e2 100644 --- a/src/guile/skribilo/engine/lout.scm +++ b/src/guile/skribilo/engine/lout.scm @@ -630,6 +630,10 @@ (paragraph-gap "\n//1.0vx @ParaIndent @Wide &{0i}\n") + ;; Gap for the first paragraph within a container + ;; (e.g., the first paragraph of a chapter). + (first-paragraph-gap "\n@LP\n") + ;; For multi-page tables, it may be ;; useful to set this to `#t'. However, ;; this looks kind of buggy. @@ -1528,7 +1532,18 @@ (markup-markup (ast-parent n))) '(chapter section subsection subsubsection slide)))) :before (lambda (n e) - (let ((gap (engine-custom e 'paragraph-gap))) + (define (first-paragraph?) + ;; Return true if N is the first paragraph in this container. + (let* ((parent (ast-parent n)) + (siblings (markup-body parent))) + (and (pair? siblings) + (eq? n (find (lambda (n) + (is-markup? n 'paragraph)) + siblings))))) + + (let ((gap (if (first-paragraph?) + (engine-custom e 'first-paragraph-gap) + (engine-custom e 'paragraph-gap)))) (display (if (string? gap) gap "\n@PP\n"))))) ;*---------------------------------------------------------------------*/ |