This is the mail archive of the docbook@lists.oasis-open.org mailing list for the DocBook project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [docbook] <programlisting> customization


Also, I would like to add that I am using DocBook 1.67.2 XSL and XEP 4.1 to
generate PDF.

Here is the snapshot of XSL-FO generated by DocBook. 

<fo:table border-before-width.conditionality="retain"
border-collapse="collapse" border-left-style="solid"
border-right-style="solid" border-top-style="solid"
border-bottom-style="solid" border-left-width="0.5pt"
border-right-width="0.5pt" border-top-width="0.5pt"
border-bottom-width="0.5pt" border-left-color="black"
border-right-color="black" border-top-color="black"
border-bottom-color="black" width="100%">
<fo:table-column column-number="1" column-width="50%"/>
<fo:table-column column-number="2" column-width="50%"/>
	<fo:table-header>
	<fo:table-row>
	<fo:table-cell padding-left="2pt" padding-right="2pt"
padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt"
border-bottom-style="solid" border-bottom-color="black"
border-right-width="0.5pt" border-right-style="solid"
border-right-color="black" text-align="left">
	<fo:block font-weight="bold">
<fo:block space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em">Function</fo:block>
</fo:block>
</fo:table-cell>
	<fo:table-cell padding-left="2pt" padding-right="2pt"
padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt"
border-bottom-style="solid" border-bottom-color="black">
	<fo:block font-weight="bold">
<fo:block space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em">Description</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-row>
	<fo:table-cell padding-left="2pt" padding-right="2pt"
padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt"
border-bottom-style="solid" border-bottom-color="black"
border-right-width="0.5pt" border-right-style="solid"
border-right-color="black" text-align="left">
	<fo:block>
	<fo:block space-before.minimum="0.8em" space-before.optimum="1em"
space-before.maximum="1.2em" space-after.minimum="0.8em"
space-after.optimum="1em" space-after.maximum="1.2em" hyphenate="false"
font-family="TheSansMonoCondensed" text-align="start" wrap-option="no-wrap"
id="d0e13458" white-space-collapse="false" white-space-treatment="preserve"
linefeed-treatment="preserve">
<fo:inline font-style="italic">float cos(float arg)</fo:inline>
</fo:block>
</fo:block>
</fo:table-cell>
	<fo:table-cell padding-left="2pt" padding-right="2pt"
padding-top="2pt" padding-bottom="2pt" border-bottom-width="0.5pt"
border-bottom-style="solid" border-bottom-color="black">
	<fo:block>
	<fo:block space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em">
Cosine of 
<fo:inline font-style="italic">arg</fo:inline>
 in radians
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>


Thanks,
Hiral

-----Original Message-----
From: Hiral Parikh [mailto:hparikh@amesondemand.com] 
Sent: Tuesday, March 22, 2005 10:15 AM
To: docbook@lists.oasis-open.org
Subject: [docbook] <programlisting> customization

Hi all,
I have a <table> that has <programlisting> in one of the columns. 
Instead of both the columns being left aligned, the <programlisting> column
is 'centered' at page level because of which it overlaps the text in
column2.
I guess this is the default alignment of <programlisting>.

Can we do a customization such that when <programlisting> is enclosed in
<table> then use left alignment and also use different font size?

Following is a sample code:
           <table id="someid" label="1.1">
              <title>Sample table</title>
              <tgroup cols="2">
                 <colspec colnum="1" colname="col1"/>
                 <colspec colnum="2" colname="col2"/>
                 <thead>
                    <row>
                       <entry>
                          <para>Method</para>
                       </entry>
                       <entry>
                          <para>Description</para>
                       </entry>
                    </row>
                 </thead>
                 <tbody>
                    <row>
                       <entry>
                          <programlisting>
                             <emphasis>private void getMe()</emphasis>
                           </programlisting>
                        </entry>
                        <entry>
                           <para>gets me</para>
                        </entry>
                     </row>
                 </tbody>
              </tgroup>
           </table>


Thanks for your help in advance! 

Hiral





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]