Recent Changes
Recent Changes · Search:
 
Summary
Underscore in heading translates to 95 in bookmark
Type
Bug
Raised by
Nigel Thomas
Date opened
Wednesday, 29 April 2009
Description
An underscore _ in a heading translates to the digits 95 in the PDF bookmark. See Main.Wiki Sandbox Heading_With_Underscores.

NB, I realise this is a special case of Issues.00070; I can’t see why underscore is treated as a “special” character for the bookmark though (what are the PDF rules?).

In my case I want to document a SQL function so I need a solution or workaround that shows the function name including the underscore.

Importance
4
Proposed solution
The problem is that we translate the underscore into \mbox{\char95{}} and this is being reduced to 95 in the PDF bookmark. Further investigation is needed to find the best solution. One option that works is to create a markup rule to make the underscore a discretionary hyphenation character:
  Markup("`_", 'inline', '/`_/',
      (($format=='pdf') ? '<tbook:discy kind="_"/>' : '_'));

Then put `_ in the heading text. This will trick the Wikibook server into using the correct character in the bookmark.

Alternative solution: I post-processed the LATEX file with the UNIX command.

   sed 's/{\\mbox{\\char95{}}}/\\_/g' doc.tex >doc.new.tex

Try changing line 230 of wikibook/tbrplent/tbrplent.cc to

   case'_':out<<"\\_";break;

and recompiling.

Urgency
3
Status
Open
Resolution
 
Date closed
 

« 00134 · Edit Form · 00136 »

Page last modified on 30 July 2009 at 09:14 PM