docbook-apps

  • 1.  page numbers are not right aligned

    Posted 11-25-2018 18:03
      |   view attached
    As can be seen from the screenshot, the composed page-numbers are not
    right aligned. Where do I have to look (adjust) that this will take place?

    Regards

    Bernhard

    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    -
    thunderbird mit enigmail
    GPG schlüssel: D5257409
    fingerprint:
    08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09




  • 2.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-26-2018 04:36
      |   view attached
    I don't think there is anything wrong the the fo coding by the
    stylesheet.  Here is a similar report for the DITA Open Toolkit on the
    fop-users mailing list:

    http://apache-fop.1065347.n5.nabble.com/White-space-in-FO-causes-PDF-TOC-problem-td46410.html

    It isn't clear that your problem is caused by whitespace around the
    title.  Your misaligned entries all seem to have short dot leaders.  But
    it seems the fop algorithm has a problem with right alignments with dot
    leaders.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 11/25/2018 10:03 AM, Bernhard Kleine wrote:
    >
    > As can be seen from the screenshot, the composed page-numbers are not
    > right aligned. Where do I have to look (adjust) that this will take place?
    >
    > Regards
    >
    > Bernhard
    >
    > --
    > spitzhalde9
    > D-79853 lenzkirch
    > bernhard.kleine@gmx.net
    > www.b-kleine.com,www.urseetal.net
    > -
    > thunderbird mit enigmail
    > GPG schlüssel: D5257409
    > fingerprint:
    > 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09



  • 3.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-26-2018 08:20
      |   view attached
    Hi Bob,

    Unfortunately the case you cite is not applicable in my example. I
    looked for the spacing e.g. for this line:

    <sect1 xml:id="hesperiidaeHaeufigkeit" xreflabel="Die Häufigkeit der
    Hesperiidae">
               

    There is not any extra space in the coding nor is there an unusual
    whitespace. IMHO I see these irregularities only when the leader is very
    short. Maybe one get rid of the leader dots. But I have not found it in
    your book.

    Regards

    Bernhard

    Am 26.11.2018 um 05:35 schrieb Bob Stayton:
    >
    > I don't think there is anything wrong the the fo coding by the
    > stylesheet.  Here is a similar report for the DITA Open Toolkit on the
    > fop-users mailing list:
    >
    > http://apache-fop.1065347.n5.nabble.com/White-space-in-FO-causes-PDF-TOC-problem-td46410.html
    >
    > It isn't clear that your problem is caused by whitespace around the
    > title.  Your misaligned entries all seem to have short dot leaders. 
    > But it seems the fop algorithm has a problem with right alignments
    > with dot leaders.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    > On 11/25/2018 10:03 AM, Bernhard Kleine wrote:
    >>
    >> As can be seen from the screenshot, the composed page-numbers are not
    >> right aligned. Where do I have to look (adjust) that this will take
    >> place?
    >>
    >> Regards
    >>
    >> Bernhard
    >>
    >> --
    >> spitzhalde9
    >> D-79853 lenzkirch
    >> bernhard.kleine@gmx.net
    >> www.b-kleine.com, www.urseetal.net
    >> -
    >> thunderbird mit enigmail
    >> GPG schlüssel: D5257409
    >> fingerprint:
    >> 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09

    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    -
    thunderbird mit enigmail
    GPG schlüssel: D5257409
    fingerprint:
    08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09


    </sect1>


  • 4.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-26-2018 16:36
      |   view attached
    The more general case with dot leaders and right alignment is an
    inresolved FOP bug:

    https://issues.apache.org/jira/browse/FOP-1839

    The section on customizing table of contents entries is here:

    http://www.sagehill.net/docbookxsl/PrintToc.html#PrintTocEntries

    The template named 'toc.line' generates an <fo:leader> element that
    produces the dot leaders.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 11/26/2018 12:19 AM, Bernhard Kleine wrote:
    >
    > Hi Bob,
    >
    > Unfortunately the case you cite is not applicable in my example. I
    > looked for the spacing e.g. for this line:
    >
    > <sect1 xml:id="hesperiidaeHaeufigkeit" xreflabel="Die Häufigkeit der
    > Hesperiidae">
    >            
    >
    > There is not any extra space in the coding nor is there an unusual
    > whitespace. IMHO I see these irregularities only when the leader is
    > very short. Maybe one get rid of the leader dots. But I have not found
    > it in your book.
    >
    > Regards
    >
    > Bernhard
    >
    > Am 26.11.2018 um 05:35 schrieb Bob Stayton:
    >>
    >> I don't think there is anything wrong the the fo coding by the
    >> stylesheet.  Here is a similar report for the DITA Open Toolkit on
    >> the fop-users mailing list:
    >>
    >> http://apache-fop.1065347.n5.nabble.com/White-space-in-FO-causes-PDF-TOC-problem-td46410.html
    >>
    >> It isn't clear that your problem is caused by whitespace around the
    >> title.  Your misaligned entries all seem to have short dot leaders. 
    >> But it seems the fop algorithm has a problem with right alignments
    >> with dot leaders.
    >>
    >> Bob Stayton
    >> Sagehill Enterprises
    >> bobs@sagehill.net
    >> On 11/25/2018 10:03 AM, Bernhard Kleine wrote:
    >>>
    >>> As can be seen from the screenshot, the composed page-numbers are
    >>> not right aligned. Where do I have to look (adjust) that this will
    >>> take place?
    >>>
    >>> Regards
    >>>
    >>> Bernhard
    >>>
    >>> --
    >>> spitzhalde9
    >>> D-79853 lenzkirch
    >>> bernhard.kleine@gmx.net
    >>> www.b-kleine.com,www.urseetal.net
    >>> -
    >>> thunderbird mit enigmail
    >>> GPG schlüssel: D5257409
    >>> fingerprint:
    >>> 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09
    > --
    > spitzhalde9
    > D-79853 lenzkirch
    > bernhard.kleine@gmx.net
    > www.b-kleine.com,www.urseetal.net
    > -
    > thunderbird mit enigmail
    > GPG schlüssel: D5257409
    > fingerprint:
    > 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09

    </sect1></fo:leader>


  • 5.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-26-2018 21:21
      |   view attached
    I have changed the "dots" to space. this aligned everything but this
    line in the TOC:

    <sect2>
                   
               

    Obviously no whitespace involved. Maybe you have an idea.

    Regards

    Bernhard


    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    -
    thunderbird mit enigmail
    GPG schlüssel: D5257409
    fingerprint:
    08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09


    </sect2>


  • 6.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-26-2018 21:36
    I was too fast: The misalignment is only then when the space between the
    title and the number is too small.

    Once it it distributed over two lines, there is no longer a
    misalignment: Compare this from the general TOC to the one below from a
    chapter TOC:

    Am 26.11.2018 um 22:21 schrieb Bernhard Kleine:
    >
    > I have changed the "dots" to space. this aligned everything but this
    > line in the TOC:
    >
    > <sect2>
    >                
    >            
    >
    > Obviously no whitespace involved. Maybe you have an idea.
    >
    > Regards
    >
    > Bernhard
    >
    >
    > --
    > spitzhalde9
    > D-79853 lenzkirch
    > bernhard.kleine@gmx.net
    > www.b-kleine.com, www.urseetal.net
    > -
    > thunderbird mit enigmail
    > GPG schlüssel: D5257409
    > fingerprint:
    > 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09

    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    -
    thunderbird mit enigmail
    GPG schlüssel: D5257409
    fingerprint:
    08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09


    </sect2>


  • 7.  RE: [docbook-apps] page numbers are not right aligned

    Posted 11-26-2018 21:43
    On 2018-11-26 Bob Stayton wrote:
    > The more general case with dot leaders and right alignment is an
    > inresolved FOP bug:
    >
    > https://issues.apache.org/jira/browse/FOP-1839
    >

    IIRC this problem can be eliminated if outer spaces around the dots are replaced with leaders of fixed width. The standard space is stretching element thus hard to calculate properly if there are too many variables to handle.


    So in <xsl:template name="toc.line"> it could be modified like this:

    <fo:basic-link internal-destination="{$id}">
    <xsl:apply-templates select="." mode="titleabbrev.markup"/>
    </fo:basic-link>
    <fo:leader leader-length="3pt"/>
    <fo:leader leader-alignment="reference-area">
    <xsl:attribute name="leader-pattern">dots</xsl:attribute>
    <xsl:attribute name="leader-pattern-width">3pt</xsl:attribute>
    <xsl:attribute name="rule-thickness">0.5pt</xsl:attribute>
    </fo:leader>
    <fo:leader leader-length="3pt"/>
    <fo:basic-link internal-destination="{$id}">
    <fo:page-number-citation ref-id="{$id}"/>
    </fo:basic-link>


    Regards,

    Jan




  • 8.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-27-2018 08:00
      |   view attached
    I got interested and made a little working example:


        schematypens="http://relaxng.org/ns/structure/1.0"?>
        type="application/xml"
        schematypens="http://purl.oclc.org/dsdl/schematron"?>
    <book xmlns="http://docbook.org/ns/docbook" xml:lang="de"></book>
    xmlns:xi="http://www.w3.org/2001/XInclude"
        xmlns:ns5="http://www.w3.org/2000/svg"
    xmlns:ns="http://docbook.org/ns/docbook"
        xmlns:xlink="http://www.w3.org/1999/xlink" version="5.1">
    <part>
       
        <chapter>
            <sect1></sect1>
            <sect1></sect1>
            <sect1></sect1>
            <sect1></sect1>
            <sect1></sect1>
            <sect1></sect1>
            <sect1></sect1>
        </chapter>
    </part>


    This transforms to the following TOC:


    Maybe someone can explain why all numbers are not right aligned. IMHO
    the problem is not with dots, but how the remaining whitespace between
    title and number is calculated.

    Regards

    Bernhard

    Am 26.11.2018 um 22:42 schrieb Jan Tosovsky:
    > On 2018-11-26 Bob Stayton wrote:
    >> The more general case with dot leaders and right alignment is an
    >> inresolved FOP bug:
    >>
    >> https://issues.apache.org/jira/browse/FOP-1839
    >>
    >>
    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    -
    thunderbird mit enigmail
    GPG schlüssel: D5257409
    fingerprint:
    08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09




  • 9.  Re: [docbook-apps] page numbers are not right aligned

    Posted 11-27-2018 08:26
      |   view attached
    the .fo file for the respective part of the TOC is

    <fo:block text-align-last="justify" end-indent="24pt"></fo:block>
    last-line-end-indent="-24pt"><fo:inline></fo:inline>
    keep-with-next.within-line="always"><fo:basic-link></fo:basic-link>
    internal-destination="d0e13">Section Section Section Section Section
    Section Section<fo:inline></fo:inline>
    keep-together.within-line="always"><fo:leader leader-pattern="space"></fo:leader>
    leader-pattern-width="5pt" leader-alignment="reference-area"
    keep-with-next.within-line="always"/><fo:basic-link></fo:basic-link>
    internal-destination="d0e13">1–<fo:page-number-citation></fo:page-number-citation>
    ref-id="d0e13"/><fo:block></fo:block>
    text-align-last="justify" end-indent="24pt"
    last-line-end-indent="-24pt"><fo:inline></fo:inline>
    keep-with-next.within-line="always"><fo:basic-link></fo:basic-link>
    internal-destination="d0e16">Section Section Section Section Section
    Section Section <fo:inline></fo:inline>
    keep-together.within-line="always"><fo:leader leader-pattern="space"></fo:leader>
    leader-pattern-width="5pt" leader-alignment="reference-area"
    keep-with-next.within-line="always"/><fo:basic-link></fo:basic-link>
    internal-destination="d0e16">1–<fo:page-number-citation></fo:page-number-citation>
    ref-id="d0e16"/><fo:block></fo:block>
    text-align-last="justify" end-indent="24pt"
    last-line-end-indent="-24pt"><fo:inline></fo:inline>
    keep-with-next.within-line="always"><fo:basic-link></fo:basic-link>
    internal-destination="d0e19">Section Section Section Section Section
    Section Section S<fo:inline></fo:inline>
    keep-together.within-line="always"><fo:leader leader-pattern="space"></fo:leader>
    leader-pattern-width="5pt" leader-alignment="reference-area"
    keep-with-next.within-line="always"/><fo:basic-link></fo:basic-link>
    internal-destination="d0e19">1–<fo:page-number-citation></fo:page-number-citation>
    ref-id="d0e19"/><fo:block></fo:block>
    text-align-last="justify" end-indent="24pt"
    last-line-end-indent="-24pt"><fo:inline></fo:inline>
    keep-with-next.within-line="always"><fo:basic-link></fo:basic-link>
    internal-destination="d0e22">Section Section Section Section Section
    Section Section Se<fo:inline></fo:inline>
    keep-together.within-line="always"><fo:leader leader-pattern="space"></fo:leader>
    leader-pattern-width="5pt" leader-alignment="reference-area"
    keep-with-next.within-line="always"/><fo:basic-link></fo:basic-link>
    internal-destination="d0e22">1–<fo:page-number-citation></fo:page-number-citation>
    ref-id="d0e22"/><fo:block></fo:block>
    text-align-last="justify" end-indent="24pt"
    last-line-end-indent="-24pt"><fo:inline></fo:inline>
    keep-with-next.within-line="always"><fo:basic-link></fo:basic-link>
    internal-destination="d0e25">Section Section Section Section Section
    Section Section Sec<fo:inline></fo:inline>
    keep-together.within-line="always"><fo:leader leader-pattern="space"></fo:leader>
    leader-pattern-width="5pt" leader-alignment="reference-area"
    keep-with-next.within-line="always"/><fo:basic-link></fo:basic-link>
    internal-destination="d0e25">1–<fo:page-number-citation></fo:page-number-citation>
    ref-id="d0e25"/><fo:block></fo:block>
    text-align-last="justify" end-indent="24pt"
    last-line-end-indent="-24pt"><fo:inline></fo:inline>
    keep-with-next.within-line="always"><fo:basic-link></fo:basic-link>
    internal-destination="d0e28">Section Section Section Section Section
    Section Section Sect<fo:inline></fo:inline>
    keep-together.within-line="always"><fo:leader leader-pattern="space"></fo:leader>
    leader-pattern-width="5pt" leader-alignment="reference-area"
    keep-with-next.within-line="always"/><fo:basic-link></fo:basic-link>
    internal-destination="d0e28">1–<fo:page-number-citation></fo:page-number-citation>
    ref-id="d0e28"/>

    Am 27.11.2018 um 08:59 schrieb Bernhard Kleine:
    >
    > I got interested and made a little working example:
    >
    >
    > >     schematypens="http://relaxng.org/ns/structure/1.0"?>
    > >     type="application/xml"
    >     schematypens="http://purl.oclc.org/dsdl/schematron"?>
    > <book xmlns="http://docbook.org/ns/docbook" xml:lang="de"></book>
    > xmlns:xi="http://www.w3.org/2001/XInclude"
    >     xmlns:ns5="http://www.w3.org/2000/svg"
    > xmlns:ns="http://docbook.org/ns/docbook"
    >     xmlns:xlink="http://www.w3.org/1999/xlink" version="5.1">
    > <part>
    >    
    >     <chapter>
    >         <sect1></sect1>
    >         <sect1></sect1>
    >         <sect1></sect1>
    >         <sect1></sect1>
    >         <sect1></sect1>
    >         <sect1></sect1>
    >         <sect1></sect1>
    >     </chapter>
    > </part>
    >
    >
    > This transforms to the following TOC:
    >
    >
    > Maybe someone can explain why all numbers are not right aligned. IMHO
    > the problem is not with dots, but how the remaining whitespace between
    > title and number is calculated.
    >
    > Regards
    >
    > Bernhard
    >
    > Am 26.11.2018 um 22:42 schrieb Jan Tosovsky:
    >> On 2018-11-26 Bob Stayton wrote:
    >>> The more general case with dot leaders and right alignment is an
    >>> inresolved FOP bug:
    >>>
    >>> https://issues.apache.org/jira/browse/FOP-1839
    >>>
    >>>
    > --
    > spitzhalde9
    > D-79853 lenzkirch
    > bernhard.kleine@gmx.net
    > www.b-kleine.com, www.urseetal.net
    > -
    > thunderbird mit enigmail
    > GPG schlüssel: D5257409
    > fingerprint:
    > 08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09

    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    -
    thunderbird mit enigmail
    GPG schlüssel: D5257409
    fingerprint:
    08 B7 F8 70 22 7A FC C1 15 49 CA A6 C7 6F A0 2E D5 25 74 09