docbook-apps

  • 1.  html5 align image right

    Posted 09-05-2013 11:16
    Hi all,

    Sorry if I'm doing something silly here.

    I have an inline image which I want right aligned in the html 5 output
    (I'm using Docbook 5.1 Article).

    Here's my docbook:

    <inlinemediaobject>
    <imageobject>
    <imagedata fileref="http://....jpg" contentwidth="200"
    align="right" format="jpg"></imagedata>
    </imageobject>
    </inlinemediaobject>

    With Oxygen it works fine producing this output:

    align="right" width="200"/>Some Text



    Though it uses /align/ rather than css.

    I prefer using xsltproc and am using docbook-xsl-ns-1.78.1 stylesheets.

    The same docbook code as above produces the following:

    src="http://....jpg" width="200"/>Some Text



    However the image is not being aligned to the right. Am I doing
    something wrong?

    Peter<skype:peterfleck?call>




  • 2.  Re: [docbook-apps] html5 align image right

    Posted 09-05-2013 14:05
    Hi Peter,

    On Do, 2013-09-05 at 13:15 +0200, Peter Fleck wrote:
    >

    > src="http://....jpg" width="200"/>Some Text


    >
    > However the image is not being aligned to the right. Am I doing
    > something wrong?

    Well, it's called "text-align" for a reason. :)
    You may want to try with "float: right;", but that has its own quirks,
    of course. See https://developer.mozilla.org/en-US/docs/Web/CSS/float

    Stefan.

    --
    SUSE LINUX GmbH, Maxfeldstraße 5, D-90409 Nürnberg
    Geschäftsführer: Jeff Hawn, Jennifer Guild, Felix Imendörffer
    HRB 21284 (AG Nürnberg)



  • 3.  Re: [docbook-apps] html5 align image right

    Posted 09-05-2013 15:57
    Thanks Stefan - that worked when I changed the html manually.

    How do I get the stylesheet to create it with float rather than
    "text-align" without me having to manually change the html?

    Peter


    On 05/09/13 16:04, Stefan Knorr wrote:
    > Hi Peter,
    >
    > On Do, 2013-09-05 at 13:15 +0200, Peter Fleck wrote:
    >>

    >> src="http://....jpg" width="200"/>Some Text


    >>
    >> However the image is not being aligned to the right. Am I doing
    >> something wrong?
    > Well, it's called "text-align" for a reason. :)
    > You may want to try with "float: right;", but that has its own quirks,
    > of course. See https://developer.mozilla.org/en-US/docs/Web/CSS/float
    >
    > Stefan.
    >





  • 4.  Re: [docbook-apps] html5 align image right

    Posted 09-05-2013 16:39
    Well, if you are going to float it, it should not be an inlinemediaobject, which is intended to appear inline. You could instead use this in your source file:

    <informalfigure floatstyle="right">
    <mediaobject>
    <imageobject>
    <imagedata ...>
    <imageobject>
    <mediaobject>
    </informalfigure>
    <para>Some Text</para>

    The informalfigure wrapper lets you add a floatstyle attribute, without adding a title.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    From: Peter Fleck
    Sent: Thursday, September 05, 2013 8:56 AM
    To: Stefan Knorr
    Cc: docbook-apps@lists.oasis-open.org
    Subject: Re: [docbook-apps] html5 align image right


    Thanks Stefan - that worked when I changed the html manually.

    How do I get the stylesheet to create it with float rather than "text-align" without me having to manually change the html?

    Peter




    On 05/09/13 16:04, Stefan Knorr wrote:

    Hi Peter,

    On Do, 2013-09-05 at 13:15 +0200, Peter Fleck wrote:

    src="http://....jpg" width="200"/>Some Text



    However the image is not being aligned to the right. Am I doing
    something wrong?
    Well, it's called "text-align" for a reason. :)
    You may want to try with "float: right;", but that has its own quirks,
    of course. See https://developer.mozilla.org/en-US/docs/Web/CSS/float

    Stefan.






  • 5.  Re: [docbook-apps] html5 align image right

    Posted 09-05-2013 16:45
    Ah, perfect. That was what I was wanting. Many thanks.

    Peter

    On 05/09/13 18:39, Bob Stayton wrote:
    > Well, if you are going to float it, it should not be an
    > inlinemediaobject, which is intended to appear inline. You could
    > instead use this in your source file:
    > <informalfigure floatstyle="right">
    > <mediaobject>
    > <imageobject>
    > <imagedata ...>
    > <imageobject>
    > <mediaobject>
    > </informalfigure>
    > <para>Some Text</para>
    > The informalfigure wrapper lets you add a floatstyle attribute,
    > without adding a title.
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net <mailto:bobs@sagehill.net>
    >
    > *From:* Peter Fleck <mailto:peterfleck@gmail.com>
    > *Sent:* Thursday, September 05, 2013 8:56 AM
    > *To:* Stefan Knorr <mailto:sknorr@suse.de>
    > *Cc:* docbook-apps@lists.oasis-open.org
    > <mailto:docbook-apps@lists.oasis-open.org>
    > *Subject:* Re: [docbook-apps] html5 align image right
    >
    > Thanks Stefan - that worked when I changed the html manually.
    >
    > How do I get the stylesheet to create it with float rather than
    > "text-align" without me having to manually change the html?
    >
    > Peter
    >
    >
    > On 05/09/13 16:04, Stefan Knorr wrote:
    >> Hi Peter,
    >>
    >> On Do, 2013-09-05 at 13:15 +0200, Peter Fleck wrote:
    >>>

    >>> src="http://....jpg" width="200"/>Some Text


    >>>
    >>> However the image is not being aligned to the right. Am I doing
    >>> something wrong?
    >> Well, it's called "text-align" for a reason. :)
    >> You may want to try with "float: right;", but that has its own quirks,
    >> of course. Seehttps://developer.mozilla.org/en-US/docs/Web/CSS/float
    >>
    >> Stefan.
    >>
    >
    >