How do I create a linked reference to a page number or chapter number?

First time poster here!

How do I insert a specific page number in a Scrivener text and make sure it always updates? And how to I do the same for a chapter number?

What I mean is this: I’m writing a non-fiction book, and I want to be able to write lines such as “see page X” and “see chapter Y”.

Is it possible to insert placeholders in X and Y which link to a specific line of text at another point in the book so that they output as the correct numbers?

Thanks in advance for any help.

1 Like

I would refer to the Creating Cross-References for your Readers subsection, in §10.1.4 of the user manual PDF first, to see if that addresses all of your questions (note the yellow tip box addressing page numbers).

Something perhaps left implied in that description is that ordinarily section numbering will be applied automatically as part of heading generation when you compile, as part of the Section Layout, which updates link text pointing to that item by name. So that part happens automatically, unless you yourself decide to implement numbering with manual placeholders in the text (I generally wouldn’t recommend doing so, it will nearly always be better to leave such details to the compiler).


Thanks for this AmberV, helpful.

Reading that section of the PDF along with the placeholders guide in Help I am almost there on the chapters thing – but not quite.

If I put see chapter <$t#chapter> in the text and link it to chapter four, compiles to “see chapter Four”. However, what I really want is for it to compile to “see chapter four” with a lowercase F.

I see from the manual I should be able to use <$w> to do this. But no matter how many compiles I try, see chapter <$w#chapter> does not work. It just compiles to “see chapter <$w#chapter>”.

What am I missing?

There are two problems that I can see here with this approach:

  1. The particular referencing placeholder you are using refers to the last used count for that token. It would thus only work within the chapter itself. If you moved the reference to the next chapter, it would start printing “five”.
  2. Each number counter has its own stream. You can’t reference a $t stream using a $w reference. That’s why it comes back without evaluation to a number, because you are attempting to reference a counter that doesn’t exist.

Before getting into all of that though, there are two simpler approaches that might be overlooked:

  • For one thing you could get away with referring to this as “Chapter Four”, in my opinion. That’s going to be perfectly valid, and even standard I would say, to refer to formal nouns using capitalisation.
  • In most cases, if format capitalisation is fine, then all you really need to do is create an internal link pointing to the item that represents the chapter. For example, type in "See ", and then drag and drop the binder item for chapter four into the editor after the word.

To fine-tune how the latter works, open the compiler, and double-click on the Format you are using in the left sidebar to edit it. Visit the Document Title Links compile format pane. For example if your headings print, “Chapter Four” on one line and “Name of Binder Item” on the next, you might want to tick Links use title prefixes only (exclude titles and suffixes).

I’ve attached an example project with just such a setup demonstrated: (171.1 KB)

Now if you really want “chapter four”, the only thing I can think to suggest is that you’re going to have to settle for having “CHAPTER FOUR” in your main heading, because to refer to a lowercase numbering stream you need a lowercase number to begin with. It then comes down to either having “Chapter four” or “CHAPTER FOUR”. You are going to have to go into the Section Layout where the numbering is set up, and change the counter type to $w. Let me know if you need any help with that, but here is a screenshot of where you’ll be looking to make this change: