docbook-apps

  • 1.  How to create sidebars for epub3?

    Posted 10-12-2012 13:24
    Hi,

    I do have an ebook that is written in docbook and delivered as PDF.
    So far I have refrained from shipping epub/mobi as they had no sidebars, but
    now with epub3 and KF8, that should work I thought. But I seem to be missing
    something.

    So far sidebars show up smack in the middle (I use the firefox epub
    extension for testing).

    This is how they look like in the XML source:
    <sidebar>
    <informalfigure>
    <mediaobject>
    <imageobject>
    <imagedata fileref="images/WB-presets.jpg" format="JPG"
    width="100%" scalefit="1" align="inside" />
    </imageobject>
    </mediaobject>
    </informalfigure>
    </sidebar>

    This is what I see in the epub:


  • 2.  RE: [docbook-apps] How to create sidebars for epub3?

    Posted 10-12-2012 14:10
    I haven't yet tried working with epub3, but I've done a lot of work with epub 2 and mobi/kf8. In order to place a proper sidebar, you need to check your CSS. DocBook will generate the appropriate sidebar div, but you need CSS to place it.

    I've done several sidebars in epub 2, using the float property. It also works in KF8. You cannot float to the side in mobi, but you can center align a sidebar between paragraphs.

    Here's sample CSS I use for a simple sidebar that actually floats to the side. You can also do further manipulate of borders, etc as needed.

    div.sidebar{
    margin:0em .8em 0em 0em;
    padding-top:.3em;
    width:10em;
    float:left;
    position:relative;
    }
    ________________________________________
    From: Andreas F.X. Siegert [afx@afximages.com]
    Sent: Friday, October 12, 2012 8:24 AM
    To: docbook-apps@lists.oasis-open.org
    Subject: [docbook-apps] How to create sidebars for epub3?

    Hi,

    I do have an ebook that is written in docbook and delivered as PDF.
    So far I have refrained from shipping epub/mobi as they had no sidebars, but
    now with epub3 and KF8, that should work I thought. But I seem to be missing
    something.

    So far sidebars show up smack in the middle (I use the firefox epub
    extension for testing).

    This is how they look like in the XML source:
    <sidebar>
    <informalfigure>
    <mediaobject>
    <imageobject>
    <imagedata fileref="images/WB-presets.jpg" format="JPG"
    width="100%" scalefit="1" align="inside" />
    </imageobject>
    </mediaobject>
    </informalfigure>
    </sidebar>

    This is what I see in the epub:


  • 3.  Re: [docbook-apps] How to create sidebars for epub3?

    Posted 10-12-2012 14:43
    on 12.10.2012 16:09 Jason Zech said the following:
    > I haven't yet tried working with epub3, but I've done a lot of work with
    > epub 2 and mobi/kf8. In order to place a proper sidebar, you need to check
    > your CSS. DocBook will generate the appropriate sidebar div, but you need
    > CSS to place it.

    Thanks Jason, your example put me on the right track for the sidebars!

    That lead me to believe for regular figures I could use
    div.figure-title{
    text-align: center;
    }
    But I seem to be on the wrong track here ;-(

    >
    > I've done several sidebars in epub 2, using the float property. It also
    > works in KF8. You cannot float to the side in mobi, but you can center align
    > a sidebar between paragraphs.
    Yuck.
    I thought real sidebars was one of the main features of KF8.
    Drat. I have quite a lot of sidebars in that book and having them as
    centered images will suck major.

    Looks like I will still only offer PDF ;-(

    cheers
    afx

    >
    > Here's sample CSS I use for a simple sidebar that actually floats to the
    side. You can also do further manipulate of borders, etc as needed.
    >
    > div.sidebar{
    > margin:0em .8em 0em 0em;
    > padding-top:.3em;
    > width:10em;
    > float:left;
    > position:relative;
    > }
    > ________________________________________
    > From: Andreas F.X. Siegert [afx@afximages.com]
    > Sent: Friday, October 12, 2012 8:24 AM
    > To: docbook-apps@lists.oasis-open.org
    > Subject: [docbook-apps] How to create sidebars for epub3?
    >
    > Hi,
    >
    > I do have an ebook that is written in docbook and delivered as PDF.
    > So far I have refrained from shipping epub/mobi as they had no sidebars, but
    > now with epub3 and KF8, that should work I thought. But I seem to be missing
    > something.
    >
    > So far sidebars show up smack in the middle (I use the firefox epub
    > extension for testing).
    >
    > This is how they look like in the XML source:
    > <sidebar>
    > <informalfigure>
    > <mediaobject>
    > <imageobject>
    > <imagedata fileref="images/WB-presets.jpg" format="JPG"
    > width="100%" scalefit="1" align="inside" />
    > </imageobject>
    > </mediaobject>
    > </informalfigure>
    > </sidebar>
    >
    > This is what I see in the epub:
    >


  • 4.  RE: [docbook-apps] How to create sidebars for epub3?

    Posted 10-12-2012 15:10
    Just to be clear: you can float a sidebar to the side in KF8 just as in epub. But on older Amazon devices that don't support KF8, it won't work. It's beastly, but a KF8 file has to be built to degrade into the mobi7 format on older non-KF8 devices. A mobi file generated via KindleGen is actually 2 bundled files--KF8 and mobi7 (the older file format). If a device cannot read KF8, it will read the mobi7 file in there. When you write your CSS before using KindleGen, you have to use something like media-queries to account for both file types, since they have different levels of CSS support. Or just test for acceptable degradation.

    If you don't care about users of older non-KF8 devices, you can ignore that and just style for KF8. It's not an unreasonable decision, depending on your audience. And over time, the feasibility of abandoning mobi7 development entirely will increase.

    Hope that helps.
    ________________________________________
    From: Andreas F.X. Siegert [afx@afximages.com]
    Sent: Friday, October 12, 2012 9:43 AM
    To: docbook-apps@lists.oasis-open.org
    Subject: Re: [docbook-apps] How to create sidebars for epub3?

    on 12.10.2012 16:09 Jason Zech said the following:
    > I haven't yet tried working with epub3, but I've done a lot of work with
    > epub 2 and mobi/kf8. In order to place a proper sidebar, you need to check
    > your CSS. DocBook will generate the appropriate sidebar div, but you need
    > CSS to place it.

    Thanks Jason, your example put me on the right track for the sidebars!

    That lead me to believe for regular figures I could use
    div.figure-title{
    text-align: center;
    }
    But I seem to be on the wrong track here ;-(

    >
    > I've done several sidebars in epub 2, using the float property. It also
    > works in KF8. You cannot float to the side in mobi, but you can center align
    > a sidebar between paragraphs.
    Yuck.
    I thought real sidebars was one of the main features of KF8.
    Drat. I have quite a lot of sidebars in that book and having them as
    centered images will suck major.

    Looks like I will still only offer PDF ;-(

    cheers
    afx

    >
    > Here's sample CSS I use for a simple sidebar that actually floats to the
    side. You can also do further manipulate of borders, etc as needed.
    >
    > div.sidebar{
    > margin:0em .8em 0em 0em;
    > padding-top:.3em;
    > width:10em;
    > float:left;
    > position:relative;
    > }
    > ________________________________________
    > From: Andreas F.X. Siegert [afx@afximages.com]
    > Sent: Friday, October 12, 2012 8:24 AM
    > To: docbook-apps@lists.oasis-open.org
    > Subject: [docbook-apps] How to create sidebars for epub3?
    >
    > Hi,
    >
    > I do have an ebook that is written in docbook and delivered as PDF.
    > So far I have refrained from shipping epub/mobi as they had no sidebars, but
    > now with epub3 and KF8, that should work I thought. But I seem to be missing
    > something.
    >
    > So far sidebars show up smack in the middle (I use the firefox epub
    > extension for testing).
    >
    > This is how they look like in the XML source:
    > <sidebar>
    > <informalfigure>
    > <mediaobject>
    > <imageobject>
    > <imagedata fileref="images/WB-presets.jpg" format="JPG"
    > width="100%" scalefit="1" align="inside" />
    > </imageobject>
    > </mediaobject>
    > </informalfigure>
    > </sidebar>
    >
    > This is what I see in the epub:
    >


  • 5.  Re: [docbook-apps] How to create sidebars for epub3?

    Posted 10-13-2012 20:33
    on 12.10.2012 17:10 Jason Zech said the following:
    > Just to be clear: you can float a sidebar to the side in KF8 just as in
    > epub. But on older Amazon devices that don't support KF8, it won't work.

    So Amazon does not provide firmware updates for pre-fire devices?
    Yuck.

    Thanks for all the pointers, I could move a few steps forward, into new
    problems. Currently googling for solutions.

    cheers
    afx
    --
    http://afximages.com/