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

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:
simpler_referencing.zip (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: