How To Create A Table of Contents in Scrivener for Windows

You’ve been using Scrivener for Windows and loving it, but suddenly you discover something isn’t right.  You don’t know how to create a table of contents in Scrivener for Windows!  You know it can be done, but it’s not working for you.  Maybe you have a table of contents but it’s not clickable, or the links take you to to the wrong pages.  “Why has Scrivener betrayed me?”, you ask yourself.

Is this you?  This issue trips-up a lot of Scrivener for Windows users – you aren’t alone. I’ll show you how to make that table of contents (ToC) work.  It can be done!

The underlying problem, and solution, is actually in the Scrivener manual.  The manual is HUGE, so it’s no surprise many people have no clue what’s happening – the manual is bigger than my first book!  If you open Scrivener, go to the help menu, and click “Scrivener Manual”, the PDF manual will load.  At the time of writing this it is chapter 22 that deals with creating a table of contents.  This is the key part we’ve all failed to read, or know about, and it’s right at the start of the chapter…

Scrivener manual warning

As it says, in a perfect world you need to have a compatible version of Office installed to compile PDF and DOC files with working ToC’s.  Not having Office installed, or a compatible version, is far from the end of the story and there are ways and means to get this all working.

Starting From Blank

Let’s run-through how to generate a Scrivener ToC starting from a blank project.  Starting a new Scrivener project and selecting the “Blank” template will give you a project that has sections named “Draft”, “Research”, and “Trash”, and an “Untitled” scene ready to go in the draft section.  If you used one of the other templates then you may have more sections populated already, and “Draft” may have another name such as “Manuscript”.  Nonetheless, from the blank template you get this:

Blank Template

Front Matter

So you’ve done some writing and have a number of chapters and scenes, and it’s all set-up nice and logically.  Great! Before you are done you probably want a front matter section if the template didn’t provide one for you, so go ahead and right-click in the blank area below the Trash can, select “Add”, “New Folder”, and then after the new folder appears in the Scrivener Binder right-click it and change its icon to the front matter icon so that it visually makes sense when you look at it:

Front Matter Folder

After that rename it to “Front Matter”.  Neither giving it the front matter name nor icon actually matters to Scrivener, it’s just making this folder represent what its purpose is so that you know at a glance.  You can call it whatever you want and give it any icon that makes you happy.

What’s the purpose of creating and using a front matter section within Scrivener? It’s so you can easily swap between different front matter depending on what or who you are compiling for.  Maybe your Kindle version has a different front matter to the PDF.  You could just create a new chapter and place it right at the start and use that as your front matter, but it’s easier and more flexible to follow the convention here and set the front matter value in the compile options to a section that is separate from your draft.

Within your front matter folder add a new text section like you would anywhere else, and name it “Table of Contents” or something similarly meaningful.  You can also create “Acknowledgements”, “Copyright”, and other pages in the front matter, but for now we only care about the ToC as that’s the topic at hand.

Later, when you go to compile, don’t forget to set your front matter to the correct section:

Set Front Matter

Here you can see the front matter I’ve selected is actually called “Front Matter” and has the front matter icon because that’s the name and icon I gave the folder in the Binder when I created it.  If you called your front matter something else you’ll see that name instead in the drop-down list.  Tick the tick-box and select the correct folder for the front matter and you are done.  You can do this now and “Save & Close” so you don’t have to remember to do it later.

Generating A Table Of Contents

You can have Scrivener generate a Table of Contents at any time, but you really want to do this at, or again at, the end of your writing cycle.  If you do this early and then change your content around the ToC will undoubtedly become outdated and wrong, so before you hit the Compile button for the final time go through the process of generating a ToC to ensure your Table of Contents is accurate.

Having Scrivener generate a ToC is easy.  Select your first chapter in the Binder, then hold down the Shift key and select the last chapter and scene.  This will select all of the contents of your book in the Binder, minus the front matter.  With all of the content section selected in the Binder you can now have Scrivener copy the selected chapters and/or scenes to be used as your ToC:

Selected Binder

I hope you caught the hint in that last sentence… you can copy just the parts you want to be included in the ToC.  If you want to remove a few things, or only select a few sections, you can hold the Control key and click on items to add/remove them from the selection.

So let’s say you just want the chapters, and not the scene titles contained as sub-items in your chapter folders.  Easy.  Just collapse all of the chapter folders in the binder before you select everything.  Or, to select everything, expand all items first.  It’s really up to you.

Once you have the items you want in your ToC selected go to “Edit”, “Copy Special”,  “Copy Documents as ToC”. Now you are ready to rock-and-roll:

Copy Documents as ToC

Now go to your front matter and into the text you have chosen as your Table of Contents and simply paste.

Pasted ToC

Nice! But this was the easy part.  Make any formatting changes you wish to do here.

Table Of Contents For Kindle

If you are exporting to e-readers get rid of the page placeholders (“<$p>”) and the dotted lines to the left of them.  The concept of “pages” doesn’t really exist within e-readers, and although they typically only present single pages at a time each page holds different amounts of text depending on the device and user-defined font size.  “pages” are a fluid concept on e-readers;  You don’t need or want them in this case.

But we are assuming you want to export with page numbers to a PDF or Word document, so let’s continue in that direction…

Exporting With A Clickable Table Of Contents

If you have a compatible version of Office installed then you are probably good to go after configuring the “Export Converters” in the Scrivener options.  To get there go to the toolbar, select “Tools”, “Options”, and then the “Import/Export” section:

File Format Converters

With that all configured correctly you would expect to be able to export as PDF and have it working without issue, but we are assuming you (and I) don’t have Office installed so we have to take a different route.

What you want to do, once you have everything formatted and configured how you need it to be, is export as a DOC file (possibly even DOCX).  Go ahead and do that.

Since we don’t have Office you may be like myself and have Libre Office installed, so you can try to open this file and it will open… but not correctly.  All will seem fine, but the page number placeholders will have been replaced with the incorrect page numbers:

Exported as DOCThose aren’t the correct page numbers, at all.  Scene 1 starts on page 2 in this example file.  With fully-fledged projects that have multiple chapters and numerous scenes I found that even though the page numbers were wrong most of the links themselves worked… except, some randomly didn’t, and I couldn’t figure-out why.  I suspected that Scrivener wasn’t exporting correctly, but then came to understand that this wasn’t the answer.

As best as I can tell it’s an issue with Libre Office trying to handle internal links in DOC files and only sometimes getting it right, and THAT’S THE KEY. Scrivener has created a correct DOC file, and the page number placeholders and internal links work, they just don’t work in Libre Office – despite the suggestion in the manual that Libre Office may be able to cope.  If you had Microsoft Office installed you’d have no issues right now, but you don’t have Office and are stuck with a DOC file that isn’t being opened correctly.

Here is a list of what you need to get around this problem:

  1. Microsoft OneDrive

That’s it!  I already had OneDrive because of my Hotmail accounts, plus I also have Microsoft OneNote installed which installs OneDrive onto your Windows machine so that you can drag and drop files.  In case you aren’t aware of what OneDrive is just think “Dropbox by Microsoft” (in fact, you can link a Dropbox account to your OneDrive account, apparently – I’ve seen the option but never used it since I don’t have a Dropbox account).

OneDrive & Word Online

After Scrivener has output your DOC file just get it to OneDrive, whether that means emailing it to your own Hotmail account, or drag and dropping it into the OneDrive folder on your computer… just get it there.  Once the file is sync’d with OneDrive and is uploaded you can now open this file with Word Online, and that’s the real gold!

Once in Word Online select on the left-hand menu “Open in OneDrive” to see all of your OneDrive files.  Click your recently created DOC file and it will open for viewing.  This is the body of the document once I’ve opened it:

Uploaded to Word Online

Ignore the new “Scene 3”; I was messing-about in Scrivener while typing this and forgot to remove it.  If you hadn’t noticed it… never mind.  Carry on!

At this point all of the placeholders are now a different type of placeholder – the lovely “?” placeholder.  Don’t fret as that’s not a problem.  You are so close to being finished right now!  You have nothing more to do except ask Word Online to “print” this document for you, and that option is in the top right corner of the Word Online window:

Word Online Print

After a few seconds of Word Online processing the document it will present a link to the newly created PDF:

Word Online PDF Is Ready

Click the link and you are done!  Either the PDF will open in your browser, or it will download to your computer to be opened by some other PDF viewer.

Open the PDF and you’ll find that the placeholders are now filled with the correct page numbers, and they are all clickable and take you to the correct places within the PDF.

If the PDF opened in your browser find the button that lets you save the file to your computer and go ahead and save it.  Probably even stick it back in the OneDrive folder for safe-keeping.

You Have A Clickable Table Of Contents

Congratulations!  You now have a PDF of your Scrivener project with a clickable table of contents!  Scrivener for Windows doesn’t make it a truly simple and fluid process when you don’t have the right version of Word installed, but with the right file type (DOC) and a little help from Word Online you can have a PDF with a working ToC.

Posted in Blog Tagged with: , ,
One comment on “How To Create A Table of Contents in Scrivener for Windows
  1. Quinton Trisler says:

    Great site. Cheers for posting

Leave a Reply