Some doubts about using MultiMarkdown with Scrivener

My apologies if what I’m asking is very easy to find. I’ve done a little searching through the documentation but I haven’t found an answer.

OK, I have to start using LaTex for a project I’m working on. Since I already use Scrivener and there is a way to convert documents to LaTeX via MultiMarkdown, I thought I would give it a try. Many of my documents are already formatted (in the limited way Scrivener allows you to format them), so for instance I have used boldface and italics and I have examples that are formatted in the following way:

(1) Example 1
(2) Example 2
(3) Example 3
etc.

The first question I have is if there is a way to convert all of this formatting to MultiMarkdown codes. I see there is a built in functionality via Format > Convert > Bold and Italics to MultiMarkdown syntax. This would already save me a long time except for the fact that it doesn’t appear to work for a whole project. I can only make it work for each one individual document. As I organize long books and articles by dividing them up in a large number of documents corresponding to chapters, sections and subsections, having to go document through document would involve quite a long time.

I’m I out of luck? That is, is the only way to create LaTeX documents from Scrivener formatting them with the MultiMarkdown (or directly with the LaTeX) syntax from the very beginning?

The other question I have has to do with the LaTeX output I’m getting for certain formatting. For instance, I’m loosing all of the “carriage returns” in my examples. When I compile the Scrivener project, the output document has my examples like this:

  1. Example 1 (2) Example 2 (3) Example 3

Also, if I have a word or a short sentence indented with a Tab, I get the following LaTeX code:

\begin{adjustwidth}{2.5em}{2.5em}
\begin{verbatim}

Tabbed text

\end{verbatim}
\end{adjustwidth}

This results in a change of font which I imagine one can configure via LaTeX.

If the questions I’m asking have a very obvious answer which is documented somewhere, please point me to such document. Otherwise, I would really appreciate any help you can give me with this. Thanks in advance.

JM

On your specific queries:

To convert the bold and italic to MMD in one shot, try selecting all the documents in the project and then using the convert feature.

For the carriage returns, MMD (and Latex) don’t recognise one as enough. A paragraph has to have a blank line separating it from the next one, otherwise they get run together. The only exception to this is bulleted lists, which can sit without a blank line between each one. I’m afraid I can’t at the moment remember if there is an easy way of converting the single return to a double one.

The tab at the start of the line sets up a code block (the verbatim environment in latex). I’m afraid you’ll just have to get rid of them.

On the general point, if you have to turn out a latex document from text already in Scrivener then I think the MMD route is probably the least painless. You are rather in the ‘I wouldn’t start from here if I were you’ category, but the amount of work to convert your text for MMD is surely going to be less than the time required to take it all the way to Latex by hand.

Finally, if you haven’t yet looked at it, do check out the beginners guide here: viewtopic.php?f=21&t=17239. It addresses most of the basic issues for going from Scrivener to Latex via MMD.

To convert one carriage return to two, you can use the Replacements tab of the compile settings. Add a Project Replacement, where the “replace” values is
OPT-Return
and the “with” value is
OPT-Return-Return
… that is, hold the OPT key down while hitting the Return key twice.

That WILL mess up your bulleted lists, however, so you may have to use the same trick with “Project replace”, and then go back and remove the extra lines between list items by hand.

Thanks MrGruff and Robert!

I certainly don’t like to be in the “I wouldn’t start from here if I were you” category but with what you guys have told me redressing the situation might not be as bad as I thought.

For the conversion of bold and italics I was just selecting the main folder assuming that this would automatically select all the subfolders and documents contained in it. That didn’t work but selecting all the folders as you suggested worked like a charm.

I don’t have a lot of bulleted lists but I do have many examples so Robert’s tip is going to save me a lot of time as well.

Thanks a lot for the guide you wrote, MrGruff! This is going to be very helpful. While we are talking about guides, I have a question for Robert: where would be a good place to find the key combinations corresponding to the different formatting codes? The key combination OPT + Return has worked well to replace one Return for two returns but I have tried the key combination OPT + Tab to eliminate all the tabs and replace them with either nothing or some character and that doesn’t seem to work. I checked the Scrivener manual but in the section for ‘Replacements’ they don’t say anything about replacement of formatting codes.

Again, thanks a lot for your help.

JM

Are you saying that OPT-Tab doesn’t insert anything in the “Replace” column, or that it doesn’t get rid of Tab characters when you compile? Are you sure you’ve got tab characters in your documents (instead of an auto-indent ruler setting)? Try doing a CMD-f (find) on a Scrivenings session and see if it locates Tab characters that way.

It turns out what happened was that I had a running app in the background that had the OPT-Tab key combination assigned so that when I used it within Scrivener it didn’t work. I quit this application and now everything is as you would expect. Thanks!

JM