You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add to what has been reported earlier on a similar subject here, I would like to present here some limitations of Google Charts that have caused me trouble while using Markdown-here v2.12.0 (2015-09-07).
User case
I am writing an e-mail to my PhD supervisors to inform them of a mistake I found in a previous PhD dissertation in numerical methods. For that purpose, an e-mail appears to me as the right medium. Of course because of the nature of the subject, it has to contain equations…
As part of the e-mail I have a small demonstration that is quite "technical" (i.e. a fair bit of calculations).
Problem occurs with Markdown-here + google charts
However, calculations can get quite long and for instance one of the equations that I must write is the following :
$\Delta (u \times v ) = \left\{ \begin{matrix} [ b \, \Delta r + r \, \Delta b + 2 \, \nabla b \cdot \Delta r ] - [ c \, \Delta q + q \, \Delta c + 2 \, \nabla c \cdot \nabla q ] \\ [ c \, \Delta p + p \, \Delta c + 2 \, \nabla c \cdot \Delta p ] - [ a \, \Delta r + r \, \Delta a + 2 \, \nabla a \cdot \nabla r ] \\ [ a \, \Delta q + q \, \Delta a + 2 \, \nabla a \cdot \Delta q ] - [ b \, \Delta p + p \, \Delta b + 2 \, \nabla b \cdot \nabla p ] \end{matrix} \right\}$
Unfortunately this line doesn't render, eventhough it is syntaxly correct… Indeed, it can be compiled by storing it in a *.tex file
\documentclass[10pt, a4paper]{article}
\usepackage{amsmath}
\begin{document}
\[
\Delta (u \times v ) = \left\{ \begin{matrix} [ b \, \Delta r + r \, \Delta b + 2 \, \nabla b \cdot \Delta r ] - [ c \, \Delta q + q \, \Delta c + 2 \, \nabla c \cdot \nabla q ] \\ [ c \, \Delta p + p \, \Delta c + 2 \, \nabla c \cdot \Delta p ] - [ a \, \Delta r + r \, \Delta a + 2 \, \nabla a \cdot \nabla r ] \\ [ a \, \Delta q + q \, \Delta a + 2 \, \nabla a \cdot \Delta q ] - [ b \, \Delta p + p \, \Delta b + 2 \, \nabla b \cdot \nabla p ] \end{matrix} \right\}
\]
\end{document}
and invoking pdflatex on it…
pdflatex main.tex
After having played a little bit with the markdown source, I had the impression that if the line gets too long then markdown-here doesn't render it… Perhaps this is a limitation of google Chart ?
Problem doesn't occur with pandoc + mathjax
Previously, I have generated some *.html documents using pandoc. It uses mathjax instead of Google charts, and rendering the previous equation does not cause any issue at all!
To see it in action, create a doc.md file and fill it with
$$\Delta (u \times v ) = \left\{ \begin{matrix} [ b \, \Delta r + r \, \Delta b + 2 \, \nabla b \cdot \Delta r ] - [ c \, \Delta q + q \, \Delta c + 2 \, \nabla c \cdot \nabla q ] \\ [ c \, \Delta p + p \, \Delta c + 2 \, \nabla c \cdot \Delta p ] - [ a \, \Delta r + r \, \Delta a + 2 \, \nabla a \cdot \nabla r ] \\ [ a \, \Delta q + q \, \Delta a + 2 \, \nabla a \cdot \Delta q ] - [ b \, \Delta p + p \, \Delta b + 2 \, \nabla b \cdot \nabla p ] \end{matrix} \right\}$$
(Pandoc requires two dollar signs '$'). Then, transform it into a *.html file by invoking
Eventually open doc.md.html using your favorite web browser.
Also (smaller detail) pandoc + mathjax seems to handles the line breaks better. For instance the following text is a rewrite of the above equation with line breaks so as to make it much more human-readable.
$$
\Delta (u \times v )
=
\left\{
\begin{matrix}
[ b \, \Delta r + r \, \Delta b + 2 \, \nabla b \cdot \Delta r ]
-
[ c \, \Delta q + q \, \Delta c + 2 \, \nabla c \cdot \nabla q ]
\\
[ c \, \Delta p + p \, \Delta c + 2 \, \nabla c \cdot \Delta p ]
-
[ a \, \Delta r + r \, \Delta a + 2 \, \nabla a \cdot \nabla r ]
\\
[ a \, \Delta q + q \, \Delta a + 2 \, \nabla a \cdot \Delta q ]
-
[ b \, \Delta p + p \, \Delta b + 2 \, \nabla b \cdot \nabla p ]
\end{matrix}
\right\}
$$
It can be parsed properly by mathjax, whereas Google Charts requires '$' to be followed directly by a non-space character which makes the syntax a bit awkward :
$\Delta (u \times v )
=
\left\{
\begin{matrix}
[ b \, \Delta r + r \, \Delta b + 2 \, \nabla b \cdot \Delta r ]
\\
c
\end{matrix}
\right\}$
When I look at the html source code that has been generated,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
</head>
<body>
<p><span class="math display">\[\Delta (u \times v ) = \left\{ \begin{matrix} [ b \, \Delta r + r \, \Delta b + 2 \, \nabla b \cdot \Delta r ] - [ c \, \Delta q + q \, \Delta c + 2 \, \nabla c \cdot \nabla q ] \\ [ c \, \Delta p + p \, \Delta c + 2 \, \nabla c \cdot \Delta p ] - [ a \, \Delta r + r \, \Delta a + 2 \, \nabla a \cdot \nabla r ] \\ [ a \, \Delta q + q \, \Delta a + 2 \, \nabla a \cdot \Delta q ] - [ b \, \Delta p + p \, \Delta b + 2 \, \nabla b \cdot \nabla p ] \end{matrix} \right\}\]</span></p>
</body>
</html>
what pandoc has done is stupidly simple :
It added a link to mathjax in the <head> section of the *.html file
It copied and pasted the Latex source code into a <span> block (and replaced the $$ [...] $$ tag by a \[ [...] \] tag)
\[ [...] \]
What I did eventually : text + Unicode
Since I could not get Markdown-here to do what I wanted, and since I did not want to write my own html code (or to generate it through pandoc), I sent my e-mail in text form and used unicode to write my equations… For instance the previous line can be writen using unicode as:
It seems Markdown-here cannot handle long formulas (to double-check), probably because Google Charts does not allow it (to double-check).
As you can see, the difficulty I encountered lead me to not use markdown-here at all, and to switch back to the good old text e-mail… Which is a shame because apart from that, I am very happy with your extension so far… (Actually, I love to use it to write minutes of meetings!)
I am not sure what the best solution could be:
Keep using Markdown + google charts (i.e. do nothing)
Use Markdown + mathjax (i.e. dump google charts) (or Katex?)
Or allow the user to select the rendering service he/she would like to use?
Some other solution?
Anyway many thanks for your work, that is a very useful extension you have made! ;) (even-though this corner case is causing me trouble…)
Cheers,
Gaël
The text was updated successfully, but these errors were encountered:
Hi,
To add to what has been reported earlier on a similar subject here, I would like to present here some limitations of Google Charts that have caused me trouble while using Markdown-here v2.12.0 (2015-09-07).
User case
I am writing an e-mail to my PhD supervisors to inform them of a mistake I found in a previous PhD dissertation in numerical methods. For that purpose, an e-mail appears to me as the right medium. Of course because of the nature of the subject, it has to contain equations…
As part of the e-mail I have a small demonstration that is quite "technical" (i.e. a fair bit of calculations).
Problem occurs with Markdown-here + google charts
However, calculations can get quite long and for instance one of the equations that I must write is the following :
Unfortunately this line doesn't render, eventhough it is syntaxly correct… Indeed, it can be compiled by storing it in a *.tex file
and invoking pdflatex on it…
After having played a little bit with the markdown source, I had the impression that if the line gets too long then markdown-here doesn't render it… Perhaps this is a limitation of google Chart ?
Problem doesn't occur with pandoc + mathjax
Previously, I have generated some *.html documents using pandoc. It uses mathjax instead of Google charts, and rendering the previous equation does not cause any issue at all!
To see it in action, create a doc.md file and fill it with
(Pandoc requires two dollar signs '$'). Then, transform it into a *.html file by invoking
Eventually open
doc.md.html
using your favorite web browser.Also (smaller detail) pandoc + mathjax seems to handles the line breaks better. For instance the following text is a rewrite of the above equation with line breaks so as to make it much more human-readable.
It can be parsed properly by mathjax, whereas Google Charts requires '$' to be followed directly by a non-space character which makes the syntax a bit awkward :
When I look at the html source code that has been generated,
what pandoc has done is stupidly simple :
It added a link to mathjax in the
<head>
section of the *.html fileIt copied and pasted the Latex source code into a
<span>
block (and replaced the$$ [...] $$
tag by a\[ [...] \]
tag)\[ [...] \]
What I did eventually : text + Unicode
Since I could not get Markdown-here to do what I wanted, and since I did not want to write my own html code (or to generate it through pandoc), I sent my e-mail in text form and used unicode to write my equations… For instance the previous line can be writen using unicode as:
Summary
It seems Markdown-here cannot handle long formulas (to double-check), probably because Google Charts does not allow it (to double-check).
As you can see, the difficulty I encountered lead me to not use markdown-here at all, and to switch back to the good old text e-mail… Which is a shame because apart from that, I am very happy with your extension so far… (Actually, I love to use it to write minutes of meetings!)
I am not sure what the best solution could be:
Anyway many thanks for your work, that is a very useful extension you have made! ;) (even-though this corner case is causing me trouble…)
Cheers,
Gaël
The text was updated successfully, but these errors were encountered: