# Conversion from Markdown to HTML+MathJax fails to add "http" in front of CND #1847

Closed
opened this Issue Dec 30, 2014 · 3 comments

Projects
None yet
3 participants

### nbigaouette commented Dec 30, 2014

 I'm playing around with equations in a markdown file for conversion to both LaTeX and HTML. Unfortunately, there is a problem with the generated HTML file. The MathJax inclusing is missing the "http:" in front of the URL, breaking the rendering of equations. Conversion to HTML is performed this way: pandoc --toc --from=markdown --standalone --to=html5 --mathjax notes.md -o notes.html  The simple markdown file is the following: # Section 1 Equation 1: $$I = \int \rho R^{2} dV$$ Equation 2: \begin{align} I = \int \rho R^{2} dV \end{align} Equation 3: $e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n$ Pandoc style equations/references: (@foo) $a^2 + b^2 = c^2$ As (@foo) says, ... (@bar) $e = x + y$ ## Subsection 1.1 The resulting html is: 

Section 1

Equation 1:

$I = \int \rho R^{2} dV$

Equation 2:

Equation 3:

$$e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n$$

Pandoc style equations/references:

1. $$a^2 + b^2 = c^2$$

As (1) says, ...

1. $$e = x + y$$

Subsection 1.1

 Note the wrong:  instead of the expected  Passing the full MathJax url as in --mathjax="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" produce the proper javascript inclusion. Using package named "pandoc-cabal", version 1.13.2-1, as compiled from https://aur.archlinux.org/packages/pandoc-cabal/ on ArchLinux x86_64.
Collaborator

### mpickering commented Dec 30, 2014

 There has been quite a bit of discussion about what the mathjax url should be. It was previously hard coded as you suggest but this didn't work if people wanted to use https. Omitting the protocol, it is inferred from whatever the parent protocol is. (ie in your case it is probably file, when used on the web http or https).

### nbigaouette commented Dec 30, 2014

 I see. In that case, I'll explicitly leave the url option to --mathjax as to prevent any issue... Thanks.

Contributor

### timtylin commented Dec 30, 2014

 @mpickering most browser protocol-relative URL implementations famously doesn't handle file correctly when opening as a standalone html file in your filesystem.

Closed