Page references

I’ve been thinking about page references lately and how they translate to non-print presentations. At the moment, I’m reading The Rust Programming Language by Steve Klabnik and Carol Nichols and I noticed that there was a page reference when they wrote:

We’ll discuss this concept in detail in “Variables and Mutability” on page 32.

This, in itself is not notable, but what is, is that there is a freely available version of the book on the web. A chance to see how this got translated in practice. There, the sentence is 

We’ll be discussing this concept in detail in the “Variables and Mutability” section in Chapter 3.

(hyperlink preserved in my copy of the sentence). Two things: This is clearly a manual rewrite of the sentence (with some change to the tense of the verb from simple future to future progressive) and they avoid the page reference entirely. 

A bit disappointing, but I am curious about what to do with things like the equivalent of a LaTeX \pageref if the document is translated for a web or ebook presentation. I had hoped to get something usable as a model from this wasn’t it. Ideally I’d like to be able to automatically translate something like page~\pageref{foo} into either “page 32” for a print/PDF presentation or some alternate text for the HTML/ebook presentation, but I have no idea what that alternate text should be.

Comments |1|

Re: -dsr-Cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • page~\pageref{Variables and Mutability} should return “page 32” when the output format is DVI and the language is EN-US, “pagina 32” when the output format is pdf and the language is ES, and a hyperlink to the Variables and Mutability tag in formats like EPUB and HTML.

    Reply

Legend *) Required fields are marked
**) You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Category: Uncategorized