Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nbconvert/filters/markdown_mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ class MathInlineParser(InlineParser):
# Display math mode, using newer LaTeX delimiter: \[ \pi \]
BLOCK_MATH_LATEX = _dotall(r"(?<!\\)\\\\\[(?P<math_block_latex>.*?)(?<!\\)\\\\\]")
# Inline math mode, using older TeX delimiter: $ \pi $ (cannot be empty!)
INLINE_MATH_TEX = _dotall(r"(?<![$\\])\$(?P<math_inline_tex>.+?)(?<![$\\])\$")
INLINE_MATH_TEX = _dotall(
r"(?<![$\\])$(?!\s)(?P<math_inline_tex>[^$\\\s]+?)(?<!\s)(?<![$\\])$"
)
# Inline math mode, using newer LaTeX delimiter: \( \pi \)
INLINE_MATH_LATEX = _dotall(r"(?<!\\)\\\\\((?P<math_inline_latex>.*?)(?<!\\)\\\\\)")
# LaTeX math environment: \begin{equation} \pi \end{equation}
Expand Down