New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math Rendering Error #156

Closed
RoyiAvital opened this Issue Jun 8, 2016 · 12 comments

Comments

Projects
None yet
2 participants
@RoyiAvital

RoyiAvital commented Jun 8, 2016

I used Display Math to render the following:

$$ {\left\| x \right\|}_{TV} = \sum_{i = 1}^{m - 1} \sum_{j = 1}^{n - 1} {x}_{i, j} $$.

Yet the Math won't be rendered.

On StackEdit it works perfectly (Hence it means it is not MathJax issue).

Thank You.

@RoyiAvital

This comment has been minimized.

Show comment
Hide comment
@RoyiAvital

RoyiAvital Jun 8, 2016

I can also add another example for Inline Math:

\\( \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} \\)

Again, verified on StackEdit to work.

RoyiAvital commented Jun 8, 2016

I can also add another example for Inline Math:

\\( \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} \\)

Again, verified on StackEdit to work.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jun 8, 2016

Owner

\left\ and \right\ are not recognized by the MathJax parser in Markdown Edit. Might be an option in MathJax I don't have enabled. I don't know enough about MathJax to say what that is. Maybe a MathJax expert can chime in?

On stuff like this, screen shots are helpful.

Owner

mike-ward commented Jun 8, 2016

\left\ and \right\ are not recognized by the MathJax parser in Markdown Edit. Might be an option in MathJax I don't have enabled. I don't know enough about MathJax to say what that is. Maybe a MathJax expert can chime in?

On stuff like this, screen shots are helpful.

@mike-ward mike-ward added the bug label Jun 8, 2016

@RoyiAvital

This comment has been minimized.

Show comment
Hide comment
@RoyiAvital

RoyiAvital Jun 8, 2016

Hi,

I looked at the documentation of MathJax.
Specifically all the settings (http://docs.mathjax.org/en/latest/options/tex2jax.html).
There is nothing about that actually it seems to support it according to the commands page (See at the bottom in L and 'R').

Here is a screenshot:

image

It seems to mark the Under Score by red.
Moreover, in the second example I gave there are no \left or \right.
It doesn't seem to be the issue here.

Since all is rendered perfectly in StackEdit I don;t think it has to do with MathJax.

RoyiAvital commented Jun 8, 2016

Hi,

I looked at the documentation of MathJax.
Specifically all the settings (http://docs.mathjax.org/en/latest/options/tex2jax.html).
There is nothing about that actually it seems to support it according to the commands page (See at the bottom in L and 'R').

Here is a screenshot:

image

It seems to mark the Under Score by red.
Moreover, in the second example I gave there are no \left or \right.
It doesn't seem to be the issue here.

Since all is rendered perfectly in StackEdit I don;t think it has to do with MathJax.

@RoyiAvital

This comment has been minimized.

Show comment
Hide comment
@RoyiAvital

RoyiAvital Jun 8, 2016

OK,
I think I have an idea.

The program does something to the character \ inside math blocks.
For instance, in LaTeX in order to create a new line one should use \\ yet in MDE one must use \\\ like it would drop one of the \.

Moreover, it also does something to *.
For instance, using:

$$
\begin{align*}
2 x & = y \\
2 z & = 0.5 y
\end{align*}
$$

Won't be honored (Like it won't process the * ).
I must say I turned on the Equation Numbering (Otherwise, it doesn't make any sense).

Again, it would work perfectly on other MathJax clients.

Could it be that MDE changes the text before MathJax process it?

P. S.

This will work:

$$
\begin{align\*}
2 x & = y \\
2 z & = 0.5 y
\end{align\*}
$$

Hence I'm pretty sure MDE process text within Math Blocks as it was MarkDown when it shouldn't.
Hence what made the issue above was _LaTeX Code_ which MDE thought it is something to process.

RoyiAvital commented Jun 8, 2016

OK,
I think I have an idea.

The program does something to the character \ inside math blocks.
For instance, in LaTeX in order to create a new line one should use \\ yet in MDE one must use \\\ like it would drop one of the \.

Moreover, it also does something to *.
For instance, using:

$$
\begin{align*}
2 x & = y \\
2 z & = 0.5 y
\end{align*}
$$

Won't be honored (Like it won't process the * ).
I must say I turned on the Equation Numbering (Otherwise, it doesn't make any sense).

Again, it would work perfectly on other MathJax clients.

Could it be that MDE changes the text before MathJax process it?

P. S.

This will work:

$$
\begin{align\*}
2 x & = y \\
2 z & = 0.5 y
\end{align\*}
$$

Hence I'm pretty sure MDE process text within Math Blocks as it was MarkDown when it shouldn't.
Hence what made the issue above was _LaTeX Code_ which MDE thought it is something to process.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jun 8, 2016

Owner

I added a command line option to the Pandoc processor to escape the math portions.

$$a^2 + 4ab + c$$

$a^2 + 4ab + c$

\\( a^2 + 4ab + c \\)

$$ {\left\| x \right\|}_{TV} = \sum_{i = 1}^{m - 1} \sum_{j = 1}^{n - 1} {x}_{i, j} $$

Render as:

image

I could not get

\\( \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} \\)

to render. For the record, when I paste it into Slack Edit, it does not render there either.

Owner

mike-ward commented Jun 8, 2016

I added a command line option to the Pandoc processor to escape the math portions.

$$a^2 + 4ab + c$$

$a^2 + 4ab + c$

\\( a^2 + 4ab + c \\)

$$ {\left\| x \right\|}_{TV} = \sum_{i = 1}^{m - 1} \sum_{j = 1}^{n - 1} {x}_{i, j} $$

Render as:

image

I could not get

\\( \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} \\)

to render. For the record, when I paste it into Slack Edit, it does not render there either.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jun 8, 2016

Owner

Syntax highlighting in the editor uses the CommonMark abstract tree which knows nothing about math constructs. Coloring there will be wonky.

Owner

mike-ward commented Jun 8, 2016

Syntax highlighting in the editor uses the CommonMark abstract tree which knows nothing about math constructs. Coloring there will be wonky.

@RoyiAvital

This comment has been minimized.

Show comment
Hide comment
@RoyiAvital

RoyiAvital Jun 9, 2016

Hi,

StackEdit only uses $...$ and $$...$$ to resemble the work in LaTeX.

So \\( \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} \\) should become $ \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} $ and it does work:

image

Thank You.

RoyiAvital commented Jun 9, 2016

Hi,

StackEdit only uses $...$ and $$...$$ to resemble the work in LaTeX.

So \\( \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} \\) should become $ \mathcal{C} = \mathcal{{B}_{l, u}} = \left\{ x \mid l \leq {x}_{i, j} \leq u, \; \forall i, j \right\} $ and it does work:

image

Thank You.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jun 9, 2016

Owner

Submitted an issue to Pandoc (#2976)

Owner

mike-ward commented Jun 9, 2016

Submitted an issue to Pandoc (#2976)

@mike-ward mike-ward added in progress and removed fixed labels Jun 9, 2016

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jun 10, 2016

Owner

From Pandoc.

Don't leave a space after the $ and it will work correctly.

> pandoc --mathjax
$space$
<p><span class="math">\(space\)</span></p>
> pandoc --mathjax
$ space $
<p>$ space $</p>

image

Owner

mike-ward commented Jun 10, 2016

From Pandoc.

Don't leave a space after the $ and it will work correctly.

> pandoc --mathjax
$space$
<p><span class="math">\(space\)</span></p>
> pandoc --mathjax
$ space $
<p>$ space $</p>

image

@mike-ward mike-ward closed this Jun 10, 2016

@mike-ward mike-ward added fixed and removed in progress labels Jun 10, 2016

@RoyiAvital

This comment has been minimized.

Show comment
Hide comment
@RoyiAvital

RoyiAvital Jun 23, 2016

Hi,

Is it fixed in 1.28?

Thank You.

RoyiAvital commented Jun 23, 2016

Hi,

Is it fixed in 1.28?

Thank You.

@mike-ward

This comment has been minimized.

Show comment
Hide comment
@mike-ward

mike-ward Jun 24, 2016

Owner

I did publish a fix in 1.28 but I found a few more issues so don't pull the trigger just yet on new bugs.

Owner

mike-ward commented Jun 24, 2016

I did publish a fix in 1.28 but I found a few more issues so don't pull the trigger just yet on new bugs.

@mike-ward mike-ward reopened this Jun 24, 2016

@RoyiAvital

This comment has been minimized.

Show comment
Hide comment
@RoyiAvital

RoyiAvital Jun 25, 2016

Great...

I wish Pandoc would remove the need for no spaces.

Thank You.

RoyiAvital commented Jun 25, 2016

Great...

I wish Pandoc would remove the need for no spaces.

Thank You.

@mike-ward mike-ward closed this Jul 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment