Re: [Dblatex-users] Using olink to reference a chapter
Status: Beta
Brought to you by:
marsgui
From: ben.guillon <ben...@gm...> - 2011-11-21 22:16:33
|
Hi, yes, there's a bug around olinking support (strange you're the first one to see it) that i'll try to fix cleanly. As a workaround you can use the "special" escaping characters in the target.db file, like in the following example: <!DOCTYPE div [ <!ENTITY t1 "Ͱt"> <!ENTITY t2 "ͱt"> ]> <div element="book" href="#MailAdminGuide" number="" targetptr="MailAdminGuide"><ttl>Admin Guide</ttl><xreftext>Admin Guide</xreftext><div element="chapter" href="#user_accounts" number="1" targetptr="user_accounts"><ttl>Administering User Accounts</ttl><xreftext>Chapter 1, &t2;\emph{&t1;Administering User Accounts&t2;}&t1;</xreftext></div></div> The order is meaningfull: start the escape mode with &t2; and stop it with &t1;. Hope it helps, Regards, BG On Mon, 21 Nov 2011 02:54:23 +0100, Richard Walker <wal...@gm...> wrote: > I'm having problems using olink to reference a chapter. > > The target.db file is generated (as per the dblatex manual) using the > HTML > version of the DocBook styles. > The relevant bit of my target.db file is: > > <div element="chapter" href="#chapter-passwords" number="2" > targetptr="chapter-passwords"> > <ttl>Passwords</ttl><xreftext>Chapter 2, <i>Passwords</i></xreftext> > > (So the the chapter name is surrounded by "i" tags.) > > When I reference this with an olink and process with dblatex, > I only see the text "Chapter 2, ". So the name of the chapter is lost, > apparently because of the <i> element around it. > > I can make the chapter name appear in the PDF by overriding the > markup used for target.db, thus: > > <xsl:template match="chapter|appendix" mode="insert.title.markup"> > <xsl:param name="purpose"/> > <xsl:param name="xrefstyle"/> > <xsl:param name="title"/> > > <xsl:choose> > <xsl:when test="$purpose = 'xref'"> > <!-- begin of i element was here --> > <xsl:copy-of select="$title"/> > <!-- end of i element was here --> > </xsl:when> > <xsl:otherwise> > <xsl:copy-of select="$title"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> > > But actually I _would_ like the chapter name to appear > in italics, to match what I see when I process the document > to produce HTML output. > > Inserting text nodes for "\emph{" and "}" in the above template doesn't > work, > as the generated PDF then contains those strings literally. > So I can't see how to make this work. |