scrivener math

dg's Avatar

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 1 Posted by Brett on 24 Jan, 2020 03:12 PM

    Brett's Avatar

    Try using a double backslash (\\to).

    -Brett

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

    dg's Avatar

    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. 3 Posted by dg on 24 Jan, 2020 03:33 PM

    dg's Avatar

    Can I delete this?

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

    Brett's Avatar

    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. 5 Posted by dg on 24 Jan, 2020 07:52 PM

    dg's Avatar

    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 6 Posted by Brett on 24 Jan, 2020 07:58 PM

    Brett's Avatar

    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. 7 Posted by dg on 24 Jan, 2020 08:02 PM

    dg's Avatar

    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 8 Posted by Brett on 24 Jan, 2020 09:21 PM

    Brett's Avatar

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

    - Brett

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

    dg's Avatar

    Great! Looking forward to it

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

    Brett's Avatar

    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. 11 Posted by dg on 28 Jan, 2020 05:08 PM

    dg's Avatar

    Yes! It works. Thank you very much

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

    Brett's Avatar

    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
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac