Page tags work in header but not in body

I have inserted a table contents into my manuscript using the Edit > Copy Special > Copy Documents as TOC feature. When I compile, the <$p> tags in this TOC don’t work. However, I am using those same tags in the header and footer, and those work as expected and insert the page number.

Any ideas for why this is happening?

In the resulting document, select print and print preview to force the application to resolve the Placeholder.

1 Like

I tried that and the print preview still shows the <$p> tags. Tried compiling again and the page numbers still aren’t being inserted.

What format are you Compiling to?

The page numbers are undefined until the document is actually assembled. So it’s up to the PDF rendering engine or Word (depending on format) to figure out what they should be.

1 Like

For Windows users of Scrivener:

If compiling to Word (DOCX format), then it’s as @AntoniDol indicated, Print Preview in Word. You’ll see the page numbers in the preview and cancelling the preview your TOC will be updated with the same numbers in Word.

Each time you compile, you must follow the same course of action for Word to update the placeholders.

If you save and close the Word document and open it again, you must go through the same process, as Word doesn’t save the actual page numbers, only the placeholders.

Compiling to PDF, however, produces a numbered TOC.

I use Office 365 - whatever this week’s latest version is and Scrivener 3.1.5.1.

1 Like

I figured out the issue. Unchecking the “Remove all hyperlinks” in Compile options did the trick.

In Word they are called “fields”. Fields are a core feature of Word and has been for decades. Fields need to be “updated” when they are new or out of date. Word provides a number of ways to “update fields” automatically or manually.

2 Likes