Ok I am making progress. In my .ipynb file I now have print(latex(cartesianToPolar.display())) and after processing with jupyter-nbconvert --to markdown Mercator.ipynb I can see \left\{\begin{array}{lcl} r & = & \sqrt{x^{2} + y^{2}} \\ \theta & = & \ arctan\left(\frac{y}{x}\right) \end{array}\right. I have written a filter as suggested > #!/usr/bin/env runhaskell > > import Text.Pandoc.JSON > > import Text.Pandoc.Walk (walkM) > > > > wordpressify :: Inline -> Inline > > wordpressify (Math x y) = Math x ("LaTeX " ++ y) > > wordpressify x = x > > > > myFilter :: Pandoc -> IO Pandoc > > myFilter = walkM (return . wordpressify) > > > > main :: IO () > > main = toJSONFilter myFilter > But no joy :( I still have \left\{\begin{array}{lcl} r & = & \sqrt{x^{2} + y^{2}} \\ \theta & = & \arctan\left(\frac{y}{x}\right)\end{array}\right. I am not sure what I should pattern match on. Thanks, Dominic. On Thursday, 24 November 2016 11:12:42 UTC, Matthias Geier wrote: > > Hi Dominic. > > How did you export your Jupyter notebook to Markdown? > > I just tried it both via the menu ("File" -> "Download as" -> > "Markdown") and via nbconvert (python3 -m nbconvert --to markdown > mynotebook.ipynb). In both cases, the LaTeX math was unchanged, no > HTML stuff was added. > > I've created a pandoc filter to convert "raw LaTeX" nodes to "math" > nodes, this might give some pointers how to add "$latex ... $": > > https://github.com/spatialaudio/nbsphinx/blob/18a4a32bd98e8bfa92612f9ab9d5fce212eff205/nbsphinx.py#L713 > > BTW, from a LaTeX point of view it doesn't make sense to put dollar > signs around a math environment, this would make more sense (just > remove the dollar signs): > > \begin{array}{lcl} > r & = & \sqrt{x^{2} + y^{2}} \\ \theta & = & > \arctan\left(\frac{y}{x}\right) > \end{array} > > ... and it is actually supported by Jupyter (and by pandoc). > > You could use nbconvert to convert your notebooks to Markdown, and > then run pandoc on them with a custom filter that adds the "$latex ... > $". > > cheers, > Matthias > > On Thu, Nov 24, 2016 at 10:55 AM, Dominic Steinitz > wrote: > > Hi, > > > > I have exported a jupyter notebook to markdown. The problem is that has > encoded its generated latex as html like this example (which I think is > mathjax). > > > >> > > > > I really want it to be something like > > > >> $$\begin{array}{lcl} r & = & \sqrt{x^{2} + y^{2}} \\ \theta & = & > \arctan\left(\frac{y}{x}\right) \end{array}$$ > > > > Is there an easy way of doing this and / or has someone written a filter > to do something like this? I’d rather avoid having to write a filter myself > if possible. NB I do *not* want latex as I need to convert this into > something that WordPress likes. In this example, it would be something like > > > >> $latex \begin{array}{lcl} r & = & \sqrt{x^{2} + y^{2}} \\ \theta & = & > \arctan\left(\frac{y}{x}\right) \end{array}$ > > > > > > Many thanks, > > > > Dominic Steinitz > > dom...-yV5wzPaMHOBg9hUCZPvPmw@public.gmane.org > > http://idontgetoutmuch.wordpress.com > > > > -- > > You received this message because you are subscribed to the Google > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/B684A512-D28B-47CB-BA7F-B5EB72C4E56B%40steinitz.org. > > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fb7e06d7-e268-4e45-ad2e-7cf0e610ffdb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.