This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: RTF headings
- From: Norman Walsh <ndw at nwalsh dot com>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 28 Aug 2002 06:00:40 -0400
- Subject: DOCBOOK-APPS: Re: RTF headings
- References: <20020627155438.GA24586@stinky.bencurtis.com><87it3q6koo.fsf@nwalsh.com> <20020731133404.GB27960@stinky.bencurtis.com>
/ Ben Curtis <docbook@bencurtis.com> was heard to say:
| Well, I was hoping to force sect1s to render as heading 1, and so on.
You'll have to tweak the section heading definition in your customization
layer:
(define ($section-title$)
(let* ((sect (current-node))
(info (info-element))
(exp-children (if (node-list-empty? info)
(empty-node-list)
(expand-children (children info)
(list (normalize "bookbiblio")
(normalize "bibliomisc")
(normalize "biblioset")))))
(parent-titles (select-elements (children sect) (normalize "title")))
(info-titles (select-elements exp-children (normalize "title")))
(titles (if (node-list-empty? parent-titles)
info-titles
parent-titles))
(subtitles (select-elements exp-children (normalize "subtitle")))
(renderas (inherited-attribute-string (normalize "renderas") sect))
;; the apparent section level
(hlevel
;; if not real section level, then get the apparent level
;; from "renderas"
(if renderas
(section-level-by-gi #f (normalize renderas))
;; else use the real level
(SECTLEVEL)))
(hs (HSIZE (- 4 hlevel))))
(make sequence
(make paragraph
font-family-name: %title-font-family%
font-weight: (if (< hlevel 5) 'bold 'medium)
font-posture: (if (< hlevel 5) 'upright 'italic)
font-size: hs
line-spacing: (* hs %line-spacing-factor%)
space-before: (* hs %head-before-factor%)
space-after: (if (node-list-empty? subtitles)
(* hs %head-after-factor%)
0pt)
start-indent: (if (or (>= hlevel 3)
(member (gi) (list (normalize "refsynopsisdiv")
(normalize "refsect1")
(normalize "refsect2")
(normalize "refsect3"))))
%body-start-indent%
0pt)
first-line-start-indent: 0pt
quadding: %section-title-quadding%
keep-with-next?: #t
heading-level: (if %generate-heading-level% (+ hlevel 1) 0)
;; SimpleSects are never AUTO numbered...they aren't hierarchical
(if (string=? (element-label (current-node)) "")
(empty-sosofo)
(literal (element-label (current-node))
(gentext-label-title-sep (gi sect))))
(element-title-sosofo (current-node)))
(with-mode section-title-mode
(process-node-list subtitles))
($proc-section-info$ info))))
Be seeing you,
norm
--
Norman Walsh <ndw@nwalsh.com> | As we grow older we grow both more
http://www.oasis-open.org/docbook/ | foolish and wiser at the same
Chair, DocBook Technical Committee | time.--La Rochefoucauld