# scrivener math

#### dg

24 Jan, 2020 02:44 PM

If I use math in scrivener backslashes are gobbled, i.e.:

$p \to q$


will become :

poc

html looks like this:

<p><span class="math">$$p o q$$</span></p>


apparently the \t has been swallowed somewhere on the way.

This does not happen with any other editor. What can I do to fix this?

1. Support Staff Posted by Brett on 24 Jan, 2020 03:12 PM

Try using a double backslash (\\to).

-Brett

2. Posted by dg on 24 Jan, 2020 03:30 PM

Thanks, Brett!

Well, that "fixes" this issue. But when I export the whole document to markdown or plain text and generate a pdf with pandoc, I get garbage.

Also slightly more complicated things don't work either:

$$\begin{array}{rl} 1. & p \\ 2. & p \to q \\ \hline \therefore & q \end{array}$$


becomes

<p>$$egin{array}{rl}</p> <pre><code> 1. &amp; p \ 2. &amp; p o q \ \hline herefore &amp; q </code></pre> <p>\end{array}$$</p>


and escaping the backslashes like this

$$\begin{array}{rl} 1. & p \\ 2. & p \to q \\ \hline \therefore & q \end{array}$$

results in
<p>$$\begin{array}{rl}</p> <pre><code> 1. &amp; p \\ 2. &amp; p o q \\ \hline \therefore &amp; q </code></pre> <p>\end{array}$$</p>

3. Posted by dg on 24 Jan, 2020 03:33 PM

Can I delete this?

4. Support Staff Posted by Brett on 24 Jan, 2020 04:16 PM

Looks like you did delete one post successfully, are you trying to delete others and having issues?

As far as the more complicated examples... I'll need to examine the Scrivener parser in Marked, but I believe the issue with single escapes (backslashes) being lost is on Scrivener's side, which then gets more frustrating because doubling them breaks the regular MMD export. Like I said, I need to reexamine to confirm this is the case.

In the second example, is the indentation needed? (I am not well versed in MathJax/LaTeX.) It seems to me that the code block will always be inserted in the middle of it due to the indentation, regardless of what editor that's coming from. Am I incorrect?

5. Posted by dg on 24 Jan, 2020 07:52 PM

I can't get the array to render correctly no matter how the indentation. And no, it seems to be a Scrivener only issue. The same code in Sublime Text renders flawlessly.

6. Support Staff Posted by Brett on 24 Jan, 2020 07:58 PM

Thanks for the info. I'll continue testing. I can't guarantee any
timeline for a solution at this point, apologies for that.

-Brett

7. Posted by dg on 24 Jan, 2020 08:02 PM

Thanks Brett! I can always export from Scrivener and pipe through marked then. But I kind of got used to the live preview... Hope you can figure out how to get it working.

8. Support Staff Posted by Brett on 24 Jan, 2020 09:21 PM

I found a limited fix. I’m going to try to explain its scope a bit and then get an update out.

- Brett

9. Posted by dg on 24 Jan, 2020 09:22 PM

Great! Looking forward to it

10. Support Staff Posted by Brett on 28 Jan, 2020 05:04 PM

The release with the fix is now available for direct customers (Setapp and MAS versions pending review). If you have the direct version, please update and let me know if the issue is resolved for you.

11. Posted by dg on 28 Jan, 2020 05:08 PM

Yes! It works. Thank you very much

12. Support Staff Posted by Brett on 28 Jan, 2020 05:09 PM

Excellent, thanks for your help in debugging this!

-Brett

Comments are currently closed for this discussion. You can start a new one.

# Keyboard shortcuts

### Generic

? Show this help Blurs the current field

### Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

## Recent Discussions

 21 Feb, 2020 11:32 PM Option to use MathJax 3? 20 Feb, 2020 03:12 PM Regular crashes 13 Feb, 2020 09:22 PM Markdown Formatting 11 Feb, 2020 11:53 AM Custom themes not working 10 Feb, 2020 06:48 PM KaTex Preview Update

## Recent Articles

 Using JavaScript in Marked Custom CSS: Writing custom CSS for Marked License code has already been utilized Highlight sentences longer than a certain number of words How do I retrieve a lost license (direct version)