This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
How do you %indent-programlisting-lines for an externalfile?
- To: docbook-apps at lists dot oasis-open dot org
- Subject: DOCBOOK-APPS: How do you %indent-programlisting-lines for an externalfile?
- From: Brian Dellert <aspider at pobox dot com>
- Date: Mon, 28 May 2001 18:36:07 -0500
When I convert my docbook to PDF, I want to have all the lines in
<programlisting> blocks indented 8 spaces. To do this, I added this
line to my custom stylesheet.
(define %indent-programlisting-lines% " ")
This works fine if the <programlisting> is embedded in the sgml, like
this:
<programlisting>
#!/usr/bin/perl
print "Hello ";
print "World\n";
</programlisting>
However, it doesn't work if the <programlisting> comes from an
external file, like the following. Instead of indenting all the lines,
only the *first* line of the file "source.pl" gets indented.
<programlisting><inlinegraphic format='linespecific' fileref='source.pl'></inlinegraphic></programlisting>
Any ideas? I've attached sample files. To convert them, I run:
$ jade -t tex -d indent.dsl indent.sgml
$ pdfjadetex indent.tex
Thanks,
Brian
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook V3.1//EN" >
<sect1>
<title>Test Indent</title>
<example>
<title>Listing included from external source</title>
<programlisting><inlinegraphic format='linespecific' fileref='source.pl'></inlinegraphic></programlisting>
</example>
<example>
<title>Listing embedded in sgml file</title>
<programlisting>
#!/usr/bin/perl
print "Hello ";
print "World\n";
</programlisting>
</example>
</sect1>
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA DSSSL>
]>
<style-sheet>
<style-specification use="docbook">
<style-specification-body>
;; $Id: plain.dsl,v 1.2 2000/09/28 12:50:20 ndw Exp $
;;
;; This file is part of the Modular DocBook Stylesheet distribution.
;; See ../README or http://www.berkshire.net/~norm/dsssl/
;;
;; Example of a customization layer on top of the modular docbook style
;; sheet. Definitions inserted in this file take precedence over
;; definitions in the 'use'd stylesheet(s).
(define %indent-programlisting-lines% " ")
</style-specification-body>
</style-specification>
<external-specification id="docbook" document="docbook.dsl">
</style-sheet>
Perl program