Skip to content

Commit

Permalink
feat(latex-renderer): add AMS packages for Math (#207)
Browse files Browse the repository at this point in the history
The 3 added packages should approximately match what is covered by the
autoloaded [ams](https://docs.mathjax.org/en/latest/input/tex/extensions/ams.html)
extension of MathJax.

As a result, users of both LaTex and MathJax renderers should get similar
experience when using math in their documents.

---------

Co-authored-by: chrisbresten <[email protected]>
Co-authored-by: Petr Bodnar <[email protected]>
  • Loading branch information
3 people authored Jan 14, 2024
1 parent b911e5b commit 823b536
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mistletoe/latex_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ def render_auto_link(self, token):
self.packages['hyperref'] = []
return '\\url{{{}}}'.format(self.escape_url(token.target))

@staticmethod
def render_math(token):
def render_math(self, token):
self.packages['amsmath'] = []
self.packages['amsfonts'] = []
self.packages['amssymb'] = []
return token.content

def render_escape_sequence(self, token):
Expand Down

0 comments on commit 823b536

Please sign in to comment.