Add a new tunable knob 'MIN_SECT_LABELS' and the necessary stylesheet

support.

This option prevents section labels from being numbered after the third
level.

make FORMATS=ps :

  "N.N.N Section Title"
  "N.N.N.N really specific topic"
  "N.N.N.N.N really-really specific topic"

make MIN_SECT_LABELS=1 FORMATS=ps :

  "N.N.N Section Title"
  "really specific topic"
  "really-really specific topic"

The section titles are still bold, spaced away from the text, and
sized according to their nesting level.
This commit is contained in:
Murray Stokely 2001-07-28 03:00:03 +00:00
parent 2de880b5f1
commit f9ccc49092
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10079
2 changed files with 88 additions and 10 deletions

View file

@ -1,4 +1,4 @@
<!-- $FreeBSD: doc/en_US.ISO8859-1/share/sgml/freebsd.dsl,v 1.10 2001/07/16 05:00:21 murray Exp $ -->
<!-- $FreeBSD: doc/en_US.ISO8859-1/share/sgml/freebsd.dsl,v 1.11 2001/07/20 02:53:08 murray Exp $ -->
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl PUBLIC "-//FreeBSD//DOCUMENT DocBook Language Neutral Stylesheet//EN" CDATA DSSSL>
@ -162,10 +162,76 @@
(element authorgroup
(empty-sosofo))
]]>
<!-- Print only ................................................... -->
<![ %output.print; [
(define minimal-section-labels #f)
(define max-section-level-labels
(if minimal-section-labels 3 10))
(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))
(hlevel ;; the apparent section level;
(if renderas ;; if not real section level,
(string->number ;; then get the apparent level
(substring renderas 4 5)) ;; from "renderas",
(SECTLEVEL))) ;; else use the real level
(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 (> hlevel (- max-section-level-labels 1))
(empty-sosofo)
(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))
($section-info$ info))))
]]>
<!-- Both sets of stylesheets ..................................... -->
(define (local-en-label-title-sep)