Turn off Autonumbering during Compile

My Scrivener text has hard-coded section numbers within the text. When I compile, additional numbers are added to the hard-coded section numbers. I see how you can add autonumbering in Scrivener, but I don’t see how you can turn it off. I found this comment searching the forums:

"Keep in mind that Scrivener can do auto-numbering as part of the compile (output) process. "

but unfortunately there was no explanation as to how this can be turned off.

As a follow-up, it looks like when I imported text from an rtf file importing also brought in auto-numbering. There doesn’t seem to be any way to turn this off either. Since there are 90 or so sections, retyping them all isn’t really a solution. If I dump the text into Emacs and bring it back in I’ll lose the other rtf formatting, such as lists, which is required.

In the “All Options” area of Compile, check out the “Formatting” pane > Section Layout… It sounds as though you are using a compile format that is set to insert auto-numbering as a title prefix, and you can edit it or remove it there.

You increase your own workload doing that. Insert/delete a section and you not Scrivener has to recalculate those numbers. Rather than taking the numbering out of the File > Compile > All Options > Formatting > Section Layout it would be better to leave them there and take them all out of the text.

As Aristotle said, “not even God can change the past.” What’s done is done. Is there a way to edit styles to remove the autonumbering?

Keith, thank you for responding. In the Formatting Section in the Compile dialogue, under Formatting=Section Layout=Title Prefix and Suffix, I found the following code:

Chapter <$t>

I deleted this, but am getting the same result. The original Scrivener text looks like this:

1 South America
1.1 Countries
1.2 Cities

and the compiled result is:

1 1 South America
1 1.1 Countries
1 1.2 Cities

Additionally in Compile, under “Section Type” Level 1 (folder) is checked, as are “Level 1” (multiple pages icon) and “Level 1” (single page icon).

This text came via Word=rtf=import. The autonumbering is still present in the rtf, but I don’t see a way to edit it out in Scrivener.

This is for an e-book compile. I have used both the default as well as custom settings.

Yes, if I were starting from scratch I would not have included the evil autonumbering, but it was in the document to start with.

Have you checked the Section Layout for EVERY level individually? Removed all the prefix tags in each level?

[attachment=0]sectionlayout.png[/attachment]

Your suggestion didn’t work. I thought that Formatting=Section Layout=Title Prefix and Suffix were global options, but they’re not. There were two undeleted instances of the “Chapter <$t>” code. Nevertheless, upon removing these two instances and re-compiling the autonumbering behavior described above remains:

Draft:

  1. Continent
    1.1 Countries
    1.2 Cities

Post-Compile

1 1. Continent
1 1.1 Countries
1 1.2 Cities

Editing the style, Format=Formatting=Redefine Preset didn’t work either to remove the added section numbers. I redefined both the headings and the subheadings to plain text and the compiled behavior was the same.

Possible to post screenshots of the Contents and Formatting windows from your Compile settings? Might give clues to what is happening. In particular, the dummy formatting pane should show if numbers are still being generated automatically. As you can see in the screenshot I posted earlier, there is no number before the word Title. Do you see numbers when you check the different levels?

Sure.

Anyone?

Apologies for not replying earlier: work.

I have never seen a set-up like yours, and therefore do not understand where the numbers are coming from.

Projects are usually split into sections. For example, the folders in the screenshot below are chapters and the text files are sections inside the chapters. When compiled, the folders are allocated chapter numbers. The text files are not numbered.

You have everything in one text file?

[attachment=0]compile.png[/attachment]

Maybe have a look in the Replacements section of Compile - see if there are any extraneous entries there? :question:

Edit: and just to be sure, you don’t have any numbering placeholder codes scattered about in your text do you? Things like <$n> <$p> <$hn> or similar?

I hadn’t notice what Briar Kit did that you have exactly one document in your project. Are you absolutely sure that the problem doesn’t originate from the Word document that you imported into Scrivener?

Briar: ({S}ome of )the numbers are created by Scrivener during Compile, as shown in the example.
Everything–that is, the entire project–is in one text file. That project file was created in Scrivener by importing a text. Starting with Word=Save As .rtf; then, in Scrivener, File=Import. Everything is in one text file.

This is somewhat of an unusual project in that the imported text file did not need much work after importing into Scrivener. It’s ready to go. Thus, there is no need to start with sections, extra folders, etc. If I’m starting from scratch I might add these either as I go along or at the beginning of the project.

SarsenLintel: thank you for answering. There are no Replacements called during Compile.
Code such as <$n> does not appear in the body of the text. However, I don’t know how to turn on hidden characters in Scrivener. There is nothing along the lines of “\chapter” or “\section” as in LaTeX (these would add numbers to a chapter and section, respectively. The command would not print.

reepicheep: Thank you too. The problem could well originate with the Word document and however Scrivener imports such a document after its conversion to rtf. The numbering:

–in the Word document is correct.
–in the rtf document is correct.
–in the pre-Compile Scrivener document is correct
–in the post-Compile Scrivener output document is incorrect.

This suggests that the problem is with Compile. In fact, I can’t replicate the problem except by Compiling.

Scrivener is a superlative first-draft document creation tool. Its Compile function is very powerful and so Scrivener can be used as a document output tool as well, generating both ebooks and pdf’s (a pdf can be an ebook as well, but most people think pdf’s have to be either A4 or letter size. They don’t.).

If there is something in the Scrivener Import function that is creating this anomaly, I have no way of figuring that out. But this is not a complex document: there are no tables or figures. There aren’t even any numbered or enumerated lists. The section headings came across as bold. The Table of Contents came across as blue links. By “came across” I mean, “after import.”

Is this a bug in Scrivener? Do I get a $2.38 check, like the famous checks from Donald Knuth?

Morning

To show invisibles…
Format > Options > Show Invisibles

What format are you compiling to? If you try other formats, do the same additional numbers appear?

(I wondered if you were compiling back to Word or RTF and then opening in Word, in which case the numbers might be being generated by Word rather than Scrivener. However, I am doubtful about that as your screenshots show a compile to ePub.)

If you tick the AS IS option in compile (in the Contents pane), does that make any difference?

Thank you for locating the “show invisibles” option. Unfortunately, this does not give style information and all I see in the Scrivener project text are blue paragraph marks.

As you noted, and as per the uploaded images, I am compiling to epub. I haven’t tried compiling to any other formats.

Ticking “As is” unfortunately does not solve the problem. The phantom “1” is added to the sections in the Scrivener project text and at the beginning of the Table of Contents.

I know that there is little Styles support in Scrivener and no way to edit them. Add to them, yes. Delete them, yes. Rename them, yes. My guess is that there is something going on with Styles closer to the machine that is causing this issue.

Yesterday I would have been confident to say that the problem is due to my own ignorance but now it seems to qualify as a bug, especially after reading the helpful comments by people in the forum.

I thought that Keith was stopping by here–he commented before–so perhaps someone could advise me as to how to submit a bug report.

As a workaround I’ll save the file in plain text (LF’s don’t show up as invisibles), re-import and manually number all the sections. Sigh.

For those who have asked why you would let external programs hard-code section numbers or have to refer them manually, here’s an example.

"Section 1983 et seq. provide the following remedies:

  1. Free bubblegum for all.
  2. Free baseball cards for all.
  3. Unlimited return of used video games. "

Note that the numbering begins not with 1 or 0 and is not sequential. If you have to typeset laws in your document/project this comes up all the time. It’s even more exciting when the laws are not properly numbered themselves but still have to be quoted exactly–you can’t assume that the error was fixed and not enacted as written. But this is off-topic and also addresses the “why just one folder?” question as well.

I also understand that the Mac version of Scrivener is closely tied to OSX document processing internals. I also have a Windows license but I haven’t tried to compile on Windows. Maybe that’s a solution.

Update: changing the document import engine to Aspose eliminated the pre-import Table of Contents leaving instead the legend, “No Table of Contents Entries Found.” Compiling the project resulted in the same pesky phantom additional numbering entry for each section.

Nothing seems to work.

Hmm… I’ve read a few posts where people had formatting problems that boiled down to they had copied some text off the web and when pasting into Scriv some invisible html formatting codes remained. But you imported, so I don’t know if that could still be happening in that case.

Maybe try this just to see if it makes any difference:
First, make a duplicate of your document in your binder so you can try this non-destructively.
Now select the copy, and Documents | Convert | Convert Formatting to Default Text Style.
Compile that - any difference?

Or possibly, in the duplicate file remove the problem sections, now go back to the original in Word and copy that section, paste it into Scriv using Edit | Paste and Match Style

Note - it might be easier to work on these sections in isolation rather than as part of a larger doc. I would create a Test folder in your binder, then Import and Split your original into that folder. Split at ¶ so that each paragraph becomes a separate document. Then you can work on and compile only the problem sections - might help you narrow down just what the heck is happening.

At this point another thing I would probably try is compile to HTML and then open the file in TextEdit (or your favourite HTML editor) - maybe viewing the code will provide a clue as to where the numbers are coming from.

To submit a bug report, send email to mac.support@literatureandlatte.com

It would be helpful to include a link to this forum thread, and a copy of the project. (To email a project, use the File -> Backup -> Backup To command, and check the box to create a ZIP backup.)

I agree with the suggestion of the Convert Formatting to Default Text Style command.

You might also inspect the original text in Word to make sure that it doesn’t have any hidden field codes or something like that. I’m not sure what the importer does with codes it doesn’t understand – if it just passes them through unchanged, that might explain what you’re seeing.

Katherine

This worked:

Re-open the original Word file in Word. Then:

  1. Press Alt+F11. Word displays the VBA Editor.
  2. Press Ctrl+G. This opens the Immediate window. (If you get any other type of dialog box, such as the Find and Replace dialog box, then you aren’t working in the VBA Editor; you are still in Word. Close the dialog box, make sure the VBA Editor is active, and then repeat this step.)
  3. Type the following in the Immediate window:

ActiveDocument.Range.ListFormat.ConvertNumbersToText

  1. Press Enter.
  2. Save document.
  3. Open a new blank Scrivener project.
  4. Import the file.
  5. Compile file.

Extra or phantom section numbers are gone.

(Thanks to: wordribbon.tips.net/T010248_Conv … ering.html)

I’m posting this answer here because autonumbering is a word not found in the Scrivener manual (placeholder text is used, but as one poster pointed out, instructions for their use are absent) and none of the common compile suggestions worked.

In Scrivener’s defense, this is hardly intuitive in Word, either. The autonumbering codes survived a “save as” to rtf, so rtf is a culprit as well. Exporting to plain text eliminated them, but also eliminated all of th section headings.