Preview math formula from Ulysses quick export

Liang Xu's Avatar

Liang Xu

31 Oct, 2018 05:52 AM

I configured to preview Ulysses sheet with Marked (cmd+6, then return). However, there are seems to be some issues in the Marked 2 preview for math formula. Please see the attached screenshot.

  1. 1 Posted by qiangqibing on 31 Oct, 2018 05:59 AM

    qiangqibing's Avatar

    attached are the screenshot

  2. Support Staff 2 Posted by Brett on 31 Oct, 2018 01:01 PM

    Brett's Avatar

    First, you don't need to load MathJax, it's built into Marked and can be enabled via Preferences->Style. You can also customize the configuration options there, but the config you have in your script is already default.

    If only the last item is not rendering, could you paste the complete text of the Ulysses sheet here so I can test?


  3. 3 Posted by #XU LIANG# on 01 Nov, 2018 06:23 AM

    #XU LIANG#'s Avatar

    Hi Brett,

    Thanks for your reply.

    Below is the text of the Ulysses sheet. some math formulas can display correctly but some are not.

    Problems in Prove the Convergence

    We have the following system
    where ~$\gamma_{k-1}\sim \mathcal{N}(0,U_{k-1})$~ and ~$\theta_{k-1} \sim \mathcal{N}(0, W_{k-1}) $~. Moreover ~$\gamma_k$~ is independent with ~$\theta_{k}$~ and ~$W_k$~ converges to ~$W$~.

    We construct the following sample mean to estimate ~$W_t$~ and want to prove its convergence to ~$W$~

    ~$$\frac{1}{k+1}\sum_{i=0}^k (y_iy_i'-U_{i-1})$$~

    The problem is that the measurement ~$y_k$~ is correlated and therefore we have to utilize the Strong Law of Large Numbers for correlated random variables, which has constraints on bound of the second moment of ~$y_iy_i'$~, and it is difficult to show the boundedness.

  4. Support Staff 4 Posted by Brett on 01 Nov, 2018 12:12 PM

    Brett's Avatar

    I assume you're using the Discount (GFM) processor? The equation as written (with one minor change, removing the space before the closing $ in the third equation) renders completely in MultiMarkdown. It appears to be an issue with the Discount processor handling underscores and inserting markup (em tags) that break the MathJax processor.

    There is a way to escape these properly for GFM, though I'm not well-versed enough in these formulae to detail it, unfortunately. You'd need to add backslashes before underscores, but that on its own doesn't completely fix it in my testing. It might take some research on both of our parts to get it working with GFM.

  5. Support Staff 5 Posted by Brett on 01 Nov, 2018 12:14 PM

    Brett's Avatar

    Here's the preview in Marked using Ulysses quick export and the MultiMarkdown processor:

  6. Support Staff 6 Posted by Brett on 01 Nov, 2018 12:43 PM

    Brett's Avatar

    I think I've found the issue. Working to fix it now, I don't think it will require any changes on your end, I'll keep you posted.

  7. Support Staff 7 Posted by Brett on 01 Nov, 2018 01:22 PM

    Brett's Avatar

    Ok, I think I narrowed down the issue. I've fixed it in this test build, if you'd like to try it out and let me know if it solves the issue:

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? 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