Recent Changes · Search:

Support the Project

Wikipublisher

PmWiki

edit SideBar

 

By default, the Wikibook PDF server translates underscores into a numeric character reference. This is because the underscore has a special meaning in LATEX and odd things happen if we pass an underscore in its raw form. Usually, this works as expected, but there is a side-effect when a heading includes an underscore — the PDF bookmark text is shown as “95” instead of “_”.

Update
As of Cookbook:PublishPDF version 2.2.27, Wikipublisher automatically detects underscores in headings and gives them special treatment. The PDF bookmark text is now correct, without the author having to do anything.

We can fix_this

In local/config.php, ad the following text after loading the Wikipublisher extensions:

    Markup("`_", 'inline', '/`_/', 
          (($format=='pdf') ? '<tbook:discy kind="_"/>' : '_'));

Then “escape” the underscore with the backtick character in any headings. This will “hide” the underscore by turning it into a discretionary hyphenation character.

This is discussed in more detail in Issue 00135. The recipe is enabled for this page only, so generating a PDF will produce the correct bookmark text. The HTML is unaffected.

Alternatively, download underscore.php Δ and install it in the cookbook directory.

Contributor: John Rankin with thanks to Nigel Thomas for identifying the requirement.

Creative Commons License
Edit · History · Print · Recent Changes · Search · Links
Page last modified on 14 September 2010 at 03:50 AM