Forked from jessykate/Jekyll nd Octopress Liquid tag for MathJax.rb
Last active
December 17, 2015 05:39
-
-
Save markandrus/5559223 to your computer and use it in GitHub Desktop.
This edit improves compatibility with Markdown processors that output XHTML.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class MathJaxBlockTag < Liquid::Tag | |
def render(context) | |
"<script type=\"math/tex; mode=display\">\n%<![CDATA[" | |
end | |
end | |
class MathJaxInlineTag < Liquid::Tag | |
def render(context) | |
"<script type=\"math/tex\">\n%<![CDATA[" | |
end | |
end | |
class MathJaxEndTag < Liquid::Tag | |
def render(context) | |
"%]]>\n</script>" | |
end | |
end | |
end | |
Liquid::Template.register_tag('math', Jekyll::MathJaxBlockTag) | |
Liquid::Template.register_tag('m', Jekyll::MathJaxInlineTag) | |
Liquid::Template.register_tag('endmath', Jekyll::MathJaxEndTag) | |
Liquid::Template.register_tag('em', Jekyll::MathJaxEndTag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution from this email.