Scrivener 3.0.3 and MMD to LaTeX Lists

Hello,

after updating to Scrivener 3.0.3, unnumbered list items written in MMD are rendered as ”\item{}” instead of just “\item”.

Problem is, that interferes with item labels. Where I used “- [label] Text” to get ”\item [label] Text”, I now get “\item{} [label] Text”. But this is not proper LaTeX code, as far as I’m aware. There shouldn’t be any curly brackets behind “\item”.

What must I do to get “\item”, without the curly brackets?

Thanks a lot!

I had noticed this as well and wondered what the point of the empty braces were. I’ve never seen any documentation anywhere that describes what would go into such a construct, and have never seen any examples that promote an empty structure. I’m not a guru though, and since it hasn’t messed anything I’m doing up, I haven’t looked into it too deeply.

At any rate; same answer as before applies. Scrivener is simply repsonsible for making sure your “*” gets through into a text file safely. Whatever happens after that point is up to the third-party conversion tool, and problems with it specifically should be brought up in the MMD6 issue tracker.

Now as far as what you could do on our side—using MultiMarkdown file type instead of MMD→LaTeX, and making use of the Processing pane to (a) generate the .tex file and (b) sed to fix the syntax, would work. It’s not elegant, but easier than search and replace in a text editor after compiling every time. :slight_smile:

Thank you very much. Since my current project is my master thesis that I want to finish next week, I took the safe route and went, for the time being, back to 3.0.2.

I haven’t anticipated so much change in MMD6 and thought the way raw LaTeX is handled would be the biggest outward facing change. I guess I was mistaken about that.

Anyway, I found this in the changelog for MMD6:

Could this be a hack to allow “[” as the first character in LaTeX, so that it doesn’t need to be escaped in lists?

MMD6 has a completely new parser, and it follows CommonMark spec more closely, so there are scattered things that just work differently. I came across a few things I had to adjust and do differently after switching over. Outside of the LaTeX boilerplate inputs, the main thing I recall having to change was how I designated lists inside of a definition environment. I like the new way better, it fits in with how things are done otherwise, by putting a tab in front to denote nesting:

[code]Definition term
: Some text.

* List item one
* List item two[/code]

Fletcher answered regarding this, too. The behavior with MMD5 was unintentional and it was corrected in MMD6.

I guess I’ll need to just use raw LaTeX for labeled lists.

Hmm, okay. Well a while back I came up with a style I use for alphabetic lists (using the enumitm package). Basically if you take a set of lines and mark them with a style, Scrivener offers two options for compiling that style: wrapping the entire range in one prefix/suffix, and then each line within that range as well.

So what I have is around the whole style this prefix/suffix:

[code]\begin{enumerate}[label=\alph*)]{=latex}

\end{enumerate}{=latex}[/code]

And then in front of each line with the paragraph prefix:

`\item `{=latex}

For the appearance of the style in the editor, I just use a hanging indent and a background highlight. I don’t get any markers in front of each line to indicate a list, but I know from the hanging indent and highlight what will happen.

That’s how it’s done in the LaTeX template, right?

In my case, this might not work, though. Two reasons:

(1) I don’t use consistent labels. That’s why I use them. It’s actually more like a definition list. I use lots of example sentences in my master thesis in philosophy of language. So I need to be able to give each list item an individual label.

(2) I sometimes need nested lists. That wouldn’t work in this way, would it?

Yes, quite right, I adapted the technique over to the template as well. It would be a little more straight-forward there, since one can seamlessly input LaTeX, the line prefix of \item could be followed by [something] and it would work fine. With MMD you’d still need to escape the label part.

You might be able to cook up something with Replacements for this, keeping the editor as clean as possible, and having the specifics of the list syntax converted on compile.

I asked Fletcher about getting a solution for this and he said he’ll think about it. In the meantime I compiled my own version of MMD that has the old behavior. Thanks for your help! I’ll think about it some more, when I’m finished with my thesis.