Creating a basic document wiht sections/subsections, etc.

I’ve been using scrivener to write documents for work (almost at the end of eval period, and this issue is of prime importance to me).

I tend to write either in the LaTeX or the MS-Word Outline Mode school, where the document is a series of sections and subsections and the “leaves” are body text.

Scrivener is, obviously, quite good at this sort of thing.


when I export to HTML or RTF, I find the output largely unreadable and unusable. The defaults for headings and sections don’t make any sense, and even if I tweak them, I cannot get great output.

For example, there is no section numbering, or table of contents. Also, the hierarchy I painstakingly created in Scrivener is completely lost and not apparent at all.

The LaTeX export looks OK, but I really want a quality HTML export at least (without putting it through the latex2html super-mega-ugly filter). IT seems a no-brainer to at least use H1-H6 for headings in the hierarchy, but instead I get a big mess of courier fonts and no organization really at all.

Any hints to help me get something a bit better out of this?

First off, are you using the MMD->XHTML exporter, rather than the standard HTML exporter? That is an absolutely essential step if you want clean HTML syntax with real headers (levelled according to your Binder layout, of course) and whatnot. Since you are already doing LaTeX exports, you should be set up for that just fine.

If you do go that route, then a default stylesheet will be applied. This stylesheet is derived from your export format settings (this is where you Courier look is no doubt coming from), which can be found in the export sheet; last tab. But, if you are picky at all, you probably are wanting to do your own stylesheet. The built-in is just there so that the vanilla result doesn’t look like Netscape 1.0.

Adding an MMD meta-data header called “CSS” and supplying a valid URI to your preferred stylesheet is the best method. You can also use the “XHTML Header” meta-data value to put a section right into the exported document. I do not recall if that conflicts with the built-in styles. I remember at one point it did, but I think it got fixed. Be careful with carriage returns if you use this method. Try exporting a raw MultiMarkdown file and check it in a text editor see how the meta-data section should be done.

Addenda: You should know that LaTeX files are actually derived from this XHTML file. The scripts use an XSLT to transform the XHTML structure into valid LaTeX. So using the mega-ugly latex2html would be totally pointless and lossy.

Awesome. That helps a lot and a quick removal of the < script > section cleaned things up (I feel silly for not having thought of that).

Two problems still remain, though (these are all via the “Markdown” methods):

  • lists are basically removed - the LaTeX output doesn’t use {itemize} or {enumerate}, instead just putting the bullet symbol in as high-bit (which I assume will make LaTeX barf, but I don’t have it installed to check, in either case, it won’t result in a bullet list). The HTML is the same way and the rendering is just in-line with bullets, no lists.

  • The HTML output incorrectly puts high-bit special symbols in (such as quotes). It should use the appropriate &xyz; format, but instead just puts the high-bit character in literally (or convert it to an 8-bit character).

  1. That doesn’t sound right. You are using the proper Markdown syntax for your lists? One thing you have to remember is that the exporter out of Scrivener is very basic. It does not read any rich text cues at all. This can actually come in somewhat handy in certain work-flows.

  2. It sounds like you need to set up your typography section to be more “text friendly.” Try turning off smart quotes, and all of that stuff. SmartyPants will handle that for you, and turn everything into the proper codes.

Hmmm. I’m using the RTF “ruler” and using the “lists” drop down to create bullet lists (just as you would in TextEdit, e.g.). I don’t really know what MarkDown is other than it shows up in the list of exportable file types. I guess I’d assumed that if I could create formatting in the text editor, it would be preserved on export to non-RTF formats. Is there some other way to create bullet lists in the text editor (I’d be happy to avoid the RTF way, as it easily get screwed up)?

As for hi-bit characters, I don’t have a problem with them and I saw how to disable them, but I think if they ARE enabled, they should be rendered appropriately (or if there is no way to do so, they should be automatically omitted/translated to lo-bit). It’s a nit, for sure, but I think that, at least for HTML, it’s a very simple fix (e.g. for any hi-bit character, render it as an HTML entity using its octal value).

I recommend checking out Scrivener’s documentation and reading the MMD section if you intend to do much with it. The syntax for Markdown is incredibly simple. Making a list is no more difficult than:

*   Bullets are made like this
*   And so on...

Or an enumerated list:

1.  Using numbers tells the MMD engine to create a numbered list.
2.  It doesn't really matter which numbers you use though, it will sort it all out.

While it may look as pretty, I definitely prefer making lists this way, as I can just type them out instead of having to muck around in rulers. Incidentally, you will want to bold and italic like so, instead of using RTF bold and italics.

The documentation has a link to the Markdown syntax page, as well as Fletcher’s MultiMarkdown pages.

Some characters can be converted in the export phase. In the “Text Options” tab of the exporter sheet, you’ll find a section that will convert typographic quotes back to straight quotes, as well as some other options. You wouldn’t want to rely on these though. It is better to type them in yourself. I think Scriveners em dash to ASCII converter uses two hyphens, for example, and in MMD you should use three, because two hyphens creates an en dash.