PPTools/Ppgen/PPW/Tips
Page number color
For gray rather than silver page numbers use .nr pnc gray near the top. Of course, you may use any valid color name instead of gray.
Zero-width space (for dropcaps or allowing break in long words)
A \& represents a zero-width space.
The context was drop-caps. The zero-width space can be used to separate off the first letter of a word containing an apostrophe, e.g. O\&'Neill, so that only the "O" is drop-capped. Otherwise, by default, HTML/CSS would make the "O" and the apostrophe large drop-capped.
(Harvested from this post)
Illustrations: adding a border (or other styling) for a specific illustration
You can use the .de command to customize how ppgen displays some items. However, when you want to customize a specific illustration you need to tell ppgen which one you are referring to.
Given this illustration
.il id=fig77 fn=i02.jpg w=348 link=i02f.jpg alt='frontispiece'
you can add a border by inserting the following line near the top of your ppgen source file
.de div#fig77 img { padding:5px; border:thin solid black; }
Note how the id=fig77 in the illustration definition is paired with the div#fig77 in the .de command.
(Harvested from this post)
Apply a style change to all captions
To change all captions to use a font size of 85% use the .de command as follows:
.de div.figcenter p { font-size: 85%; } .de div.figleft p { font-size: 85%; } .de div.figright p { font-size: 85%; }
(Harvested from this post)
Adding text to mobile version of html only
.de .mobile {visibility: hidden; display: none;} .de @media handheld { \ .mobile {visibility: visible; display: inline} } .dv class=mobile .if h The cover has been created by the transcriber and placed in the public domain. .if- .dv-
Note: Do not try to use "display: none;" for a header (.h1/2/.../6) as that will not allow creation of a .mobi file when ebookmaker runs.
Adding errata table and displaying/linking corrections
To make corrections to the text where obvious printer errors are found, you can use ins markup for html, which will create a mouseover popup displaying the original text. But in epub, mouseover events do not work. In this case, the corrected text should serve as a link to an entry in an errata table, where the correction is documented and explained. This table can be in the final transcriber's note. First, as described in another tip, manipulate the display attribute for html and epub only.
.de .epubonly {visibility: hidden; display: none; } .de @media handheld { .epubonly { visibility: visible; display: inline; } } .de .htmlonly {visibility: visible; display: inline;} .de @media handheld { .htmlonly { visibility: hidden; display: none; } } .de ins.correction { text-decoration:none; border-bottom: thin dotted gray; }
Define two macros.
The first ('corr') will display the corrected text for text, html and epub. But for html, an the 'ins' markup will allow the original text to be displayed on mouseover. For epub, it creates a simple link to a line in the errata table, where the original text and the edit can be found.
The second macro 'cref', creates a link from the page/line reference in the errata table back to the correction in the text.
.dm corr $1 $2 $3 .if t $3 .if- .if h <target id=corr$1><span class='htmlonly'><ins class='correction' title='$2'>$3</ins></span><span class='epubonly'>#$3:c_$1#</span> .if- .dm- ... .dm cref $1 .if t $1 .if- .if h <target id='c_$1'>#$1:corr$1# .if- .dm-
In the src, the correction appears as:
<pm corr 293.15 neverthelesss nevertheless> I awaited with impatience
The first parameter is the page/line; the second is the original text, and the third is the corrected text. In the errata table:
.ta l:10 l:46 l:12 w=100% <pm cref 293.15> | nevertheless[s] I awaited with impatience | Removed. .ta-
The epub span constructs the #x:y# syntax so that the link processing will construct a proper link, without the 'ins' markup (which doesn't work anyway). The text output simply provides the corrected text, and it would be up to the reader to go to the errata and see the changes. So, for html, mousing over a highlighted phrase will display the original text; and for epub, that phrase serves as a link to the errata table. The page/line string is used to construct the two href's (e.g., corr293.15 and c_293.15>).
<a id='corr293.15'></a><span class='htmlonly'><ins class='correction' title='neverthelesss'>nevertheless</ins></span><span class='epubonly'><a href='#c_293.15'>nevertheless</a></span> I awaited with impatience ... <tr> <td class='c003'><a id='c_293.15'></a><a href='#corr293.15'>293.15</a></td> <td class='c003'>nevertheless[s] I awaited with impatience</td> <td class='c022'>Removed.</td> </tr>