中文
GitHub
Docs
Deployment
User Guide
Example
中文
GitHub
Docs
Example
Guest
Sign in
MrDoc Document Example
Markdown document example
Quote text
Audio and video
Attachment preview
Link effects
Images and attachments
Documentation table of contents
Code block effects
Table effects
List effects
Symbols and emoji
Scientific formulas
Flowchart
Sequence diagram
Strikethrough, bold, italic, superscript and subscript
Markdown text highlighting
Mind map, mind map, mindmap.
ECharts graphs and charts
Timeline
50,000-word ultra-long document
Mermaid diagrams
Markdown test document
Rich text document example
Documentation table of contents
Online spreadsheet document example
This is an online spreadsheet
Online spreadsheet with local Excel import
Mind map document
Hand-drawn diagram documentation
Office documents
OnlyOffice online documents
OnlyOffice online spreadsheet
OnlyOffice Slides
Powered by MrDoc Pro
-
+
home
Scientific formulas
# Scientific Formulas ## Scientific Formula TeX (KaTeX) MrDoc uses `KaTeX` to implement the function of writing mathematical formulas within documents. You can use an online formula editor to write formulas and then obtain their code: <http://www.wiris.com/editor/demo/en/developers#mathml-latex>  The following describes how to use formula code. ### Single-line Formula If you need to write a single-line formula, you can wrap the formula with the `$$` symbol. The code is as follows: ``` $$E=mc^2$$ ``` The above content will be rendered as the following formula: $$E=mc^2$$ ### Inline Formula At the same time, single-line formulas support display within a line of text. The code is as follows: ``` 行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。 ``` The above content will be rendered as the following form: 行内的公式$$E=mc^2$$行内的公式,行内的$$E=mc^2$$公式。 Below are some more single-line formula examples: ``` $$x > y$$ ``` $$x > y$$ ``` $$\(\sqrt{3x-1}+(1+x)^2\)$$ ``` $$\(\sqrt{3x-1}+(1+x)^2\)$$ ``` $$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$ ``` $$\sin(\alpha)^{\theta}=\sum_{i=0}^{n}(x^i + \cos(f))$$ - This is an inline formula in a list $$E=mc^2$$ | Table | Formula | Usage | | --- | --- | --- | | $$E=mc^2$$ | | | | $$x > y$$ | | | | $$\(\sqrt{3x-1}+(1+x)^2\)$$ | | | ### Multi-line Formula Unlike single-line formulas, multi-line formulas require the use of triple-backtick code blocks. For example, the following code: ```math \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) ``` will be rendered as the following formula: ```math \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) ``` Code: ```katex \displaystyle \frac{1}{ \Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{ \frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} { 1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } } ``` will be rendered as the following formula: ```katex \displaystyle \frac{1}{ \Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{ \frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} { 1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } } ``` Code: ```latex f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi ``` will be rendered as the following formula: ```latex f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} \,d\xi ```
mrdoc
Sept. 29, 2026, 6:36 p.m.
Forward
Favorites
Last
Next
Scan the QR Code
Copy link
Scan the QR code to share.
Copy link
share
link
type
password
Update password
Validity period
Markdown file
Word document
PDF document (print)