Fsnotes: Inline math rendering does not work

Created on 14 Jul 2020  路  10Comments  路  Source: glushchenko/fsnotes

Describe the bug
Inline math rendering does not work.

Source:

Screenshot 2020-07-14 at 16 07 52

Preview:

Screenshot 2020-07-14 at 16 07 34

Expected behavior
Inline math should be rendered in the preview.

Actual behavior
Inline math rendering does not work.

Desktop (please complete the following information):

  • OS: macOS
  • OS version: 10.14.6
  • FSNotes version: 4.4.0
bug done

Most helpful comment

In case of dollar symbol usage i have too many false positive bug reports

Pandoc uses simple heuristics to properly detect inline math inside dollar signs:

You can have spaces inside $...$, just not at the very beginning or end.

If we allowed spaces after the opening $ or before the closing $, we'd capture things like

It costs $4 or $5.

as math. LaTeX can allow the spaces, because in LaTeX the $ can only indicate math mode. In Markdown many $s are just $s, and we need heuristics to tell the difference. The rules about initial and final spaces are the heuristics.

So this would mean $a + b$ is perfectly fine, just don't use $ a + b $.

My experience (many years of authoring Markdown documents containing _a lot_ of math) is conform to other pandoc users' experience, that this actually works very reliable. I think, other Markdown parsers just follow the same rule. Therefore, I would vote for using $ as inline math delimiters, since it is widely accepted among other Markdown flavors and Markdown writing apps.

All 10 comments

Safronov, please stop assign me.

Safronov, please stop assign me.

Sorry, the assignment happens automatically every time I open a new bug/issue.

Documentation updated, you should use $$ or (( )), thanks for report.

Just a question: What is a problem to use single $s to delimit inline math like in $a \ne 0$? Many popular Markdown processors like pandoc or MultiMarkdown adhere to this quite common syntax.

In case of dollar symbol usage i have too many false positive bug reports, like:

https://github.com/glushchenko/fsnotes/issues/799

Safronov, please stop assign me.

Sorry, the assignment happens automatically every time I open a new bug/issue.

Now its clear, i did not see what it is in template.

In case of dollar symbol usage i have too many false positive bug reports

Pandoc uses simple heuristics to properly detect inline math inside dollar signs:

You can have spaces inside $...$, just not at the very beginning or end.

If we allowed spaces after the opening $ or before the closing $, we'd capture things like

It costs $4 or $5.

as math. LaTeX can allow the spaces, because in LaTeX the $ can only indicate math mode. In Markdown many $s are just $s, and we need heuristics to tell the difference. The rules about initial and final spaces are the heuristics.

So this would mean $a + b$ is perfectly fine, just don't use $ a + b $.

My experience (many years of authoring Markdown documents containing _a lot_ of math) is conform to other pandoc users' experience, that this actually works very reliable. I think, other Markdown parsers just follow the same rule. Therefore, I would vote for using $ as inline math delimiters, since it is widely accepted among other Markdown flavors and Markdown writing apps.

I tend to agree with @saf-dmitry, compatibility with other parsers is important for exporting notes to pdf. Also, committing to the (()) syntax means that other text/markdown note-taking applications will not work with notes written in FSNotes.

Seems to me that the bug in #799 is not a bug but incorrect use of the $$ syntax. Also, it can be resolved by previewing without Latex rendering.

If the $...$ delimiter syntax for inline math is currently not supported, please fix the documentation here ($a \ne 0$):

Screenshot 2020-11-23 at 13 40 37

Nevertheless, I still hope it will be supported in the future, mainly for the sake of compatibility with other applications and Markdown parsers.

Alternatively, I would suggest using LaTeX syntax \(...\), which is way more compatible to other Markdown applications and parsers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

floodfish picture floodfish  路  4Comments

ebsmv picture ebsmv  路  4Comments

gmenzel picture gmenzel  路  3Comments

fi0 picture fi0  路  4Comments

jakemkc picture jakemkc  路  4Comments