Pages: 1
Print
Author Topic: TOPLEAF: Cross-references do not include page numbers  (Read 2067 times)
jlm05
Member

Posts: 79


« on: March 27, 2012, 01:09:56 PM »

When we generate PDFs, cross-references are hyperlinked, but do not include page numbers. If the PDF is printed, having a page number is necessary.

For the xref tag in our stylesheet, the Custom tag content is:

<!-- construct link -->
<Idref-Link ref="{@href}"><content/></Idref-Link>

I took a quick look through the doc and didn't see any way to turn on the page numbers.
Logged
gjn2066
Member

Posts: 60


WWW
« Reply #1 on: March 29, 2012, 01:18:21 PM »

I should point out that the Idref package you are using won't be officially released until the XMetaL 7 version of the plugin (real soon now), but here's a sneak preview.

Assuming the target element has an id attribute, you "register" the target with either:
  • <Idref-Topic ref="{@id}"/> if the element is a topic (concept, task etc); or
  • <Idref-Current ref="{@id}"/> if the element is within a topic (eg. a section).

This creates a unique target from the filename and ID which (in the case of the first topic in a file) can also be reached using just the filename. It also allows you to set any number of "properties" associated with this target. These are just named strings that can be retrieved when needed. For example you could save the title of a target, then retrieve it whenever you make an xref to that target. So the text of the link is effectively self generating.

However, you also get a folio (ie. page number) property for free (you don't have to set it yourself). This can be used as follows:

    <!-- construct link with page number -->
    <Idref-GetP property="folio" ref="{@href}"/>
    <Idref-Link ref="{@href}"><content/> on page {Idref-folio}</Idref-Link>

where Idref-GetP retrieves the property PROP associated with the target and assigns it to the variable {Idref-PROP}.

Let me know if this works, because if it doesn't I need to make an urgent fix to the XMetaL 7.0 plugin ;-)

Geoff

« Last Edit: March 29, 2012, 01:22:55 PM by gjn2066 » Logged
Pages: 1
Print
Jump to: