├── .github └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.md ├── changelog ├── mdx_math.py ├── pyproject.toml ├── test.py └── test_data ├── beginend.html ├── beginend.mkd ├── beginend_inside_inline.html ├── beginend_inside_inline.mkd ├── beginend_inside_standalone.html ├── beginend_inside_standalone.mkd ├── beginend_preview.html ├── inline.html ├── inline_asciimath.html ├── inline_asciimath.mkd ├── inline_gitlab.mkd ├── inline_inside_standalone.html ├── inline_inside_standalone.mkd ├── inline_latex.mkd ├── inline_latex_escaped.html ├── inline_latex_escaped.mkd ├── inline_latex_inside_code.html ├── inline_latex_inside_code.mkd ├── inline_preview.html ├── inline_tex.mkd ├── inline_tex_disabled.html ├── inline_tex_escaped.html ├── inline_tex_escaped.mkd ├── standalone.html ├── standalone_gitlab.html ├── standalone_gitlab.mkd ├── standalone_gitlab_nested.html ├── standalone_gitlab_nested.mkd ├── standalone_latex.mkd ├── standalone_latex_escaped.html ├── standalone_latex_escaped.mkd ├── standalone_preview.html └── standalone_tex.mkd /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: tests 2 | on: [push, pull_request] 3 | jobs: 4 | test: 5 | runs-on: ubuntu-latest 6 | strategy: 7 | matrix: 8 | python: 9 | - '3.9' 10 | - '3.10' 11 | - '3.11' 12 | - '3.12' 13 | - '3.13' 14 | - pypy3.10 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-python@v5 18 | with: 19 | python-version: ${{ matrix.python }} 20 | - run: pip install Markdown 21 | - run: python ./test.py 22 | pypi-publish: 23 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') 24 | runs-on: ubuntu-latest 25 | environment: 26 | name: pypi 27 | url: https://pypi.org/p/python-markdown-math 28 | permissions: 29 | id-token: write 30 | steps: 31 | - uses: actions/checkout@v4 32 | - uses: actions/setup-python@v5 33 | with: 34 | python-version: '3.13' 35 | - run: pip install build 36 | - run: python -m build 37 | - if: success() 38 | uses: pypa/gh-action-pypi-publish@release/v1 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | MANIFEST 4 | *.pyc 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015-2025 Dmitry Shachnev . 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 3. Neither the name of the author nor the names of its contributors 14 | may be used to endorse or promote products derived from this software 15 | without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include changelog 3 | include LICENSE 4 | include test.py 5 | recursive-include test_data *.mkd *.html 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://github.com/mitya57/python-markdown-math/actions/workflows/main.yml/badge.svg)][Actions] 2 | 3 | [Actions]: https://github.com/mitya57/python-markdown-math/actions 4 | 5 | Math extension for Python-Markdown 6 | ================================== 7 | 8 | This extension adds math formulas support to [Python-Markdown]. 9 | 10 | [Python-Markdown]: https://github.com/Python-Markdown/markdown 11 | 12 | Installation 13 | ------------ 14 | 15 | ### Install from PyPI 16 | 17 | ``` 18 | $ pip install python-markdown-math 19 | ``` 20 | 21 | ### Install locally 22 | 23 | Use `pip install .` to install this extension from a local Git checkout. 24 | 25 | The extension name is `mdx_math`, so you need to add that name to your 26 | list of Python-Markdown extensions. 27 | Check [Python-Markdown documentation] for details on how to load 28 | extensions. 29 | 30 | [Python-Markdown documentation]: https://python-markdown.github.io/reference/#extensions 31 | 32 | Usage 33 | ----- 34 | 35 | To use this extension, you need to include [MathJax] library in HTML files, like: 36 | 37 | ```html 38 | 40 | ``` 41 | 42 | [MathJax]: https://www.mathjax.org/ 43 | 44 | Also, you need to specify a configuration for MathJax. Please note that 45 | most of standard configurations include `tex2jax` extension, which is not needed 46 | with this code. 47 | 48 | Example of configuration for MathJax 2.x: 49 | 50 | ```html 51 | 58 | ``` 59 | 60 | If you want to use MathJax 3.x, you need to teach it to understand 2.x-style 61 | `\n

' 72 | ``` 73 | 74 | Usage from the command line: 75 | 76 | ``` 77 | $ echo "\(e^x\)" | python3 -m markdown -x mdx_math 78 |

79 | 80 |

81 | ``` 82 | 83 | [upgrading documentation]: https://docs.mathjax.org/en/latest/upgrading/v2.html#math-script-example 84 | [Arithmatex]: https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/ 85 | 86 | Math Delimiters 87 | --------------- 88 | 89 | For inline math, use `\(...\)`. 90 | 91 | For standalone math, use `$$...$$`, `\[...\]` or `\begin...\end`. 92 | 93 | The single-dollar delimiter (`$...$`) for inline math is disabled by 94 | default, but can be enabled by passing `enable_dollar_delimiter=True` 95 | in the extension configuration. 96 | 97 | If you want to use [GitLab-style delimiters] (``$`...`$`` for inline math, 98 | and a code block-like `` ```math...``` `` syntax for standalone), use 99 | `use_gitlab_delimiters=True` configuration option. 100 | 101 | If you want to this extension to generate a preview node (which will be shown 102 | when MathJax has not yet processed the node, or when JavaScript is unavailable), 103 | use `add_preview=True` configuration option. 104 | 105 | [GitLab-style delimiters]: https://docs.gitlab.com/user/markdown/#math-equations 106 | 107 | Notes 108 | ----- 109 | 110 | If you use [ReText](https://github.com/retext-project/retext), this extension 111 | is not needed as it is included by default. 112 | 113 | This extension also works with Katex. Use the following in your page ``: 114 | 115 | ```html 116 | 117 | 118 | 119 | ``` 120 | -------------------------------------------------------------------------------- /changelog: -------------------------------------------------------------------------------- 1 | Version 0.9, 2025-04-10 2 | ======================= 3 | 4 | * Fixed handling of begin/end inside inline math. 5 | - Thanks to Tianxiang Xia for the bug report. 6 | * Modernized packaging. 7 | * Python ≥ 3.9 and setuptools ≥ 77.0 are now required. 8 | 9 | Version 0.8, 2020-11-03 10 | ======================= 11 | 12 | * GitLab-style math blocks are now supported in nested environments such 13 | as lists. 14 | - Thanks to Ran Shaham for the contribution. 15 | * Tests now pass with Python-Markdown 3.3. 16 | 17 | Version 0.7, 2020-06-19 18 | ======================= 19 | 20 | * This extension now requires Python ≥ 3.4 and Python-Markdown ≥ 3.0. 21 | * Fixed deprecation warnings with Python-Markdown 3.x. 22 | * Added support for GitLab-style delimiters. 23 | 24 | Version 0.6, 2018-06-13 25 | ======================= 26 | 27 | * Include LICENSE and tests in the tarball. 28 | 29 | Version 0.5, 2018-05-03 30 | ======================= 31 | 32 | * Re-upload with fixed metadata and description. 33 | 34 | Version 0.4, 2018-05-03 35 | ======================= 36 | 37 | * Added AsciiMath support. To switch from LaTeX syntax to AsciiMath, 38 | set the “use_asciimath” configuration option to true. 39 | * The dollar sign can now be escaped when the “enable_dollar_delimiter” 40 | option is enabled (\$ produces $). 41 | * Inline math can now be used inside standalone math. 42 | 43 | Version 0.3, 2017-03-24 44 | ======================= 45 | 46 | * Added “add_preview” configuration option, which adds preview nodes 47 | as recognized by MathJax before every script node. 48 | - Thanks to Antoine Amarilli and Danni Randeris for their initial work. 49 | * Added a test suite. 50 | * Documentation improvements. 51 | 52 | Version 0.2, 2015-12-05 53 | ======================= 54 | 55 | * Fix compatibility with earlier Python-Markdown versions. 56 | - Thanks to Bryan A. Jones for the contribution. 57 | * Add installation instructions from PyPI. 58 | - Thanks to Drew Hubl for the contribution. 59 | 60 | Version 0.1, 2015-08-12 61 | ======================= 62 | 63 | * Initial release. 64 | -------------------------------------------------------------------------------- /mdx_math.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Math extension for Python-Markdown 3 | ================================== 4 | 5 | Adds support for displaying math formulas using 6 | [MathJax](http://www.mathjax.org/). 7 | 8 | Author: 2015-2025, Dmitry Shachnev . 9 | ''' 10 | 11 | from xml.etree.ElementTree import Element 12 | from markdown.inlinepatterns import InlineProcessor 13 | from markdown.extensions import Extension 14 | from markdown.preprocessors import Preprocessor 15 | from markdown.util import AtomicString 16 | 17 | 18 | def _wrap_node(node, preview_text, wrapper_tag): 19 | preview = Element('span', {'class': 'MathJax_Preview'}) 20 | preview.text = AtomicString(preview_text) 21 | wrapper = Element(wrapper_tag) 22 | wrapper.extend([preview, node]) 23 | return wrapper 24 | 25 | 26 | class InlineMathPattern(InlineProcessor): 27 | def handleMatch(self, m, data): 28 | node = Element('script') 29 | node.set('type', self._content_type) 30 | node.text = AtomicString(m.group(2)) 31 | if self._add_preview: 32 | node = _wrap_node(node, m.group(0), 'span') 33 | return node, m.start(0), m.end(0) 34 | 35 | 36 | class DisplayMathPattern(InlineProcessor): 37 | def handleMatch(self, m, data): 38 | node = Element('script') 39 | node.set('type', '%s; mode=display' % self._content_type) 40 | if '\\begin' in m.group(1): 41 | node.text = AtomicString(m.group(0)) 42 | else: 43 | node.text = AtomicString(m.group(2)) 44 | if self._add_preview: 45 | node = _wrap_node(node, m.group(0), 'div') 46 | return node, m.start(0), m.end(0) 47 | 48 | 49 | class GitLabPreprocessor(Preprocessor): 50 | """ 51 | Preprocessor for GitLab-style standalone syntax: 52 | 53 | ```math 54 | math goes here 55 | ``` 56 | """ 57 | 58 | def run(self, lines): 59 | inside_math_block = False 60 | math_block_start = None 61 | math_blocks = [] 62 | 63 | for line_number, line in enumerate(lines): 64 | if line.strip() == '```math' and not inside_math_block: 65 | math_block_start = line_number 66 | inside_math_block = True 67 | if line.strip() == '```' and inside_math_block: 68 | math_blocks.append((math_block_start, line_number)) 69 | inside_math_block = False 70 | 71 | for math_block_start, math_block_end in reversed(math_blocks): 72 | math_lines = lines[math_block_start + 1:math_block_end] 73 | math_content = '\n'.join(math_lines) 74 | html = '\n' 75 | html %= (self._content_type, math_content) 76 | placeholder = self.md.htmlStash.store(html) 77 | lines[math_block_start:math_block_end + 1] = [placeholder] 78 | return lines 79 | 80 | 81 | class MathExtension(Extension): 82 | def __init__(self, *args, **kwargs): 83 | self.config = { 84 | 'enable_dollar_delimiter': 85 | [False, 'Enable single-dollar delimiter'], 86 | 'add_preview': [False, 'Add a preview node before each math node'], 87 | 'use_asciimath': 88 | [False, 'Use AsciiMath syntax instead of TeX syntax'], 89 | 'use_gitlab_delimiters': 90 | [False, 'Use GitLab-style $`...`$ delimiters'], 91 | } 92 | super().__init__(*args, **kwargs) 93 | 94 | def extendMarkdown(self, md): 95 | add_preview = self.getConfig('add_preview') 96 | use_asciimath = self.getConfig('use_asciimath') 97 | use_gitlab_delimiters = self.getConfig('use_gitlab_delimiters') 98 | content_type = 'math/asciimath' if use_asciimath else 'math/tex' 99 | 100 | inlinemathpatterns = ( 101 | InlineMathPattern(r'(?=77.0"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "python-markdown-math" 7 | version = "0.9" 8 | description = "Math extension for Python-Markdown" 9 | readme = { file = "README.md", content-type = "text/markdown" } 10 | authors = [{ name = "Dmitry Shachnev", email = "mitya57@gmail.com" }] 11 | license = "BSD-3-Clause" 12 | requires-python = ">=3.9" 13 | dependencies = ["Markdown>=3.0"] 14 | classifiers = [ 15 | "Development Status :: 5 - Production/Stable", 16 | "Operating System :: OS Independent", 17 | "Programming Language :: Python", 18 | "Programming Language :: Python :: 3", 19 | "Topic :: Scientific/Engineering :: Mathematics", 20 | "Topic :: Software Development :: Libraries :: Python Modules", 21 | "Topic :: Text Processing :: Markup :: Markdown", 22 | ] 23 | 24 | [project.entry-points."markdown.extensions"] 25 | mdx_math = "mdx_math:MathExtension" 26 | 27 | [project.urls] 28 | Homepage = "https://github.com/mitya57/python-markdown-math" 29 | 30 | [tool.setuptools] 31 | py-modules = ["mdx_math"] 32 | include-package-data = false 33 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from markdown import Markdown 4 | import unittest 5 | 6 | class MathTestCase(unittest.TestCase): 7 | def verify(self, mkd_name, html_name, config=None): 8 | config = config or dict() 9 | md = Markdown(extensions=['mdx_math'], extension_configs={'mdx_math': config}) 10 | with open('test_data/%s.mkd' % mkd_name) as mkd_file: 11 | mkd = mkd_file.read() 12 | with open('test_data/%s.html' % html_name) as html_file: 13 | html = html_file.read() 14 | self.assertEqual(html, md.convert(mkd) + '\n') 15 | 16 | def r(mkd_name, html_name, **config): 17 | return lambda self: self.verify(mkd_name, html_name, config=config) 18 | 19 | test_inline_latex = r('inline_latex', 'inline') 20 | test_inline_latex_escaped = r('inline_latex_escaped', 'inline_latex_escaped') 21 | test_inline_latex_preview = r('inline_latex', 'inline_preview', add_preview=True) 22 | test_inline_tex = r('inline_tex', 'inline', enable_dollar_delimiter=True) 23 | test_inline_tex_disabled = r('inline_tex', 'inline_tex_disabled') 24 | test_inline_tex_escaped = r('inline_tex_escaped', 'inline_tex_escaped', enable_dollar_delimiter=True) 25 | test_inline_inside_code = r('inline_latex_inside_code', 'inline_latex_inside_code') 26 | test_inline_inside_standalone = r('inline_inside_standalone', 'inline_inside_standalone') 27 | test_inline_gitlab = r('inline_gitlab', 'inline', use_gitlab_delimiters=True) 28 | test_standalone_latex = r('standalone_latex', 'standalone') 29 | test_standalone_latex_escaped = r('standalone_latex_escaped', 'standalone_latex_escaped') 30 | test_standalone_latex_preview = r('standalone_latex', 'standalone_preview', add_preview=True) 31 | test_standalone_tex = r('standalone_tex', 'standalone') 32 | test_standalone_gitlab = r('standalone_gitlab', 'standalone_gitlab', use_gitlab_delimiters=True) 33 | test_standalone_gitlab_nested = r('standalone_gitlab_nested', 'standalone_gitlab_nested', use_gitlab_delimiters=True) 34 | test_begin_end = r('beginend', 'beginend') 35 | test_begin_end_preview = r('beginend', 'beginend_preview', add_preview=True) 36 | test_begin_end_inside_inline = r('beginend_inside_inline', 'beginend_inside_inline') 37 | test_begin_end_inside_standalone = r('beginend_inside_standalone', 'beginend_inside_standalone') 38 | test_inline_asciimath = r('inline_asciimath', 'inline_asciimath', use_asciimath=True) 39 | 40 | 41 | if __name__ == '__main__': 42 | unittest.main(verbosity=2) 43 | -------------------------------------------------------------------------------- /test_data/beginend.html: -------------------------------------------------------------------------------- 1 |

2 | 8 |

9 | -------------------------------------------------------------------------------- /test_data/beginend.mkd: -------------------------------------------------------------------------------- 1 | \begin{equation*} 2 | \begin{pmatrix} 3 | 1 & 0\\ 4 | 0 & 1 5 | \end{pmatrix} 6 | \end{equation*} 7 | -------------------------------------------------------------------------------- /test_data/beginend_inside_inline.html: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | -------------------------------------------------------------------------------- /test_data/beginend_inside_inline.mkd: -------------------------------------------------------------------------------- 1 | \( T(v) = \begin{bmatrix}\alpha & \beta \\ \gamma & \delta \end{bmatrix} \) 2 | -------------------------------------------------------------------------------- /test_data/beginend_inside_standalone.html: -------------------------------------------------------------------------------- 1 |

2 | 9 |

10 | -------------------------------------------------------------------------------- /test_data/beginend_inside_standalone.mkd: -------------------------------------------------------------------------------- 1 | $$ 2 | s(x) = \begin{cases} 3 | 1 & \text{if } x > 0\\ 4 | 0 & \text{if } x = 0\\ 5 | -1 & \text{if } x < 0 6 | \end{cases} 7 | $$ 8 | -------------------------------------------------------------------------------- /test_data/beginend_preview.html: -------------------------------------------------------------------------------- 1 |

2 |

\begin{equation*} 3 | \begin{pmatrix} 4 | 1 & 0\\ 5 | 0 & 1 6 | \end{pmatrix} 7 | \end{equation*} 13 |
14 |

15 | -------------------------------------------------------------------------------- /test_data/inline.html: -------------------------------------------------------------------------------- 1 |

Inline math: .

2 | -------------------------------------------------------------------------------- /test_data/inline_asciimath.html: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | -------------------------------------------------------------------------------- /test_data/inline_asciimath.mkd: -------------------------------------------------------------------------------- 1 | \( sum_(i=1)^n i^3=((n(n+1))/2)^2 \) 2 | -------------------------------------------------------------------------------- /test_data/inline_gitlab.mkd: -------------------------------------------------------------------------------- 1 | Inline math: $`e^{i \varphi}`$. 2 | -------------------------------------------------------------------------------- /test_data/inline_inside_standalone.html: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | -------------------------------------------------------------------------------- /test_data/inline_inside_standalone.mkd: -------------------------------------------------------------------------------- 1 | \[ \sqrt{\text{ number of \(B\)-words }} \] 2 | -------------------------------------------------------------------------------- /test_data/inline_latex.mkd: -------------------------------------------------------------------------------- 1 | Inline math: \(e^{i \varphi}\). 2 | -------------------------------------------------------------------------------- /test_data/inline_latex_escaped.html: -------------------------------------------------------------------------------- 1 |

Inline math: \(e^{i \varphi}\).

2 | -------------------------------------------------------------------------------- /test_data/inline_latex_escaped.mkd: -------------------------------------------------------------------------------- 1 | Inline math: \\(e^{i \varphi}\\). 2 | -------------------------------------------------------------------------------- /test_data/inline_latex_inside_code.html: -------------------------------------------------------------------------------- 1 |

\(e^{i \varphi}\)

2 | -------------------------------------------------------------------------------- /test_data/inline_latex_inside_code.mkd: -------------------------------------------------------------------------------- 1 | `\(e^{i \varphi}\)` 2 | -------------------------------------------------------------------------------- /test_data/inline_preview.html: -------------------------------------------------------------------------------- 1 |

Inline math: \(e^{i \varphi}\).

2 | -------------------------------------------------------------------------------- /test_data/inline_tex.mkd: -------------------------------------------------------------------------------- 1 | Inline math: $e^{i \varphi}$. 2 | -------------------------------------------------------------------------------- /test_data/inline_tex_disabled.html: -------------------------------------------------------------------------------- 1 |

Inline math: $e^{i \varphi}$.

2 | -------------------------------------------------------------------------------- /test_data/inline_tex_escaped.html: -------------------------------------------------------------------------------- 1 |

Escaped $ dollar sign and real .

2 | -------------------------------------------------------------------------------- /test_data/inline_tex_escaped.mkd: -------------------------------------------------------------------------------- 1 | Escaped \$ dollar sign and real $math$. 2 | -------------------------------------------------------------------------------- /test_data/standalone.html: -------------------------------------------------------------------------------- 1 |

2 | 6 |

7 | -------------------------------------------------------------------------------- /test_data/standalone_gitlab.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | -------------------------------------------------------------------------------- /test_data/standalone_gitlab.mkd: -------------------------------------------------------------------------------- 1 | ```math 2 | e^{i \varphi} = 3 | \cos \varphi + i \sin \varphi 4 | ``` 5 | 6 | ```math 7 | \text{one more math block} 8 | ``` 9 | -------------------------------------------------------------------------------- /test_data/standalone_gitlab_nested.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /test_data/standalone_gitlab_nested.mkd: -------------------------------------------------------------------------------- 1 | - in list: 2 | ```math 3 | e^{i \varphi} = 4 | \cos \varphi + i \sin \varphi 5 | ``` 6 | -------------------------------------------------------------------------------- /test_data/standalone_latex.mkd: -------------------------------------------------------------------------------- 1 | \[ 2 | e^{i \varphi} = 3 | \cos \varphi + i \sin \varphi 4 | \] 5 | -------------------------------------------------------------------------------- /test_data/standalone_latex_escaped.html: -------------------------------------------------------------------------------- 1 |

\[ 2 | e^{i \varphi} = 3 | \cos \varphi + i \sin \varphi 4 | \]

5 | -------------------------------------------------------------------------------- /test_data/standalone_latex_escaped.mkd: -------------------------------------------------------------------------------- 1 | \\[ 2 | e^{i \varphi} = 3 | \cos \varphi + i \sin \varphi 4 | \\] 5 | -------------------------------------------------------------------------------- /test_data/standalone_preview.html: -------------------------------------------------------------------------------- 1 |

2 |

\[ 3 | e^{i \varphi} = 4 | \cos \varphi + i \sin \varphi 5 | \] 9 |
10 |

11 | -------------------------------------------------------------------------------- /test_data/standalone_tex.mkd: -------------------------------------------------------------------------------- 1 | $$ 2 | e^{i \varphi} = 3 | \cos \varphi + i \sin \varphi 4 | $$ 5 | --------------------------------------------------------------------------------