如何使用 Visual Studio 代码将数学公式插入到 Markdown 文件中? [英] How can I insert mathematical formulas into a markdown file with visual studio code?

查看:97
本文介绍了如何使用 Visual Studio 代码将数学公式插入到 Markdown 文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用vscode写了几个月的markdown-file,是一个完美的工具.
但是如何使用 Visual Studio Code 将 数学公式 插入到 Markdown 文件中?
我无法通过 Google 搜索找到有效的解决方案.vscode 支持吗?

I have used vscode to write markdown-file for several months, and it is a perfect tool.
But how can I insert mathematical formulas into a markdown file with Visual Studio Code?
I can not find an effective solution by Google search. Does vscode support?

推荐答案

vscode v1.58 将支持 Katex:

vscode v1.58 will have support for Katex:

VS Code 的 内置 Markdown 预览 现在可以渲染数学使用 KaTeX

VS Code's built-in Markdown preview can now render math equations using KaTeX

内联数学方程用单个美元符号包裹:

Inline math equations are wrapped in single dollar signs:

Inline math: $x^2$

虽然您可以创建一个带有双美元符号的数学方程块:

While you can create a math equation block with double dollar signs:

Math block:

$$
\displaystyle
\left( \sum_{k=1}^n a_k b_k \right)^2
\leq
\left( \sum_{k=1}^n a_k^2 \right)
\left( \sum_{k=1}^n b_k^2 \right)
$$

您可以设置 "markdown.math.enabled": false 以禁用此功能.

You can set "markdown.math.enabled": false to disable this feature.

参见 https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_58.md#math-formula-rendering-in-the-markdown-preview

这篇关于如何使用 Visual Studio 代码将数学公式插入到 Markdown 文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆