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 ... \endenvironments 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.
相关工具
即时将 HTML 表格转换为 Markdown 格式。粘贴 HTML 代码并获取格式正确的 Markdown 表格。
实时将 Markdown 文本转换为精美的 HTML。支持代码高亮、表格等功能。
清理 AI 输出中的 Markdown 语法。将格式化的 Markdown 转换为简单的 TXT 内容,同时保留结构。
将 Markdown 转换为可选择文本的 PDF。使用自定义选项,即时将 Markdown 文档转换为专业 PDF。
Markdown 语法的完整参考指南,包括格式、表格、代码块等示例。
使用双星号或双下划线在 Markdown 中创建粗体文本。学习为 GitHub、Discord 和文档进行正确的粗体格式化,带有实时预览。