How to create page-number links

I read this in the manual:

If you link the page numbering placeholder, <$p>, to a particular document
in the Draft, the compiler will insert the a special reference for compatible
word processors to print calculated page number for that text.

But how do I actually do this? I can type <$p> into a document, highlight it, right click and find the document to link to via the ‘Link to Document’ submenu, but this means navigating down four or five submenus - this is really laborious.

  1. Is there a way to create the page-number link using drag and drop?
  2. and how do I get the link to point to the page number of a specific text in the target document?

Scroll back up to the top of that section you are reading, §10.1, to find the complete list of all the different ways you can create links. Drag and drop is indeed the first method it covers, as it is often the most convenient, especially when it’s with some existing text you want linked, like in this case.

and how do I get the link to point to the page number of a specific text in the target document?

  • If you are using Markdown with Scrivener, then you would be using Markdown for your cross-referencing anyway, and probably shouldn’t ever be using the <$p> method. This is how the user manual links to everything, all over the place.
  • For page numbers, if you are just relying upon built-in rich text features, then you cannot do this. There are ways of referring to specific spots anywhere, but they are not something that can be compiled to conventional typesetting markings.
  • How you can get around that:
    • With ebooks, since you are allowed to inject raw markup using that compile method, you can use HTML to put a link and anchor point anywhere—but then of course we aren’t talking about page numbers.
    • Everything else: put simply, your outline needs to be as detailed as your cross-referencing. Whether cut points in the outline are logical or not may prompt you to use static placeholders for the TO/FROM spots. You can later search for these and wire things up in your desktop publishing software or word processor, toward the final production phases.
2 Likes

Alternatively, if you select some text in the editor first and then drag an item on
top of the selected text, the hyperlink will be applied to the selected text, rather
than dropping the name of the item into the editor.

This is what I need, and it works fine for my compilations to pdf. Thanks.

1 Like