docbook-apps

  • 1.  Thumb register

    Posted 07-19-2020 17:13
    I have used a thumb register in a book produced with LaTeX. That was
    fairly straight forward. I wonder whether this is also possible with
    docbook -> PDF. Is there a solution already?

    King regards

    Bernhard

    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    Ich darf auch auf mein neues Buch "Falter in Lenzkirch" aufmerksam machen
    (Infos bei mir)
    -
    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] Thumb register

    Posted 07-20-2020 07:41
    Bernhard Kleine <bernhard.kleine@gmx.net> writes:
    > I have used a thumb register in a book produced with LaTeX. That was
    > fairly straight forward. I wonder whether this is also possible with
    > docbook -> PDF. Is there a solution already?

    Pardon my ignorance, but what is a “thumb register”?

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > The real art of conversation is not only to say the right thing at the
    > right place but to leave unsaid the wrong thing at the tempting
    > moment.--Dorothy Nevill



  • 3.  Re: [docbook-apps] Thumb register

    Posted 07-20-2020 07:53
    Hello,

    I guess this is the colored square you print on the edge of each page of
    a chapter, in order to easily select it with the thumb on the book edge?

    We've been doing this by adding a fixed block to the header template
    (even if it's located outside the header on the page).

    HTH,

    Camille.

    Le 20/07/2020 à 09:40, Norman Tovey-Walsh a écrit :
    > Bernhard Kleine <bernhard.kleine@gmx.net> writes:
    >> I have used a thumb register in a book produced with LaTeX. That was
    >> fairly straight forward. I wonder whether this is also possible with
    >> docbook -> PDF. Is there a solution already?
    > Pardon my ignorance, but what is a “thumb register”?
    >
    > Be seeing you,
    > norm
    >
    > --
    > Norman Tovey-Walsh <ndw@nwalsh.com>
    > https://nwalsh.com/
    >
    >> The real art of conversation is not only to say the right thing at the
    >> right place but to leave unsaid the wrong thing at the tempting
    >> moment.--Dorothy Nevill




  • 4.  Re: [docbook-apps] Thumb register

    Posted 07-20-2020 07:54
    Hi,

    On Montag, 20. Juli 2020 09:40:33 CEST Norman Tovey-Walsh wrote:
    > Bernhard Kleine <bernhard.kleine@gmx.net> writes:
    > > I have used a thumb register in a book produced with LaTeX. That was
    > > fairly straight forward. I wonder whether this is also possible with
    > > docbook -> PDF. Is there a solution already?
    >
    > Pardon my ignorance, but what is a “thumb register”?

    If I understood Bernhard correctly, it's a "thumb index":

    https://en.wikipedia.org/wiki/Thumb_index

    Of course, you cannot cut off a specific parts of a page with XSL FO, but you
    can "simulate" that by having a colored space at the page margin.

    Hope that helps.

    --
    Gruß/Regards
    Thomas Schraitle






  • 5.  Re: [docbook-apps] Thumb register

    Posted 07-20-2020 08:27
    On 19/07/2020 18:13, Bernhard Kleine wrote:
    > I have used a thumb register in a book produced with LaTeX. That was
    > fairly straight forward. I wonder whether this is also possible with
    > docbook -> PDF. Is there a solution already?

    There is a 'Thumb index' sample in the XSL-FO samples page at
    https://www.antennahouse.com/xsl-fo-samples

    Regards,


    Tony Graham.
    --
    Senior Architect
    XML Division
    Antenna House, Inc.
    ----
    Skerries, Ireland
    tgraham@antenna.co.jp



  • 6.  Re: [docbook-apps] Thumb register

    Posted 07-20-2020 10:12
    Tony Graham <tgraham@antenna.co.jp> writes:
    > On 19/07/2020 18:13, Bernhard Kleine wrote:
    >> I have used a thumb register in a book produced with LaTeX. That was
    >> fairly straight forward. I wonder whether this is also possible with
    >> docbook -> PDF. Is there a solution already?
    >
    > There is a 'Thumb index' sample in the XSL-FO samples page at
    > https://www.antennahouse.com/xsl-fo-samples

    That’s the one I was going to point to (once I got a clue!).

    Be seeing you,
    norm

    --
    Norman Tovey-Walsh <ndw@nwalsh.com>
    https://nwalsh.com/

    > There is no monument dedicated to the memory of a committee.--Lester J.
    > Pourciau



  • 7.  Re: [docbook-apps] Thumb register

    Posted 07-20-2020 10:22
    On 19.7.2020 19:13, Bernhard Kleine wrote:
    > I have used a thumb register in a book produced with LaTeX. That was
    > fairly straight forward. I wonder whether this is also possible with
    > docbook -> PDF. Is there a solution already?

    I suppose your are using FO based output of DocBook XSLT 1.0
    stylesheets. It depends on what you want to display in thumb index, but
    if you will put the following code into existing footer.table named
    template you will get chapter number and title in the thumb index (see
    https://books.google.cz/books?id=x93yCgAAQBAJ&lpg=PA1&dq=big%20data%20a%20nosql%20datab%C3%A1ze&pg=PA21#v=onepage&q=big%20data%20a%20nosql%20datab%C3%A1ze&f=false
    for preview):

    <xsl:if test="($sequence = 'odd' or $sequence = 'first') and
    $pageclass != 'lot' and not(self::d:book) and not(self::d:part)">
    <fo:block-container absolute-position="fixed"
    reference-orientation="90" width="28mm" height="16mm"
    left="150mm" background-color="#A0A0A0"
    font-size="8pt" font-weight="bold"
    font-family="{$title.font.family}"
    text-align="center" color="black" padding="2mm" hyphenate="false">
    <xsl:attribute name="top">
    <xsl:value-of select="(count(preceding::d:chapter |
    preceding::d:appendix | preceding::d:preface |
    preceding::d:bibliography) mod 7) * 28 + 18"/>
    <xsl:text>mm</xsl:text>
    </xsl:attribute>
    <fo:block>
    <xsl:variable name="label">
    <xsl:apply-templates select="." mode="label.markup"/>
    </xsl:variable>
    <xsl:if test="$label != ''">
    <xsl:copy-of select="$label"/>
    <xsl:text>. </xsl:text>
    </xsl:if>
    <xsl:apply-templates select="." mode="titleabbrev.markup">
    <xsl:with-param name="allow-anchors" select="0"/>
    </xsl:apply-templates>
    </fo:block>
    </fo:block-container>
    </xsl:if>


    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML and Web consulting and training services
    DocBook/DITA customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------



  • 8.  Re: [docbook-apps] Thumb index (was: thumb register)

    Posted 07-20-2020 15:52
    I found "thumb index" only after I had send the mail. Sorry for the
    confusion.

    This looks very promising. I was thinking not about the index of two
    chapters at the same position, but on different position from Chap1 down
    to Chap10 and then restarting on the top to 21 and so an.

    Any solution to this. As I am using xml, but not programming it, I would
    like ready made solutions.

    Credits for this would be published in the boook.

    Regards Bernhard

    Am 20.07.2020 um 12:21 schrieb Jirka Kosek:
    > On 19.7.2020 19:13, Bernhard Kleine wrote:
    >> I have used a thumb register in a book produced with LaTeX. That was
    >> fairly straight forward. I wonder whether this is also possible with
    >> docbook -> PDF. Is there a solution already?
    > I suppose your are using FO based output of DocBook XSLT 1.0
    > stylesheets. It depends on what you want to display in thumb index, but
    > if you will put the following code into existing footer.table named
    > template you will get chapter number and title in the thumb index (see
    > https://books.google.cz/books?id=x93yCgAAQBAJ&lpg=PA1&dq=big%20data%20a%20nosql%20datab%C3%A1ze&pg=PA21#v=onepage&q=big%20data%20a%20nosql%20datab%C3%A1ze&f=false
    > for preview):
    >
    > <xsl:if test="($sequence = 'odd' or $sequence = 'first') and
    > $pageclass != 'lot' and not(self::d:book) and not(self::d:part)">
    > <fo:block-container absolute-position="fixed"
    > reference-orientation="90" width="28mm" height="16mm"
    > left="150mm" background-color="#A0A0A0"
    > font-size="8pt" font-weight="bold"
    > font-family="{$title.font.family}"
    > text-align="center" color="black" padding="2mm" hyphenate="false">
    > <xsl:attribute name="top">
    > <xsl:value-of select="(count(preceding::d:chapter |
    > preceding::d:appendix | preceding::d:preface |
    > preceding::d:bibliography) mod 7) * 28 + 18"/>
    > <xsl:text>mm</xsl:text>
    > </xsl:attribute>
    > <fo:block>
    > <xsl:variable name="label">
    > <xsl:apply-templates select="." mode="label.markup"/>
    > </xsl:variable>
    > <xsl:if test="$label != ''">
    > <xsl:copy-of select="$label"/>
    > <xsl:text>. </xsl:text>
    > </xsl:if>
    > <xsl:apply-templates select="." mode="titleabbrev.markup">
    > <xsl:with-param name="allow-anchors" select="0"/>
    > </xsl:apply-templates>
    > </fo:block>
    > </fo:block-container>
    > </xsl:if>
    >
    >
    --
    spitzhalde9
    D-79853 lenzkirch
    bernhard.kleine@gmx.net
    www.b-kleine.com, www.urseetal.net
    Ich darf auch auf mein neues Buch "Falter in Lenzkirch" aufmerksam machen
    (Infos bei mir)
    -
    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] Thumb index

    Posted 07-20-2020 16:21
    On 20/07/2020 16:52, Bernhard Kleine wrote:
    ...
    > This looks very promising. I was thinking not about the index of two
    > chapters at the same position, but on different position from Chap1 down
    > to Chap10 and then restarting on the top to 21 and so an.
    >
    > Any solution to this. As I am using xml, but not programming it, I would
    > like ready made solutions.

    The 'mod 7' in Jirka's solution restarts the positioning after 7
    chapters. Have you tried it?

    Regards,


    Tony Graham.
    --
    Senior Architect
    XML Division
    Antenna House, Inc.
    ----
    Skerries, Ireland
    tgraham@antenna.co.jp



  • 10.  Re: [docbook-apps] Thumb index

    Posted 07-21-2020 09:57
    On 20.7.2020 18:20, Tony Graham wrote:
    > The 'mod 7' in Jirka's solution restarts the positioning after 7
    > chapters.  Have you tried it?

    Thanks Tony for further clarification. I have been in rush and haven't
    time to comment much on my example. For positioning of thumb index the
    following code is cruical:

    <xsl:attribute name="top">
    <xsl:value-of select="(count(preceding::d:chapter |
    preceding::d:appendix | preceding::d:preface |
    preceding::d:bibliography) mod 7) * 28 + 18"/>
    <xsl:text>mm</xsl:text>
    </xsl:attribute>

    mod 7 -- means that after each 7 chapters/appendices/... thumb index
    will be moved back to the top of a page

    28 -- is height of thumb index (in mm)

    18 -- is intial offset (in mm)

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML and Web consulting and training services
    DocBook/DITA customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------