mw@miwie.in-berlin.de
Copyright © 2001, 2002 by Michael Wiedmann
| Revision History | ||
|---|---|---|
| Revision 0.0.18 | 2002-01-26 | |
Legal Notice
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no invariant sections, with no Front-Cover texts and no Back-Cover Texts.
Abstract
During the past few months I noticed that many questions on DocBook ML are repeated again and again. So it looks for me like it is really necessary to collect all these questions and the corresponding answers and make them publicly available to new DocBook users.
Because the whole thing is about DocBook some members of the DocBook ML suggested to use DocBook's QandASet for this purpose. Quoting Nik Clayton: "so that there's one more example of good DocBook markup available for people to copy from."
I began to collect these questions and answers on 2001-04-20 and made this FAQ publicly accessible at http://www.miwie.org/docbook-dsssl-faq.html.
DocBook users are encouraged to email their questions (and hopefully the corresponding answers as well) to me so that this FAQ will grow and become more valuable for all of us.
A: In chapter 4 of DocBook; TDG you'll find a section covering this topic.
In short: write your own driver file, e.g.:
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY html-ss
PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
<!ENTITY print-ss
PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
]>
<style-sheet>
<style-specification id="print" use="print-stylesheet">
<style-specification-body>
;; customize the print stylesheet
</style-specification-body>
</style-specification>
<style-specification id="html" use="html-stylesheet">
<style-specification-body>
;; customize the html stylesheet
</style-specification-body>
</style-specification>
<external-specification id="print-stylesheet" document="print-ss">
<external-specification id="html-stylesheet" document="html-ss">
</style-sheet>
and use this stylesheet file for processing your
source file with (open)jade (providing the stylesheet
pathname as a command line option like -d ./mystyle.dsl). Choose the
corresponding part for HTML or print output by
setting the variable print
or html using the command
line option -i (e.g. -i print). A: Add the following to your customization stylesheet:
(element imagedata
(if (have-ancestor? (normalize "mediaobject"))
($img$ (current-node) #t)
($img$ (current-node) #f)))
(This is a bug in the default stylesheets which
will be resolved in the near future)A: There are for sure many possible solutions, but most people would like to try convert from the ImageMagick package.
A: Very short description:
Mark your entries for the index using the DocBook tags <indexterm>, <primary>, etc.
Generate an empty index file using collateindex.pl -N.
Generate the raw index data using (open)jade with the option -V html-index.
Process the raw index data usaing a command like collateindex.pl -o index.sgml HTML.index.
Include this generated index file in your SGML source file, e.g. using an external entity:
<!DOCTYPE article ....
<!entity index SYSTEM "index.sgml">
]>
and put the following line at the place you
want the index to appear in your document:
&index;
Generate the desired output format as usual.
A: In general you switch between chunked and nochunked output by setting the variable nochunks to #t or #f. This can be achieved in your customization stylesheet or simply by adding -V nochunks on the (open)jade command line.
A: The <emphasis> tag is rendered by the default HTML stylesheet as italic (<I>). If you want to change the appearance you have to do this in your customization layer. Jirka Kosek proposed the following solution recently on DocBook-Apps ML:
(element emphasis
(if (equal? (normalize "bold") (attribute-string (normalize "role")))
($bold-seq$)
($italic-seq$)))
This solution looks at the role
attribute and uses the <B> HTML tag to render
<emphasis> if this attribute is set to bold. A: The default styleheet files contain two files (for HTML and print output) named dbparam.dsl. Locate these files and look carefully over them. A few of the user customizable variables are mentioned below.
A: Set the following in your customization stylesheet:
(define %paper-type% "A4")
The default stylesheet sets this to "USletter".
A: Set the following in your customization stylesheet:
(define %default-quadding% 'justify)
(the default stylesheet sets this to 'start, which
means left-justified). A: Create a file jadetex.cfg in your working directory which looks like:
\hypersetup{pdftitle={Some Title},
pdfsubject={Some Subject},
pdfauthor={Some Author}
}
You should consult the documentation of hyperref.sty for a complete and
more detailled description of the possible
configuration options. A: Perform the following steps (works with at least V1.69 of the DSSSL stylesheets):
Use openjade to process your SGML file
Use a line like pdfpagemode=UseOutlines in your jadetex.cfg file (See How do I generate entries in the PDF Document Info? for the general layout of the file jadetex.cfg)
If you are writing a <book> include the following lines in your customization layer:
(declare-characteristic heading-level
"UNREGISTERED::James Clark//Characteristic::heading-level" 2)
If you are writing an <article> don't use these
lines.A: Use the following line in your jadetex.cfg file:
bookmarksopen=true
(See How do I generate
entries in the PDF Document Info? for the
general layout of the file jadetex.cfg) A: Use the following line in your jadetex.cfg file:
bookmarksopenlevel=level
and choose an appropriate value for level (See How do I generate entries in the
PDF Document Info? for the general layout
of the file jadetex.cfg).
A: Use the following line in your jadetex.cfg file:
colorlinks=true
(See How do I generate
entries in the PDF Document Info? for the
general layout of the file jadetex.cfg) A: Use the following line in your jadetex.cfg file:
linkcolor=blue
and choose an appropriate value for linkcolor. For this to work you
have to set colorlinks=true too (and remember
that entries in jadetex.cfg have to be comma
separated - not white space separated! See How do I generate entries in the
PDF Document Info? for the general layout
of the file jadetex.cfg).
A: The file jadetex.cfg can contain TeX code, so one possible solution is to specify the words you wish to hyphenate in jadetex.cfg in a special way like:
\hyphenation{hyph-enate-me}
(See How do I generate
entries in the PDF Document Info? for the
general layout of the file jadetex.cfg). A: Set the following in your customization stylesheet:
(define %two-side% #t)
(this is set already in the default stylesheet
files).A: Use ulink and read the paper Correcting page make-up problems in SGML-based documentation which describes some very useful customization techniques used by Mandrake.
A: If you want to support AportisDoc convert your SGML source file to TXT first and convert with a command like: makedoc DOCUMENT.txt DOCUMENT.prc
If you want to support iSilo convert your SGML source file to HTML first and convert with a command like: iSilo386 -y -d0 -Idef DOCUMENT.html DOCUMENT.pdb
Carsten Wartmann pointed me to the following tools, which can convert TXT/HTML files to PalmPilot DOC format: txt2pdbdoc and html2pdbtxt.
A: Many places, e.g.:
Searchable archive of the DocBook-Apps ML: http://sources.redhat.com/ml/docbook-apps/
A: Mark Johnson posted among others the following links recently on DocBook-Apps ML:
"The Gnome Documentation Project manual has links to templates you might find useful": http://developer.gnome.org/projects/gdp/handbook/gdp-handbook/templates.html
Selfdocbook: http://people.redhat.com/twaugh/docbook/selfdocbook/selfdocbook.html
Nik Clayton contributed the following examples:
"All the FreeBSD documentation is in DocBook": http://www.freebsd.org/docs.html
"The contents of http://www.freebsd.org/doc/en_US.ISO_8859-1/books/fdp-primer/ should also be very useful to you (in particular, section 4.2)."
Dave Brooks pointed me to the DSSSL customization files of the FreeBSD Documentation Project:
Dan York contributed the following examples:
"Our (e-smith) user manual (done as a DocBook 'book) is available in DocBook SGML as well as HTML and PDF at:" http://www.e-smith.org/docs/manual/
"Also, the Linux Documentation Project makes available DocBook SGML versions of most all of the HOWTO docs:" http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/docbook/
Dave Pawson maintains the DocBook FAQ:
The following people have contributed substantial parts to this document:
Dave Brooks
Nik Clayton
Mark Johnson
Jirka Kosek
Dave Pawson
Richard Sharpe
Norman Walsh
Carsten Wartmann
Dan York
This document was processed using the following tools:
DocBook V4.1
OpenJade V1.3
DocBook DSSSL Stylesheets V1.74-b1 (customized)