Support math syntax (latex/katex/etc)
See original GitHub issueI would like to have math in markdown, for this reason I’m using the configurations reported at the bottom.
Nevertheless math is not rendering in markdown neither enclosed in $
(or double $$
), nor explicitly annotated in html, e.g.:
Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
equation.
<div class="math math-display">
L = \frac{1}{2} \rho v^2 S C_L
</div>
it is rendered literally, without any transformation.
Is this related to #206? Will it be solved, sooner or later? (otherwise I have to consider dropping mdsvex
)
// mdsvex.config.js
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
export default {
extensions: [".svx", ".md"],
remarkPlugins: [
remarkMath,
],
rehypePlugins: [
rehypeKatex,
],
};
// svelte.config.js
import adapter from '@sveltejs/adapter-static';
import preprocess from 'svelte-preprocess';
import { mdsvex } from 'mdsvex';
import mdsvexConfig from "./mdsvex.config.js";
const config = {
preprocess: [
mdsvex(mdsvexConfig),
preprocess()
],
extensions: ['.svelte', '.md', '.svx'],
kit: {
adapter: adapter(),
target: '#svelte'
}
};
export default config;
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Supported Functions - KaTeX
This is a list of TeX functions supported by KaTeX. It is sorted into logical groups.
Read more >LaTeX/Mathematics - Wikibooks, open books for an open world
Typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation....
Read more >Remove everything that is in math mode - TeX
There are a few very different ways to enter and to exit math mode: TeX math shift character, catcode 3, typically $; LaTeX...
Read more >Mathematical expressions - Overleaf, Online LaTeX Editor
This article shows the most basic commands needed to get started with writing maths using LaTeX. Writing basic equations in LaTeX is straightforward, ......
Read more >The KatePart Handbook - KDE Documentation -
3 Working with the KatePart editor. 12. 3.1 Overview . ... 6.2.2 The KatePart Syntax Highlight System . ... in ECMAScript, the LATEX...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Maybe I’ll sort something out one day 😄
Glad this is all working for you
I think I’ll keep this open but I’ll change the title to be about supporting math syntax, it will help me to track it for v1.
Hi y’all, just wanted to plug a package I wrote to deal with these issues while trying to use mdsvex for my own website: https://github.com/kwshi/rehype-katex-svelte
It’s essentially a drop-in replacement for rehype-katex, so it allows
$
and$$
syntax, but it resolves the issue of Svelte choking on curly-braces by wrapping things in an{@html "..."}
node. Would appreciate it if you try it out and let me know if it helps!