1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
3 PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//NL"
9 <style-specification id="docbook-l10n-nl">
10 <style-specification-body>
12 ;; $Id: dbl1nl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $
14 ;; This file is part of the Modular DocBook Stylesheet distribution.
15 ;; See ../README or http://nwalsh.com/docbook/dsssl/
18 ;; ----------------------------- Localization -----------------------------
20 ;; This is the Dutch localization
22 ;; If you create a new version of this file, please send it to
23 ;; Norman Walsh, ndw@nwalsh.com
26 ;; Hugo van der Kooij, hvdkooij@caiw.nl
27 ;; Frederik Fouvry, fouvry@essex.ac.uk
29 ;; The generated text for cross references to elements. See dblink.dsl
30 ;; for a discussion of how substitution is performed on the %x
34 (define (nl-author-string #!optional (author (current-node)))
35 ;; Return a formatted string representation of the contents of:
37 ;; Handles Honorific, FirstName, SurName, and Lineage.
38 ;; If %author-othername-in-middle% is #t, also OtherName
39 ;; Handles *only* the first of each.
40 ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage"
42 ;; returns (data corpauthor)
43 (let* ((h_nl (select-elements (descendants author) (normalize "honorific")))
44 (f_nl (select-elements (descendants author) (normalize "firstname")))
45 (o_nl (select-elements (descendants author) (normalize "othername")))
46 (s_nl (select-elements (descendants author) (normalize "surname")))
47 (l_nl (select-elements (descendants author) (normalize "lineage")))
48 (has_h (not (node-list-empty? h_nl)))
49 (has_f (not (node-list-empty? f_nl)))
50 (has_o (and %author-othername-in-middle%
51 (not (node-list-empty? o_nl))))
52 (has_s (not (node-list-empty? s_nl)))
53 (has_l (not (node-list-empty? l_nl))))
54 (if (or (equal? (gi author) (normalize "author"))
55 (equal? (gi author) (normalize "editor"))
56 (equal? (gi author) (normalize "othercredit")))
58 (if has_h (string-append (data-of (node-list-first h_nl))
59 %honorific-punctuation%) "")
60 (if has_f (string-append
62 (data-of (node-list-first f_nl))) "")
63 (if has_o (string-append
64 (if (or has_h has_f) " " "")
65 (data-of (node-list-first o_nl))) "")
66 (if has_s (string-append
67 (if (or has_h has_f has_o) " " "")
68 (data-of (node-list-first s_nl))) "")
69 (if has_l (string-append ", " (data-of (node-list-first l_nl))) ""))
72 (define (nl-xref-strings)
73 (list (list (normalize "appendix") (if %chapter-autolabel%
76 (list (normalize "article") (string-append %gentext-nl-start-quote%
78 %gentext-nl-end-quote%))
79 (list (normalize "bibliography") "%t")
80 (list (normalize "book") "%t")
81 (list (normalize "chapter") (if %chapter-autolabel%
84 (list (normalize "equation") "&Equation; %n")
85 (list (normalize "example") "&Example; %n")
86 (list (normalize "figure") "&Figure; %n")
87 (list (normalize "glossary") "%t")
88 (list (normalize "index") "%t")
89 (list (normalize "listitem") "%n")
90 (list (normalize "part") "&Part; %n")
91 (list (normalize "preface") "%t")
92 (list (normalize "procedure") "&Procedure; %n, %t")
93 (list (normalize "reference") "&Reference; %n, %t")
94 (list (normalize "section") (if %section-autolabel%
97 (list (normalize "sect1") (if %section-autolabel%
100 (list (normalize "sect2") (if %section-autolabel%
103 (list (normalize "sect3") (if %section-autolabel%
106 (list (normalize "sect4") (if %section-autolabel%
109 (list (normalize "sect5") (if %section-autolabel%
112 (list (normalize "simplesect") (if %section-autolabel%
115 (list (normalize "sidebar") "&sidebar; %t")
116 (list (normalize "step") "&step; %n")
117 (list (normalize "table") "&Table; %n")))
119 (define (gentext-nl-xref-strings gind)
120 (let* ((giname (if (string? gind) gind (gi gind)))
121 (name (normalize giname))
122 (xref (assoc name (nl-xref-strings))))
125 (let* ((msg (string-append "[&xrefto; "
126 (if giname giname "&nonexistantelement;")
128 (err (node-list-error msg (current-node))))
131 (define (nl-auto-xref-indirect-connector before)
134 ;; Should the TOC come first or last?
136 (define %generate-nl-toc-in-front% #t)
138 ;; gentext-element-name returns the generated text that should be
139 ;; used to make reference to the selected element.
142 (define (nl-element-name)
144 (list (normalize "abstract") "&Abstract;")
145 (list (normalize "answer") "&Answer;")
146 (list (normalize "appendix") "&Appendix;")
147 (list (normalize "article") "&Article;")
148 (list (normalize "bibliography") "&Bibliography;")
149 (list (normalize "book") "&Book;")
150 (list (normalize "calloutlist") "")
151 (list (normalize "caution") "&Caution;")
152 (list (normalize "chapter") "&Chapter;")
153 (list (normalize "copyright") "&Copyright;")
154 (list (normalize "dedication") "&Dedication;")
155 (list (normalize "edition") "&Edition;")
156 (list (normalize "equation") "&Equation;")
157 (list (normalize "example") "&Example;")
158 (list (normalize "figure") "&Figure;")
159 (list (normalize "glossary") "&Glossary;")
160 (list (normalize "glosssee") "&GlossSee;")
161 (list (normalize "glossseealso") "&GlossSeeAlso;")
162 (list (normalize "important") "&Important;")
163 (list (normalize "index") "&Index;")
164 (list (normalize "colophon") "&Colophon;")
165 (list (normalize "setindex") "&SetIndex;")
166 (list (normalize "isbn") "&isbn;")
167 (list (normalize "legalnotice") "&LegalNotice;")
168 (list (normalize "msgaud") "&MsgAud;")
169 (list (normalize "msglevel") "&MsgLevel;")
170 (list (normalize "msgorig") "&MsgOrig;")
171 (list (normalize "note") "&Note;")
172 (list (normalize "part") "&Part;")
173 (list (normalize "preface") "&Preface;")
174 (list (normalize "procedure") "&Procedure;")
175 (list (normalize "pubdate") "&Published;")
176 (list (normalize "question") "&Question;")
177 (list (normalize "refentry") "&RefEntry;")
178 (list (normalize "reference") "&Reference;")
179 (list (normalize "refname") "&RefName;")
180 (list (normalize "revhistory") "&RevHistory;")
181 (list (normalize "refsect1") "&RefSection;")
182 (list (normalize "refsect2") "&RefSection;")
183 (list (normalize "refsect3") "&RefSection;")
184 (list (normalize "refsynopsisdiv") "&RefSynopsisDiv;")
185 (list (normalize "revision") "&Revision;")
186 (list (normalize "sect1") "&Section;")
187 (list (normalize "sect2") "&Section;")
188 (list (normalize "sect3") "&Section;")
189 (list (normalize "sect4") "&Section;")
190 (list (normalize "sect5") "&Section;")
191 (list (normalize "section") "&Section;")
192 (list (normalize "simplesect") "&Section;")
193 (list (normalize "seeie") "&See;")
194 (list (normalize "seealsoie") "&Seealso;")
195 (list (normalize "set") "&Set;")
196 (list (normalize "sidebar") "&Sidebar;")
197 (list (normalize "step") "&step;")
198 (list (normalize "table") "&Table;")
199 (list (normalize "tip") "&Tip;")
200 (list (normalize "toc") "&TableofContents;")
201 (list (normalize "warning") "&Warning;")
204 (define (gentext-nl-element-name gind)
205 (let* ((giname (if (string? gind) gind (gi gind)))
206 (name (normalize giname))
207 (pname (assoc name (nl-element-name))))
210 (let* ((msg (string-append
211 "gentext-nl-element-name: &unexpectedelementname;: "
213 (err (node-list-error msg (current-node))))
216 ;; gentext-element-name-space returns gentext-element-name with a
217 ;; trailing space, if gentext-element-name isn't "".
219 (define (gentext-nl-element-name-space giname)
220 (string-with-space (gentext-element-name giname)))
222 ;; gentext-intra-label-sep returns the seperator to be inserted
223 ;; between multiple occurances of a label (or parts of a label)
224 ;; for the specified element. Most of these are for enumerated
225 ;; labels like "Figure 2-4", but this function is used elsewhere
226 ;; (e.g. REFNAME) with a little abuse.
229 (define (local-nl-intra-label-sep)
232 (define (nl-intra-label-sep)
234 (list (normalize "equation") "-")
235 (list (normalize "informalequation") "-")
236 (list (normalize "example") "-")
237 (list (normalize "figure") "-")
238 (list (normalize "listitem") ".")
239 (list (normalize "procedure") ".")
240 (list (normalize "refentry") ".")
241 (list (normalize "reference") ".")
242 (list (normalize "refname") ", ")
243 (list (normalize "refsect1") ".")
244 (list (normalize "refsect2") ".")
245 (list (normalize "refsect3") ".")
246 (list (normalize "sect1") ".")
247 (list (normalize "sect2") ".")
248 (list (normalize "sect3") ".")
249 (list (normalize "sect4") ".")
250 (list (normalize "sect5") ".")
251 (list (normalize "section") ".")
252 (list (normalize "simplesect") ".")
253 (list (normalize "step") ".")
254 (list (normalize "table") "-")
255 (list (normalize "_pagenumber") "-")
258 (define (gentext-nl-intra-label-sep gind)
259 (let* ((giname (if (string? gind) gind (gi gind)))
260 (name (normalize giname))
261 (lsep (assoc name (local-nl-intra-label-sep)))
262 (sep (assoc name (nl-intra-label-sep))))
269 ;; gentext-label-title-sep returns the seperator to be inserted
270 ;; between a label and the text following the label for the
271 ;; specified element. Most of these are for use between
272 ;; enumerated labels and titles like "1. Chapter One Title", but
273 ;; this function is used elsewhere (e.g. NOTE) with a little
277 (define (local-nl-label-title-sep)
280 (define (nl-label-title-sep)
282 (list (normalize "abstract") ": ")
283 (list (normalize "answer") " ")
284 (list (normalize "appendix") ". ")
285 (list (normalize "caution") "")
286 (list (normalize "chapter") ". ")
287 (list (normalize "equation") ". ")
288 (list (normalize "example") ". ")
289 (list (normalize "figure") ". ")
290 (list (normalize "footnote") ". ")
291 (list (normalize "glosssee") ": ")
292 (list (normalize "glossseealso") ": ")
293 (list (normalize "important") ": ")
294 (list (normalize "note") ": ")
295 (list (normalize "orderedlist") ". ")
296 (list (normalize "part") ". ")
297 (list (normalize "procedure") ". ")
298 (list (normalize "prefix") ". ")
299 (list (normalize "question") " ")
300 (list (normalize "refentry") "")
301 (list (normalize "reference") ". ")
302 (list (normalize "refsect1") ". ")
303 (list (normalize "refsect2") ". ")
304 (list (normalize "refsect3") ". ")
305 (list (normalize "sect1") ". ")
306 (list (normalize "sect2") ". ")
307 (list (normalize "sect3") ". ")
308 (list (normalize "sect4") ". ")
309 (list (normalize "sect5") ". ")
310 (list (normalize "section") ". ")
311 (list (normalize "simplesect") ". ")
312 (list (normalize "seeie") " ")
313 (list (normalize "seealsoie") " ")
314 (list (normalize "step") ". ")
315 (list (normalize "table") ". ")
316 (list (normalize "tip") ": ")
317 (list (normalize "warning") "")
320 (define (gentext-nl-label-title-sep gind)
321 (let* ((giname (if (string? gind) gind (gi gind)))
322 (name (normalize giname))
323 (lsep (assoc name (local-nl-label-title-sep)))
324 (sep (assoc name (nl-label-title-sep))))
331 (define (nl-label-number-format-list)
333 (list (normalize "set") "1")
334 (list (normalize "book") "1")
335 (list (normalize "prefix") "1")
336 (list (normalize "part") "I")
337 (list (normalize "chapter") "1")
338 (list (normalize "appendix") "A")
339 (list (normalize "reference") "I")
340 (list (normalize "example") "1")
341 (list (normalize "figure") "1")
342 (list (normalize "table") "1")
343 (list (normalize "procedure") "1")
344 (list (normalize "step") "1")
345 (list (normalize "refsect1") "1")
346 (list (normalize "refsect2") "1")
347 (list (normalize "refsect3") "1")
348 (list (normalize "sect1") "1")
349 (list (normalize "sect2") "1")
350 (list (normalize "sect3") "1")
351 (list (normalize "sect4") "1")
352 (list (normalize "sect5") "1")
353 (list (normalize "section") "1")
356 (define (nl-label-number-format gind)
357 (let* ((giname (if (string? gind) gind (gi gind)))
358 (name (normalize giname))
359 (format (assoc name (nl-label-number-format-list))))
364 (define (nl-lot-title)
366 (list (normalize "table") "&ListofTables;")
367 (list (normalize "example") "&ListofExamples;")
368 (list (normalize "figure") "&ListofFigures;")
369 (list (normalize "equation") "&ListofEquations;")
372 (define ($lot-title-nl$ gind)
373 (let* ((giname (if (string? gind) gind (gi gind)))
374 (name (normalize giname))
375 (title (assoc name (nl-lot-title))))
378 (let* ((msg (string-append "&ListofUnknown;: " name))
379 (err (node-list-error msg (current-node))))
382 (define %gentext-nl-start-quote% (dingbat "ldquo"))
384 (define %gentext-nl-end-quote% (dingbat "rdquo"))
386 (define %gentext-nl-start-nested-quote% (dingbat "lsquo"))
388 (define %gentext-nl-end-nested-quote% (dingbat "rsquo"))
390 (define %gentext-nl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
391 ;; Authored "by" Jane Doe
393 (define %gentext-nl-edited-by% "&Editedby;")
394 ;; "Edited by" Jane Doe
396 (define %gentext-nl-revised-by% "&Revisedby;")
397 ;; "Revised by" Jane Doe
399 (define %gentext-nl-page% "")
401 (define %gentext-nl-and% "∧")
403 (define %gentext-nl-listcomma% "&listcomma;")
405 (define %gentext-nl-lastlistcomma% "&lastlistcomma;")
407 (define %gentext-nl-bibl-pages% "&Pgs;")
409 (define %gentext-nl-endnotes% "&Notes;")
411 (define %gentext-nl-table-endnotes% "&TableNotes;:")
413 (define %gentext-nl-index-see% "&See;")
415 (define %gentext-nl-index-seealso% "&SeeAlso;")
418 (define (gentext-nl-nav-prev prev)
419 (make sequence (literal "&nav-prev;")))
421 (define (gentext-nl-nav-prev-sibling prevsib)
422 (make sequence (literal "&nav-prev-sibling;")))
424 (define (gentext-nl-nav-next-sibling nextsib)
425 (make sequence (literal "&nav-next-sibling;")))
427 (define (gentext-nl-nav-next next)
428 (make sequence (literal "&nav-next;")))
430 (define (gentext-nl-nav-up up)
431 (make sequence (literal "&nav-up;")))
433 (define (gentext-nl-nav-home home)
434 (make sequence (literal "&nav-home;")))
438 </style-specification-body>
439 </style-specification>