# module Kramdown::Converter::MathEngine::Katex

Uses the KaTeX gem for converting math formulas to KaTeX HTML.

### Constants

AVAILABLE

### Public Class Methods

call(converter, el, opts) click to toggle source

       # File lib/kramdown/converter/math_engine/katex.rb
    18 def self.call(converter, el, opts)
    19   display_mode = el.options[:category] == :block
    20   result = ::Katex.render(
    21       el.value,
    22       display_mode: display_mode,
    23       throw_on_error: false,
    24       **converter.options[:math_engine_opts]
    25   )
    26   attr = el.attr.dup
    27   attr.delete('xmlns')
    28   attr.delete('display')
    29   result.insert(result =~ /[[:space:]>]/, converter.html_attributes(attr))
    30   result = "#{' ' * opts[:indent]}#{result}\n" if display_mode
    31   result
    32 end