Cookbook.UnderscoreInPDFBookmark History
Hide minor edits - Show changes to markup
07 July 2009 at 07:36 PM
by John Rankin - add `_ to correct bookmarks
|
Changed line 9 from:
(($format==‘pdf’) ? ‘<tbook:discy kind=“_”/>’ : ‘_’));
|
to:
(($format==‘pdf’) ? ‘<tbook:discy kind=“_”/>’ : ‘_’));
|
07 July 2009 at 07:35 PM
by John Rankin - add `_ to correct bookmarks
|
Changed lines 1-2 from:
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 incorrect.
|
to:
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 “_”.
|
|
Changed line 16 from:
|
to:
Alternatively, download underscore.php Δ and install it in the cookbook directory.
|
07 July 2009 at 07:29 PM
by John Rankin - add `_ to correct bookmarks
|
Changed lines 12-16 from:
Then “escape” the underscore with the backtick character in any headings.
This is discussed in more detail in Issue 00130. The recipe is enabled for this page, so generating a PDF will produce the correct bookmark text. The HTML is unaffected.
|
to:
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.
underscore.php Δ
Contributor: John Rankin with thanks to Nigel Thomas for identifying the requirement.
|
07 July 2009 at 07:23 PM
by John Rankin - add `_ to correct bookmarks
Added lines 1-16:
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 incorrect.
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 is discussed in more detail in Issue 00130. The recipe is enabled for this page, so generating a PDF will produce the correct bookmark text. The HTML is unaffected.