Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#11 Centering images in html output

open
nobody
None
5
2014-08-12
2002-03-20
Josef Karthauser
No

There appear to be some inconsistancies in the way that images are
centered between the tex/pdf output and html output. (I'm using
openjade and the 4.1 docbook and dsssl stylesheets).

Here's an
example:

<sidebar>
<para>
<graphic align="center"
fileref="some_image_file">
Some text.
</para>

</sidebar>

The tex/pdf output has the image centered as
expected, but the html
produced looks like this:

<div
class="SIDEBAR">
<a name="AEN6"></a>
<p
align="justify"></p>
<p><img src="some_image_file"
align="CENTER"></p>
Some text
<br>
<br>
</div>

It should
look like this:

<div class="SIDEBAR">
<a name="AEN6"></a>

<p align="justify"></p>
<p align="center"><img
src="some_image_file"></p>
Some text
<br>
<br>

</div>

i.e. the align should be on the <p> element, not the <img>
element.

Is this easily fixed?

Also the same is true of
mediaobjects.

<para>
<mediaobject> <imageobject>
<imagedata align="center" fileref="some_image_file">

</imageobject> </mediaobject>
</para>

The html output
is:

<p align="justify"><img src="some_image_file"
align="CENTER"></p>

Shouldn't this be:

<p
align="center"><img src="some_image_file"></p>

Also if
the media object is in a figure like:

<para> <figure> <title>
Some figure </title>
<mediaobject> <imageobject> <imagedata
align="center" fileref="some_image_file">
</imageobject>
</mediaobject> </figure> </para>

The html is:
<div
class="FIGURE">
<a name="FIG2.1B"></a>

<p><b>Figure 1-1.
The origin is numerically zero</b></p>
<img
src="chapter2/cartesian_frame_of_reference.png"

align="CENTER">
</div>

Shouldn't this be:

<div
class="FIGURE">
<a name="FIG2.1B"></a>

<p><b>Figure 1-1.
The origin is numerically zero</b></p>
<p
align="CENTER"><img
src="chapter2/cartesian_frame_of_reference.png"></p>

</divť

I'd be very grateful for hints to fix so, so that my html
output is closer to the way that the pdfs render.

Discussion

  • Adam Di Carlo
    Adam Di Carlo
    2002-12-15

    Logged In: YES
    user_id=18375

    I agree but its a little tricky. If the imagedata is
    centered, we need
    to propogate up that centering to show on the caption if
    any, on the figure
    title if any.

     
    • milestone: --> 447636
     
    • milestone: 447636 --> 447634
     
  • Robert Stayton
    Robert Stayton
    2009-04-27

    • labels: 321158 -->
    • milestone: 447634 -->