MMD > LaTex running out of levels

Hi, Scrivener is a super tool, and I’m currently exploring it.
I’ve run into a problem while compiling my thesis.

My thesis has folders, text folders… So it has 6 layers.
When I compiled it I got an error ( Undefined control sequence \chapter )
because my LaTex template is an article it has no chapter, but I could fix it (by Base header level) thanks to AmberV’s solution in this post:

Only that when I compile now my level 6 content is like “Scraped surface heat exchanger}” Lvl 5 is like “\subparagraph{5V Line}”.
I know it’s because LaTex articles only have section, subsection, subsubsection, paragraph, and subparagraph. Only 5 levels.

I worked around by setting it back to Base header level 2, and as I only have 2 chapters (introduction/methods) this way, so what I can do is I replace \chapter to \section (I only have two chapters so the resulting structure would be closer to the original than messing with the bottom subparagraphs)

Is there a way to automate replacing the chapters to sections, or have another solution to my problem?

This is an issue that I ran into myself with the user manual. Even though I’m using a full book document type, there are many cases where the indent level exceeds six (sometimes by a fair amount). I’ve attached the Section Type schema used by the user manual, which you can import into a project to examine, via the Project ▸ Project Settings... dialogue, in Section Types (you’ll probably want to do that in a test project, as it will overwrite your current settings, though can just cancel the dialogue when you’re done looking at it).

User Manual - Section Types (2.6 KB)

At first you’ll note that I don’t always follow all of my advice from the other thread. :wink: There are some special things going on in the manual that require a little more than just pumping out hashes. For example the Part level page breaks have epigraphs on them, which needs to somehow be added to the output in a way that wouldn’t be done for any other level, and chapters often have a chapter content page that also requires inserting special code, etc.

The generic “Section” type is what most closely matches the stock Markdown heading structure. So what I’ve done is increased those up to level six, and then capped all deeper levels using a “Minor Subsection” type. In effect, I can then use more outline depth as a function of writing than I need, or could feasibly use, in the output.

Now for the implementation: the Minor Subsection type is using a Layout called “Paragraph Heading”, that I created for this purpose. It sets the Markdown hash generation to “None”, and I instead use the title prefix and suffix fields to insert around the binder title:

`\paragraph*{`{=latex} <TITLE> `}`{=latex}


So that is how you could get around the problem while using base header level 2 (which you should use for an article). I don’t have a use for subparagraphs, so I’m fine with stopping there, but you could of course tweak this to whatever you need, or even use your own custom environment for the bottom level of the outline.

1 Like

Thank you so much for the detailed answer. It solved my problem. I set it up like in the picture.

It’s so easy to write in Scrivener. Already recommended it to some friends for their theses. Gonna have a short webinar of my setup today.

Although, I have to use base header level 3 else the level 1 folder would generate as /chapter and would give me an error later in LaTex.

1 Like