Markdown 转 LaTeX
从 Markdown 中提取并转换数学公式为 LaTeX 格式,用于学术论文和科学文档。
Try the Markdown to LaTeX Converter
Edit LaTeX math formulas in Markdown with real-time preview. Perfect for academic papers, research documents, and Obsidian notes.
Markdown Editor
Markdown with Math Formulas
Here's an inline formula:
And a block formula:
Another example with summation:
Here's a matrix:
And a system of equations:
Understanding LaTeX in Markdown Syntax
Markdown supports LaTeX mathematical expressions through delimiters, enabling you to include complex math formulas in your documents. This is especially useful for academic papers, scientific documentation, and technical notes.
Inline LaTeX Formulas
For inline mathematical expressions that flow with your text, use single dollar signs ($) as delimiters:
The famous equation $E = mc^2$ was published by Einstein.
Inline formulas are rendered within the line of text, making them suitable for simple expressions that don't disrupt the reading flow.
Block LaTeX Formulas
For standalone mathematical expressions that should be displayed on their own line, use double dollar signs ($$) as delimiters:
The quadratic formula provides solutions to quadratic equations:
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
This formula is derived from the standard form of a quadratic equation.
Block formulas are centered and set apart from the surrounding text, making them ideal for complex or important mathematical expressions.
Common LaTeX Math Commands
LaTeX uses specific commands to render mathematical symbols and structures. Here are some commonly used ones:
- Fractions: $\frac{numerator}{denominator}$
- Subscripts: $x_{i}$
- Superscripts: $x^{2}$
- Square roots: $\sqrt{x}$
- Summation: $\sum_{i=1}^{n} x_i$
- Integrals: $\int_{a}^{b} f(x) dx$
- Greek letters: $\alpha$, $\beta$, $\gamma$, $\pi$
- Infinity: $\infty$
Advanced Structures
LaTeX in Markdown also supports complex mathematical structures:
# Matrices
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$
# Systems of Equations
$$
\begin{cases}
3x + 5y + z = 0 \\
7x - 2y + 4z = 0 \\
-6x + 3y + 2z = 0
\end{cases}
$$
Note that in Markdown, backslashes need to be escaped with an additional backslash, making LaTeX commands like \\frac
appear as \\\\frac
in your Markdown source.
需要了解更多Markdown语法细节?我们的全面速查表涵盖了所有元素的详细说明:
探索完整Markdown语法Frequently Asked Questions
How do I write LaTeX formulas in Markdown?
You can write LaTeX formulas in Markdown using dollar sign delimiters. Use single dollar signs$E = mc^2$
for inline formulas, and double dollar signs$$\sum_{i=1}^n i = \frac{n(n+1)}{2}$$
for block formulas (displayed on their own line). Most Markdown processors, including GitHub, Jupyter notebooks, and tools like Obsidian, support this syntax for rendering mathematical expressions.
How do I convert Markdown with LaTeX to a PDF document?
To convert Markdown with LaTeX formulas to PDF, you can use tools like Pandoc or specialized Markdown editors:
1. Using Pandoc: Install Pandoc and LaTeX, then runpandoc input.md -o output.pdf
2. Using editors: Many Markdown editors like Typora, Obsidian (with plugins), or Visual Studio Code (with extensions) can export Markdown with LaTeX to PDF directly.
For scientific documents, consider using our Overleaf export option, which creates a complete LaTeX document that you can further edit and export as a professionally formatted PDF.
What's the difference between LaTeX and Markdown?
LaTeX and Markdown are both markup languages but serve different purposes:
Markdown is a lightweight markup language designed for simplicity and readability. It's excellent for basic content formatting like headings, lists, links, and basic text styling.
LaTeX is a sophisticated typesetting system specifically designed for producing technical and scientific documents. It excels at complex formatting, mathematical expressions, bibliographies, and precise layout control.
Markdown with LaTeX math support combines the simplicity of Markdown with LaTeX's mathematical capabilities, offering an ideal balance for many technical writing needs.
How do I write LaTeX in Jupyter notebooks?
Jupyter notebooks support LaTeX mathematics through two methods:
1. Within Markdown cells: Use dollar sign delimiters$formula$
for inline math and$$formula$$
for display math, just like regular Markdown.
2. Using MathJax directly: For more control, you can use MathJax commands like\begin{align}...\end{align}
Jupyter notebooks render the math expressions when you execute the cell. Remember that in Jupyter, you don't need to double-escape backslashes as you might in other Markdown contexts.
How do I use LaTeX math in Obsidian notes?
Obsidian fully supports LaTeX mathematics in your notes:
1. For inline formulas, use single dollar signs:$E = mc^2$
2. For block formulas, use double dollar signs:$$\sum_{i=1}^n i$$
Obsidian uses MathJax to render these expressions in preview mode. You can also use the\begin ... \end
environments for advanced math structures like matrices and equation arrays.
For a better editing experience, consider installing the "Extended MathJax" community plugin, which adds additional LaTeX macros and environments.
Other Useful Tools
实时将 Markdown 文本转换为漂亮的 HTML。支持代码高亮、表格等功能。
完整的 Markdown 语法参考指南,包含格式化、表格、代码块等示例。
使用我们的可视化编辑器轻松创建 markdown 表格。为 GitHub markdown、文档等生成表格。自定义对齐方式,导入/导出数据,并提供实时预览。
轻松创建 Markdown 超链接。为网站、文档或 Discord 等平台生成标准、自动及引用链接的正确语法。
学习如何在 Markdown 中添加注释。为 GitHub、文档和其他平台创建隐藏注释,使用 HTML 和引用样式方法。
为 GitHub、Discord 和其他平台创建 markdown 删除线文本。学习不同的 markdown 删除线方法,使用双波浪线格式化您的文本。
学习如何在 markdown 文档中添加新行。尝试不同的换行方法,适用于 GitHub、Discord 和其他平台,使用尾随空格、反斜杠和 HTML br 标签。
即时将 HTML 表格转换为 Markdown 格式。粘贴 HTML 代码并获取格式正确的 Markdown 表格。
统计 Markdown 文本的字数、字符数并估算阅读时间。智能忽略代码块。
清理 AI 输出中的 Markdown 语法。将格式化的 Markdown 转换为简单的 TXT 内容,同时保留结构。