Recent Changes
Recent Changes · Search:

Cross-references: Link to a labelled image, table or div

How does Wikipublisher process links to labelled objects (images, tables and div blocks) that float?

Drollery: a decorative sketch in the margin of an illustrated manuscript

The Div, Fig and Tab markup lets an author reference a labelled div, image and table respectively. In Tip 00018, we saw how to use Tab(idReference1) to make a cross-reference from body text to a table. Tip 00023 describes use of Div(idReference2) to make a cross-reference to a labelled div block. In the PDF version of the page, such objects float and in general will not be on the same page as the references to them.

Consider Ut ullamcorper ultricies mauris, which is a simple labelled table.

Suspendisse potenti.Aliquam erat volutpat.Curabitur massa.
Duis et tortor posuere nunc dapibus gravida.Curabitur viverra placerat odio.Etiam ac metus.
Donec ut nulla a diam aliquam egestas.Nullam urna.Phasellus non purus.
Aliquam purus.Fusce imperdiet varius sem.Mauris commodo hendrerit purus.
Proin fermentum.Sed pulvinar leo ut pede.Morbi consectetuer.

The author does not know in advance the spatial relationship between the table and references to it. However, Wikipublisher can automatically generate suitable explanatory text as part of the reference. To enable this option, add the following line to local/config.php:

     $ReferencePageNumbers = true;

If the object and a reference to it fall on the same page, the Wikibook PDF server uses the default reference text. If they fall on different pages, it will insert an additional phrase such as:

  • on the following page
  • on the previous page
  • on the facing page (if it’s a duplex document)
  • on page n (if it’s further away)

Sometimes, an author may not want this behaviour for some references. Writing `Tab(idReference) (a backtick prefix) suppresses the optional text, but has no effect in the HTML view of the page.

The LATEX package used for this includes translations for a number of European languages. If the skin template has a lang attribute set in the document root element (article, report or book), the Wikibook server will use a translation, if it exists.

Category: navigation aid

« 00048 · Edit Form · 00050 »

Page last modified on 16 November 2008 at 08:29 PM