Comments (15)
For information, I got it working in this branch but there's some issue with the CSS which makes the fraction bar appears slightly too high. Other than that it seems to be fine.
Since it's the second most popular request, I might look at it again later, or if someone can figure out the CSS that would be great.
from joplin.
That looks brilliant!
Any chance it could use a syntax already used by other markdown engines/app, instead of a new one? Such as the pandoc one, with $$
for display and $
for inline? There is a summary table here of all the places that already support this syntax.
from joplin.
Done, the next release will support both $ and backtick syntaxes.
from joplin.
Thanks for looking into this!
@cofinley's suggestion would work, but I would also look into markdown-it-katex
. KaTeX is a new typesetting library built by the Khan Academy people, because MathJax was too slow for them. Look at the comparison at the bottom of their homepage: https://khan.github.io/KaTeX/ . For Joplin's use case I would expect the speed gains from using KaTeX vs MathJax to be non-trivial. Not to mention the lack of reflowing, which is something really annoying in long pages that use MathJax.
from joplin.
I'm using markdown-it for rendering and there are two plugins for Math support:
https://github.com/runarberg/markdown-it-math
https://github.com/waylonflinn/markdown-it-katex
Do you know about the syntax they use? Is one better than the other?
from joplin.
I'd say MathJax, which seems to be the markdown editor standard.
from joplin.
@jeanm: Oh cool! I didn't know that about its background.
I agree, long document load times are very noticeable with MathJax. It looks like there was some debate on Latex features support in Katex a few years ago, but I'd imagine it's better now.
from joplin.
The mathjax package seems to be abandoned, so it would probably be better to use a different one. Maybe the katex one then.
from joplin.
Support for Katex is now available. I've tried with various expressions and as far as I can tell it works, but if there's any mathematician here please give it a try and let me know if something's off.
In the end I've simply used the actual Katex lib instead of the plugin as this is well supported, and it means we can get the latest fixes and improvements easily.
To add an inline equation, wrap the expression in `{.katex}EXPRESSION`
, eg. `{.katex}\sqrt{3x-1}+(1+x)^2`
. To create an expression block, wrap it as follow:
```katex
EXPRESSION
```
For example:
```katex
f(x) = \int_{-\infty}^\infty
\hat f(\xi)\,e^{2 \pi i \xi x}
\,d\xi
```
Here is an example with the Markdown and rendered result side by side:
from joplin.
This is now part of the desktop version and will be in Android and iOS soon too
from joplin.
Hey sorry to reopen this but is there any chance that $ and $$ could be added to the autocomplete so that typing one inserts the other half of the pair as already happens with square brackets etc.?
from joplin.
I may be missing something, but this issue says math support was added, and while I've created a note with $$ in markdown on the android app, it does not seem to render. Here's an image of what I'm seeing:
from joplin.
@dzackgarza you've to edit the note, the note will render it. That red circle with pencil on it.
You've currently copied the content into the title field. After rendering:
from joplin.
Ahhh I see! I thought these were just plain markdown files, had no idea there was a title field or anything like that. Confirmed that this works, thanks.
from joplin.
@dzackgarza, your data is stored in markdown format. The Title field is there for the convenience of users. You don't actually have to use it, app takes the first line as Title as well.
from joplin.
Related Issues (20)
- LInks created by Linkify are not clickable in WYSIWYG editor HOT 2
- Link created by LINKIFY in WYSIWYG editor is not underlined until switch to another note HOT 1
- Web Clipper: Open newly created note opens new window with garbage in Firefox HOT 10
- Rich text editor: Right click menu not shown in some cases when zoomed in
- Unexpected end of JSON input with windows client on joplin server v2.14.2
- searching works only with full word HOT 1
- Partial search hits in the title and viewer are not highlighted
- Plugin setting SettingItemSubType.DirectoryPath description is not displayed
- Creating a profile changes the language of Joplin HOT 4
- Unknown error 2 (405) with Nextcloud while url username and password are correct HOT 1
- CodeMirror 6 plugin API: Multiple plugins can't register autocompletion sources without enabling CodeMirror's built-in autocomplete
- Beta editor plugin API: Newlines break content scripts
- Multilpe profiles HOT 1
- Focus is lost when the hyperlink modal is cancelled HOT 1
- Beta editor: Auto-indent doesn't work in code blocks with an unknown language type (including mermaid)
- Mermaid - Gantt diagram and Pie chart are not generated when edited in Editor layout HOT 1
- KaTeX `alignat` breaks TeX code below it HOT 3
- ⚠️ Interested in GSoC? PLEASE READ THIS FIRST! ⚠️
- Can't choose an iCloud Drive folder
- macOS Joplin Desktop syncs way tooo long
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joplin.