This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: How do you %indent-programlisting-lines for anexternal file?
- To: Brian Dellert <aspider at pobox dot com>
- Subject: Re: DOCBOOK-APPS: How do you %indent-programlisting-lines for anexternal file?
- From: Lane Stevens <lane at cycletime dot com>
- Date: Tue, 29 May 2001 08:12:01 -0600
- Cc: docbook-apps at lists dot oasis-open dot org
- Organization: Terrapin Technologies, Inc.
- References: <20010528183607.A689@localhost>
On Mon, May 28, 2001 at 06:36:07PM -0500, Brian Dellert wrote:
> 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:
>
How about defining an entity that references the source file? I have not
tried this, but I believe that it will work.
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!ENTITY programFile SYSTEM "./source.pl">
]>
...
<programlisting>
&programFile;
</programlisting>
Thanks,
Lane.
--
Lane Stevens
Terrapin Technologies, Inc.
http://www.cycletime.com
------------------------------------------------------------------
To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: docbook-apps-request@lists.oasis-open.org