Compiling the Table of Contents

I am trying to figure out the best way to compile my Table of Contents.

By default, it exports As-Is, as the section type is a “contents page.”

In the editor, all the titles appear on the left, with the right indents, which I determined.

When I compile, it automatically adds the chapters/subchapters… thanks to the title prefix <$hn> in the “decimal outline item.”

So far, so good.

What I do not understand is why all my titles are pushed to the right end of the page, which is not really what I would call “as-is,” since, in the editor, they are exactly as they should be.

What can I do to avoid this?

I saw on an old (2018) thread that there was supposed to be a special layout for the ToC, but I cannot find it.

(Sorry if I am not too good at using this forum. This is the second time I post on an old conversation, thinking that maybe it is better not to multiply the threads, but maybe it is better to start a new one. I am not too sure in which case it might be better to just continue an old conversation.)

(Moving my response over here, since yes, I don’t think the previous thread has much to do with what you are seeing; though ordinarily yes, you are welcome and encouraged to continue conversations about the same topic no matter how old. It’s better than having the same conversation 15 times over 15 years.)


When I compile, it automatically adds the chapters/subchapters… thanks to the title prefix <$hn> in the “decimal outline item.”

If you’re using the “Enumerated Outline” format, as it sounds like, that one wasn’t really designed with the thought that anyone would build it up to make a long text document in need of having a table of contents. You’re of course free to do so! Anything can be built (or deconstructed) from whatever, and all of them started from scratch, but that would explain why there is no “Table of Contents” layout! That would be an odd thing to have in a format designed to generate simple outlines of your binder structure, not books for instance.

Not that you particularly need one, in a global sense, either. The “Paperback” format has one because it is creating a layout that is half the size of most paper settings, meaning most anyone’s tab stops and indent settings will be very wrong, made for A4 or whatever.

What I do not understand is why all my titles are pushed to the right end of the page, which is not really what I would call “as-is,” since, in the editor, they are exactly as they should be.

I couldn’t say with only a rough description being provided. I like to describe building the problem from a Blank project, so that every factor necessary to demonstrate is involved. Either that or provide a small sample project that demonstrates the problem.

That aside, “as-is” isn’t a promise. If you try to jam 18cm of content into a 8cm page, it’s going to not look the same.

1 Like

Thanks you!
I understand what you mean about “as-is,” yes. It makes sense.

Could you please tell me what I should provide so that you can identify the issue ? Should I just compile the ToC and upload it here?
In any case, that will be tomorrow because I’m in France, and it’s getting really late…

This is fine, I am in Galicia, just below you, so I am about to call it a day as well. :slight_smile:

What would be best is if you can use “Save As” to make a disposable copy of your project, and just cut out everything except the ToC page basically. You can even scramble the words if you want and change your name in the compile settings.

Or if you’d rather less work, feel free to send a copy of the whole project, if it isn’t too large, to my personal inbox to keep it out of the public. Just click on my avatar and you’ll see a “message” button.

1 Like

Okay, thanks for sending the setup, that helps a lot as I can just look at the settings and see what is going on immediately. Here are my notes:

  1. You have indents in your original ToC to show major and minor sections. If you want to keep those, rather than having a flat list, then do so in the lower right corner of the Formatting tab in Section Layouts: click the brush icon and enable the Preserve indents setting.
  2. Now for why the page numbers aren’t aligned right, there are too many tab stops in the body text formatting, which you can see by clicking into the gibberish text in the Formatting tab. The Tab spacer being inserted after each ToC title (back in the editor), is meant to hit a right-aligned tab on the right edge of the page, so it won’t work if there are bunch of left-align tab stops in the way—even if there was a right-aligned tab, which there isn’t.
  3. What I would suggest is to look at how the original text’s formatting is designed, just put the cursor on a flush left line, like “Introduction”, and use the Format ▸ Paragraph ▸ Tabs and Indents... menu command. See how this line has one single 15.87cm tab stop, which is set to right alignment? The measurement might be different depending on your paper settings and margins in the compile setup. If you make it too wide, often the result is for the number to drop to the next line.

So, this kind of illustrates what I was saying before, about how it’s going to be a bit tough to start with a compile format designed to print a basic outline of your binder titles, and work all the way up to a thesis or book design with it. Nothing is set up yet (or set up intentionally wrong for that, like having no page numbering or running headers), and that will mean problem solving and investigation will need to be done for almost every facet.

As a learning exercise, starting with nothing can be very good, but you’ll have to be ambitious about wanting to do that as a thing in and of itself rather than a more practical task of just trying to get a thesis out.

Well that’s my opinion on it anyway. To me it seems like it would be a lot less work to start with “Non-Fiction Manuscript (Times)” and add or change the few things you want different, such as single-spaced lines, the “<$hn>” counter instead of the “Chapter One” style counter, and so on—then it would be to copy all of the subtle little things it has set up, into Enumerated Outline.

One other thing worth considering is that if I were needing a table of contents, I wouldn’t be using this feature for the final version of it. It’s fine for quick proofing, but you’ll get better looking and more dynamic result by using a word processor ToC. In another post, I provide an explanation and some instructions on how to do that.

1 Like

Hello Amber,

Thank you very much!

  1. I have clicked on the brush icon. Much better with the indents, BUT something strange happens: the line is justified, with my titles spreading over the whole width of the page… and a line of dots and the question mark on the next line.
    How did this happen, I don’t know.

I have reduced the indents to 5. I don’t need them to be so large anyway.

I have shortened some of my titles, which are way too long.

  1. I did not understand what you mean about the “gibberish text in the formatting tab.” I was not able to locate this. Is there anything I can do to change this?

  2. I have had a look. I have it in inches, and it said 6.25 indeed.
    As I think I understood you meant that this was too large, I tried changing it to 0.25, but then the page numbers do not align to the right anymore.
    I don’t really understand how this thing works.
    Is it just because 0.25 is too little?.. in which case I could run a few tests in between.

I have followed the link to the other thread, and downloaded your file (styled-paperback-6x9.scrformat), but I don’t understand what it is. I can only open it with Word, not with Scrivener.

I have to admit that, as I only have two days left to finish this and still finishing the integration of all my Zotero references for the bibliography, I would prefer to find a way to do the ToC in Scrivener, even if it’s not perfect.
If not, I have to learn how to do it with Word. Not sure I will manage to do this easily/quickly…

EDIT:
Just want to add that, although I do need a ToC, I can make some sacrifices (such as no indent?) to make it work. Perhaps it would make it easier if I made a less detailed version of the ToC too… if my supervisor agrees (not sure about this, I think she wants the whole thing).
I have a feeling that, if I need to do the ToC on Word, this will involve a lot more work, as I will need to go through all the titles and define styles for them so the Word recognises them as titles in order to make the ToC. The Scrivener one may not be perfect, but it works pretty well, apart from a few details.
So far, this is not for publishing, just for the 6 members of the jury.

I did not understand what you mean about the “gibberish text in the formatting tab.” I was not able to locate this. Is there anything I can do to change this?

Sorry, that was not a very technical description. :slight_smile: I meant the sample text in the Formatting tab that is not any language, just letters that look like words.

Is it just because 0.25 is too little?.. in which case I could run a few tests in between.

Yes, I would imagine every title is wider than 0.25 inches from the left side of the margin. This works just like a typewriter does. If you type past the tab stop and press tab, it isn’t going to go back and then print the number underneath or overlapping the title text at the 0.25 point.

You need to pick how far over the tab should go from the left edge of the margin, and for most table of content designs you want the number over on the right side of the page, so a much larger number. Not too far though, because then gets confused and goes to the next line. Maybe 6in will be better? It depends on your paper and margin, just subtract the width of the margins from the width of the paper and make it a tiny bit less than that. Try going down from 6.25 by half-inch increments if that makes sense.

I have followed the link to the other thread, and downloaded your file (styled-paperback-6x9.scrformat), but I don’t understand what it is. I can only open it with Word, not with Scrivener.

The key phrase right above that is, “…You should just be able to import it into your project to test it.” Compile formats can be imported and exported, and you’ll find a checklist for that in §23.2.5, Importing and Exporting Compile Formats.

To be clear, this is a demonstration of an idea, not something you might find directly useful. I doubt you want your thesis to print the size of a small novel anyway!

But what it is demonstrating are those heading styles in the Section Layouts, rather than just using raw formatted text that doesn’t mean anything to a word processor.

It is with those heading styles that you get an automatic ToC.

I have a feeling that, if I need to do the ToC on Word, this will involve a lot more work, as I will need to go through all the titles and define styles for them so the Word recognises them as titles in order to make the ToC. The Scrivener one may not be perfect, but it works pretty well, apart from a few details.

That example compile format demonstrates why that is not necessary. You are already using the compile settings to insert titles, this just shows how to insert them ‘correctly’ so that Word will see them as headings, rather than as raw formatting. Once they are document headings, they would show up in Word’s navigator tool, and that would be used to build a ToC.

While you may not need it now, you may need that later, particularly if this goes into editing where .docx is the file format being passed around. So it’s maybe something to set aside for when you have the time.

1 Like

Wonderful! Now I think everything is very clear.

Thank you VERY MUCH for taking so much of your time to answer me. I need to hand in this thing on Saturday at the very latest!
I will test today with half-inch increments and see what the ToC looks like. I have good hope that this will work, but if it doesn’t, I know now that I can do it in Word and it will recognise my title as titles.

… speaking of which, I’m still confused about what “structure-based” means, and if I should just select this for all my sections, apart from intro, conclusion and contents pages, which are not in the hierarchical numbering… but since I wrote this on the other thread, maybe it’s better for other users if you answer there… if/when you can. If not, maybe someone else will tell me :slight_smile:

This is the first time I have a project on Scrivener, and it was probably ambitious to do it with my PhD thesis, but then again I don’t know how I would have written all this without Scrivener. It is simply an AMAZING tool!

1 Like

If you haven’t done so yet, have a look at the portion of the Interactive Tutorial, in the Help menu, on “Section Types”. This walks you through setting up the tutorial project itself with section types, which you already do know about, but importantly how you can establish a structure for your Draft folder. Structure-based means your outline indenting follows those rules, and things naturally become ‘chapters’ and ‘subsections’ based on how much they are indented.

1 Like

Thank you,

Sorry for not answering before. I had other types of trouble, with the Zotero ODF scan (well, more or less) and absolutely needed to finish my bibliography…

I have just read “Section Types” and the following “compile”. I should say “reread” as I have already gone through this.

I’m sure my compiling could be improved, but right now, too afraid to change anything because I’m afraid of messing up the automatic hierarchy between all these parts. Need to hand this in TODAY, so…

I have not been able to solve the ToC issue.

  • On MS Word, it still spreads the words on the width of the page.
  • On LibreOffice, it is a bit better, but puts the number on the line below, and all my titles are flushed right instead of left. I have tried reducing from 6,25 to 6, 5, 4, even 3, but the only line that changes is the first one (introduction), where the page number just moves to the left instead of being flushed right.

I don’t think I will be able to solve this now. I should have paid attention to it earlier…

Thanks for your help. At least, now, my chapter numbers are indented.

Worst case you can just go through in Word and fix the lines, probably by indent grouping to save time. Sometimes it makes more sense to stop messing about with the generator and just fix the output directly. I do it all the time. :slight_smile: I go back and fix it proper later, but a deadline is a deadline, and there are more important things to think about on deadline day than where your numbers are on a page.

1 Like