Recent Changes · Search:

Support the Project



edit SideBar


Cross-references: Link to a labelled paragraph

How do I make a reference to a labelled paragraph on the current page or another page?

Detail from the Gutenberg Bible

In particular, I would like to use the text from the labelled paragraph as the text of the link. There are 2 use cases: ‘Intra-page references (within the current page)’ and ‘Inter-page references (between one page and another)’. The approach uses standard PmWiki page anchor markup [[#anchor-name]].

The most common situation is where a writer wishes to link to a heading; we base the examples on this. However: You can link to any labelled text….

Intra-page references (within the current page).

To reference a paragraph on the current page, use the markup [[#anchor-name | #]]. Place the anchor either on the line before the referenced paragraph or at the start of the line, after any start of line markup. The markup rule will automatically clean the cross-reference text to remove things like links.

Inter-page references (between one page and another).

To reference a paragraph on another page, preface the anchor with the page name, i.e. the markup [[PageName#anchor-name | #]]. Alert readers will have noted that PmWiki uses the # character to request a numbered link. To preserve this capability, the inter-page cross-reference markup requires a valid page name, optionally with a group prefix. To get normal PmWiki behaviour, use [[Page Name#anchor-name | #]].

For example: Use the run-in head markup. This links to a labelled heading on the specified page. But there’s more…

You can link to any labelled text. As usual, the “invisible stop” (backtick-period) markup halts the cross-reference text. The cross-reference also understands run-in head markup (Tip 00033) and includes just the heading text.

You can of course also link backwards: You can link to any labelled text…. In the PDF, note how the link text changes (the variable link text feature requires Wikipublisher version 2.2.7 or above).

To learn how to use the markup, click and UTSL.

Category: navigation aid

« 00046 · Edit Form · 00048 »

Creative Commons License
Edit · History · Print · Recent Changes · Search · Links
Page last modified on 12 January 2009 at 06:57 PM