# Preview math formula from Ulysses quick export

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.

# 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

1 Posted by

qiangqibingon 31 Oct, 2018 05:59 AMattached are the screenshot

Support Staff 2 Posted by

Bretton 31 Oct, 2018 01:01 PMFirst, 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?

-Brett

3 Posted by

#XU LIANG#on 01 Nov, 2018 06:23 AMHi 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

~$$y_k=\gamma_{k-1}+\theta_{k-1}$$~

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.

Support Staff 4 Posted by

Bretton 01 Nov, 2018 12:12 PMI 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.

Support Staff 5 Posted by

Bretton 01 Nov, 2018 12:14 PMHere's the preview in Marked using Ulysses quick export and the MultiMarkdown processor:

Support Staff 6 Posted by

Bretton 01 Nov, 2018 12:43 PMI 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.

Support Staff 7 Posted by

Bretton 01 Nov, 2018 01:22 PMOk, 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:

http://asssets.markedapp.com.s3.amazonaws.com/Marked2.5.27-pre.zip