Next in thread → Next in month →

Re: [docbook-apps] Title with subtitle as olink generated text

From
Zbyszek Cybulski <>
Date
2006-04-30T08:18:08+00:00
ID
Thread
Re: [docbook-apps] Title with subtitle as olink generated text
Thank you for your help. This is exactly what I meant. It works like a charm.

-Zbyszek

On 4/29/06, Bob Stayton <
> wrote:

Well, the document title is taken from the 
<ttl> element in the olink data rather than the <xreftext>.  
I'm not sure why.  You will need to customize the template named 
'olink.document.citation' in common/olink.xsl to change the xpath:

 

  <xsl:variable 
name="docname">
    <xsl:for-each 
select="$target.database" >
      
<xsl:value-of
             
select="key('targetdoc-key', $targetdoc)/div[1]/ttl" />
    
</xsl:for-each>
  </xsl:variable>

 

change 'ttl' to 'xreftext'.

 

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  

From: 
  Zbyszek 
  Cybulski 

  
To: 
Bob Stayton 

  
Cc: 
DocBook Apps 

  
Sent: Friday, April 28, 2006 12:44 
  AM

  
Subject: Re: [docbook-apps] Title with 
  subtitle as olink generated text

  

Thank you, Bob, again for your help.
It seems I was not 
  accurate enough and assumed the context of this discussion. My intention was 
  to get the combined title and subtitle of the referenced book in the olink. I 
  have tried the xrefstyle="select: title" attribute but it did not work. 
  

-Zbyszek

  
On 4/27/06, Bob 
  Stayton <> 
  wrote:
  
    

    
That's a stylesheet parameter.  
    See:

    
 

    
http://www.sagehill.net/docbookxsl/OlinkGentext.html#AddDocTitle 
    

    

    
 

    
Bob Stayton
Sagehill Enterprises
DocBook Consulting


    
 

    
 

    

    

    

    
----- 
    Original Message ----- 

    

From: 
    Zbyszek Cybulski 

    
To: 
    Bob Stayton 

    
Cc: 
    DocBook 
    Apps 

    

    
Sent: 
    Wednesday, April 26, 2006 6:02 AM

    
Subject: 
    Re: [docbook-apps] Title with subtitle as olink generated text

    

Another question is: How can I automatically include the book 
    title in the olink generated reference if I refer to a section in an 
    external book? I would like to have olink generated texts as they are if 
    refeernced in the same book, but with the added book title if the links lead 
    to a different PDF. 

-Zbyszek

    
On 4/25/06, Bob 
    Stayton <> 
    wrote: 
    
      

      
Hi Zbyszek,

      
No, the olink process will by default use the 
      xreftext content from the data file. If you just want the title in some 
      cases, then you would have to use xrefstyle="select: 
      title".

      

      
 

      
Bob Stayton
Sagehill Enterprises
DocBook Consulting


      
 

      
 

      

      

      

      
----- 
      Original Message ----- 

      

From: 
      Zbyszek Cybulski 
      

      

      
To: 
      Bob Stayton 

      
Cc: 
      DocBook 
      Apps 

      
Sent: 
      Tuesday, April 25, 2006 1:35 PM

      
Subject: 
      Re: [docbook-apps] Title with subtitle as olink generated text

      

Thanks for your fast response. Do I have to specify any 
      parameter to <olink>s that refer to the book, for which I want to 
      see the title and subtitle?
I have regenerated target.db with the 
      proposed customization and <xreftext> is as you said, title and 
      subtitle are concatenated. 

Thanks again,

-Zbyszek

      
On 4/25/06, Bob 
      Stayton <> 
      wrote: 
      
        

        
Hi,

        
This is actually pretty easy. The olink mechanism shares many templates with the 
        xref system.  The text that is generated for either link is 
        generated by using apply-templates mode="xref-to".  By using a 
        mode, different templates can be applied to each target element 
        type.  So to add a subtitle for your books, you could add this to 
        your customization layer:

        
 

        
<xsl:template match="book" 
        mode="xref-to">
  <xsl:param 
        name="referrer"/>
  <xsl:param 
        name="xrefstyle"/>
  <xsl:param name="verbose" 
        select="1"/>

        
 

        
  <xsl:apply-templates select="." 
        mode="object.xref.markup">
    <xsl:with-param 
        name="purpose" select="'xref'"/>
    
        <xsl:with-param name="xrefstyle" 
        select="$xrefstyle"/>
    <xsl:with-param 
        name="referrer" select="$referrer"/>
    
        <xsl:with-param name="verbose" select="$verbose"/>
  
        </xsl:apply-templates>
  <xsl:text> 
        </xsl:text>
  <xsl:apply-templates select="." 
        mode="object.subtitle.markup"/>

        
 

        
</xsl:template>

        
I just copied the original from fo/xref.xsl 
        and added two lines for a space separator and subtitle processing.  
        When you generate your target.db file, you should see in the 
        <xreftext> element for book both the title and 
        subtitle.

        

        
 

        
 

        
Bob Stayton
Sagehill Enterprises
DocBook Consulting


        

        
 

        
 

        
          
----- 
          Original Message ----- 

          

From: 
          Zbyszek Cybulski 
          

          
To: 
          DocBook 
          Apps 

          
Sent: 
          Tuesday, April 25, 2006 5:01 AM

          
Subject: 
          [docbook-apps] Title with subtitle as olink generated text

          

Hi list,

I would like to use link to PDF 
          documents using olinks. That's reasonably easy to do. I would like to 
          create links that consist of title and subtitle of the book. I am 
          referring to a book, not a chapter or a section. As generated text, 
          the olinking machinery gives only the title of the book. 
Is there 
          any way to reveal the subject of the book?
I cannot combine the 
          title and subtitle into a single title due to formatting issues. 
          Namely, the subtitle should differ from the title and should be placed 
          in the next line, under the title (as it is by default). 
To 
          complicate things, I'd love to see title and subtitle combined into 
          one line, when I inspect the PDF properties. 

Thanks in 
          advance,

-Zbyszek
Next in thread → Next in month →