Binder Structure Errors in ScML

I am having some difficulties with the organization of my Binder not correctly translating through the Scriviner -> MMD -> LaTeX process to result in correct headings and subheadings. This is frustrating, because as MrGruff’s excellent guide points out, “All you have to do is make sure the structure in the Binder is right.”

As shown in the attached image, my Binder structure is right (or at least, it is what I want as my TOC!) There are three big folders as chapters, each with a number of sections and sub-sections underneath. I also have the requisite leading meta-data document and so on.

Pay particular attention to “Cooling Fan Efficiency” the second heading under the second folder, “In Search of a perfect fan.” This should appear as a header in the document, however, when I compile and look at the resulting .tex file, I get exited hashes for this title (as if the MMD never correctly translated), even though other adjacent subsections come in with the correct LaTeX \subsection and \label syntax.

I can typeset this LaTeX document and looks quite good because most of the headings come through correctly, however, for no obvious reason, some of them–including “Cooling Fan Efficiency”–end up with the commented hash marks in TeX and do not appear in the TOC or text. As indicated by the red arrow in the screenshot of the TOC, the “Cooling Fan efficiency” should be item 2.2, but is missing.TOC.png

I have confirmed that this item is included (with “title”) in the Compile>>Contents settings. When I look at Compile>>Format, both “Low Energy Design” and “Cooling Fan efficiency” appear with identical settings as Level 2 Document Stacks, yet the former compiles correctly as a LaTeX section (including label!), while the later does not. I confess I am quite puzzled. I have tried a number of adjustments in the compile settings, including more and fewer subsections. I’ve also tried adjusting the layout of the binder, changing indenting and switching from file to folder and back again, all to no avail.

This issue reminds me somewhat of Binder structure --> MMD: no # headings? , except I have some headings, just not all of them. It is also a bit like Create Section/Subsection based on Scrivener Structure except that appears to be a Windows-only problem, and I am running on OSX.

FWIW, am running Scrivener 2.5, MMD 3.6, and using TexShop all on OSX. Any help would be much appreciated.

This is just a guess. I wonder if you have that document set to compile as is?

  • asotir

It probably isn’t ‘compile as is’: I wouldn’t expect to see the heading at all.

I notice that there’s something going on a little further up, with the previous sub-subheading ‘pseudo code’ getting the same escaping.

I’d suggest just compiling to MMD and having a look at what that is doing with the headings. Are they coming out as expected (##heading##) or is something else being produced? Perhaps an extra space somewhere?

You might also try compiling without the ‘pseudo code’ document included, to see if that is triggering something.

Thanks asotir & MrGruff. It was not compiling as is (although I spent several fruitless hours trying various combinations) prior to posting. However, exporting directly to MMD revealed the following (This excerpt aligns with my screenshot below):

[code]#### Wiring ####

Circuit diagram goes here.<!-- Whole page circuit diagram?

–>#### Pseudo Code ####

While the physical development was ongoing, the software had to be optimized as well.
By The end of 2010, we had a “bench-top tester” (show picture) dubbed FAN-001 and the first version of the code to run on it.

Insert pseudo-code down here.<!-- Pseudo-code

–>## Cooling Fan Efficiency ##

Intro to CFE

As the progress on Fan version 4.3 continued in parallel with the development of the performance specification, we recognized a need to somehow measure the performance of the PEC fan, compare options, and [/code]
As MrGruff noted, in addition to the “Cooling Fan Efficiency” the “Pseudo Code” subheader is also failing, but many of the headers are working correctly (e.g. “### Intro to CFE ###”). In both failed cases, the close of an HTML comment ("–>") being used to enclose some pure LaTeX at the end of the previous text document is getting wrapped onto the line with the next section, or subsection name, which prevents it from being treated as a heading. This is the error.

This was the consistent source of the problem everywhere, and can be resolved by ensuring text documents do not end with commented LaTeX. I tested adding other text after the LaTeX (works great) or adding an additional line break (also works just fine) even one line break at the end of the text document seems sufficient. By the time we compile to LaTeX it will remove extra and unwelcome line breaks, so go ahead and throw an extra return after some HTML comments to avoid issues with compiling. Best news? TOC looks great: Screen shot 2014-09-24 at 10.23.35 PM.png

Thanks again for the help and suggestions.

Yup, compiling to plain MMD is one of my first go-to tricks when something isn’t working the way I planned for it to.

As-Is, by the way, just suppresses the automatic title if there would have been one (for MMD, for rich text outputs it also suppresses any format override, but that is meaningless in an MMD workflow). I use this for a few things—the menu appendices in the user manuals are a good example. Each menu command is its binder item, so I have a full outline tree of the software’s menu system in the Scrivener project. But, I don’t want all of that subsubheading junk in the output! So I set all of those little files to As-Is and they all become one contiguous text.

It’s also handy if you want to “cheat” the outline, and have a section at a header depth that it wouldn’t otherwise be, based on its Scrivener outline depth. You can just the type the heading in as you need it, with As-Is on.