Skip to content

Commit 24d3137

Browse files
committed
markdown improvement
1 parent a1ce898 commit 24d3137

File tree

5 files changed

+347
-28
lines changed

5 files changed

+347
-28
lines changed

astro.config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import { youtubeEmbed } from "./integrations/youtube-embed"
77
import mdx from "@astrojs/mdx"
88
import rehypeSlug from "rehype-slug"
99
import rehypeAutolinkHeadings from "rehype-autolink-headings"
10+
import rehypeKatex from "rehype-katex"
11+
import remarkGfm from "remark-gfm"
12+
import remarkMath from "remark-math"
13+
1014
import sitemap from "@astrojs/sitemap"
1115

1216
import tailwind from "@astrojs/tailwind"
@@ -36,6 +40,7 @@ export default defineConfig({
3640
],
3741
markdown: {
3842
drafts: true,
43+
remarkPlugins: [remarkMath, remarkGfm],
3944
rehypePlugins: [
4045
rehypeSlug,
4146
[
@@ -44,6 +49,25 @@ export default defineConfig({
4449
behavior: "prepend",
4550
},
4651
],
52+
[
53+
rehypeKatex,
54+
{
55+
macros: {
56+
"\\E": "\\mathbb{E}",
57+
"\\C": "\\mathbb{C}",
58+
"\\R": "\\mathbb{R}",
59+
"\\N": "\\mathbb{N}",
60+
"\\Q": "\\mathbb{Q}",
61+
"\\bigO": "\\mathcal{O}",
62+
"\\abs": "|#1|",
63+
"\\set": "\\{ #1 \\}",
64+
"\\indep": "{\\perp\\mkern-9.5mu\\perp}",
65+
"\\nindep": "{\\not\\!\\perp\\!\\!\\!\\perp}",
66+
"\\latex": "\\LaTeX",
67+
"\\katex": "\\KaTeX",
68+
},
69+
},
70+
],
4771
],
4872
syntaxHighlight: "prism",
4973
extendDefaultPlugins: true,

0 commit comments

Comments
 (0)