Latex headings

Hi,

I am trying to compile for multimarkdown-> LaTeX. I was hoping to use the feature whereby the titles of text or folders become the appropriate \section{}, etc in the LaTeX. In the compile dialogue I have set the sections I want to include Titles and text from, but when I look at the LaTeX (or the MMD) the titles are included as un-marked up text. I’ve attached a screenshot of the formatting pane, as I have it set:

Note that the headings are not the kind of things I want to use as section headings at the moment, as I’ve discovered I can add html comments like this: and have been using that for the sections. Still, I’d rather do it the “nice” way, if I can.

These settings look good from what I can see here. There are a couple of things that could influence the situation from outside of this panel:

  1. Replacements: since headings are marked with hashmarks and hashmarks are text, search and replace commands inserted into the compile process could conceivably generate text that is no longer a valid heading. A very simple example of that would be to search for “#” and replace the character with nothing.
  2. The items you are compiling have had their “Compile As-Is” checkbox set. This disables anything that the Formatting panel would otherwise do to that item, meaning it will always print its text content and nothing else. This is probably not the problem since As-Is would even inhibit the bare Title text from being exported—assuming that text isn’t in the main text content for the item of course.

If neither of those seem to be the problem, I would try a little simplification. You can save your current compile settings as a project preset using the manage option at the bottom of the Format As drop-down menu. From there, choose something like “original”, and then going into the Formatting pane and do the simple Opt-click trick to enable titles on the three icon types (I would leave it extremely basic like that for your first test). If that works, it may be easier to build your settings back up from there than it is to weed out where this is coming from.

Thanks for the response, AmberV. Neither 1 nor 2 was causing any problems, as far as I could tell. There were no replacements programmed in the replacements panel, and no items had their “Compile As-Is” checkbox set.

Making a backup of the compile process and starting again from scratch appears to have solved things, though. I’m not sure how I got to the settings I was using. I was poking about with things, as I do with all new software.

As a side question, will “Compile As-Is” leave the text written in the Scrivener editor entirely untouched? I really like the outlining, annotation and management features of Scrivener, but I am comfortable enough with latex to just type latex in the editor. Being able to combine the two in this way would be fantastic.

Strange indeed, I played around a bit further and the only thing I could come up with was this combination of features:

  • In Section Layout, under the “Title Appearance” tab, check off Insert title as run-in head.
  • In the “Title Prefix and Suffix” tab, add two carriage returns to the Suffix to essentially undoing the above.

Who knows, maybe that was it, or maybe some other odd combination is lurking in there.

Scrivener will, yes, but that is not the same as saying MultiMarkdown will. The content will still matter, as Scrivener won’t insert around the document in order to signal to MMD that this section of text should be handled verbatim. What this flag does is opt that document out of what the Formatting pane does. With that pane you can even have some items not export their text, or add things like document notes. A document flagged As-Is would just print the text from the editor no matter what, no added title, no added meta-data—and with rich-text folk, it also means the body text will remain formatted as they set it up in the editor, too, rather than having the compiler normalise the formatting. It’s a way of breaking out of the strict outline-based style system for exceptions—like a bunch of short sections that should read as one unbroken string of paragraphs. Maybe you as a writer want more outline than the reader will need, that sort of thing.

If that’s what you’re looking to do, then the regular old plain-text option in Scrivener may be the best approach. You do miss out on a few things, because that truly is plain-text—no footnote feature, no inline images, etc. I mean you can use the things, they just won’t export as LaTeX syntax—it doesn’t know anything about that and can only generate .tex files thanks to MMD.

That aside, you do still get a lot of potential convenience. You’ve already been exploring the Formatting pane’s prefix and suffix features, with plain-text you don’t have to work around hashes, you have a clean slate. A simple example, you can set level 2 files to have the following:

Prefix:

\section{

Suffix:

} \label{<$title_no_spaces>}

The code in angular brackets is a Scrivener code that will insert the title of the document without spaces. Now if you compile a file with the name, “Installing Ruby Gems”, the compiler will print:

\section{Installing Ruby Gems} \label{InstallingRubyGems}

Thus you could map your binder outline to ToC entries in the final output, among other things. Replacements of course provide a lot of flexibility, especially once you dig into the more advanced uses of it. For example here’s an easy way to get around the lack of a footnote export with plain-text. Of course one can just type in \footnote{too}. :slight_smile: I’m an MMD-head though, so I am inclined toward shortening syntax and processing short form to long form in one sweep.