我有一个使用 Nuxt 的新 nuxt 内容网站([email protected] 和 @nuxt/[email protected]),并且希望使用常用的
$...$
语法从我的 Markdown 文件中渲染数学方程。我需要添加什么才能获得 katex(或任何)数学渲染?
你能找到什么吗?我也在寻找这个解决方案。
一个简单的解决方案可能是使用 MDC(Markdown 组件),这样您就可以在 Markdown 中渲染任何 Vue 组件。创建一个通用的 MathRender.Vue 组件,然后传递 md 文件中的所有数据并根据您的意愿在 Vue 文件中渲染。
示例.md 文件
::card
The content of the card
::
卡.vue
<template>
<div class="p-6 border bg-white dark:bg-black dark:border-gray-700 rounded">
<slot />
</div>
</template>