Closed iyaja closed 3 years ago
With the following adjustment, I was able to get this to work for inline LaTeX equations as well as blocks:
def convert_math el, opts
composed_text = el.value
if el.options[:category] == :block
mark_left = "\n[latexmath]\n++++\n"
mark_right = "\n++++\n"
else
mark_left = "stem:["
mark_right = "]"
end
opts[:writer].append %(#{mark_left}#{composed_text}#{mark_right})
end
Note that the inline LaTeX must have $$
on both sides, rather than $
, for this to work.
(Note also that I removed the \(
and (\)
delimiters because they didn't seem to be working for me.)
Resolved by cdcde0a0d7436bc6175ef2fecfd67f534698b3aa with tests.
This PR adds the ability to convert block LaTeX embedded in markdown files (delimited by
$$
on both left and right sides) into a passthrough block with thelatexmath
macro. methods.co has an example.This also prevents kramdoc from throwing an error when it sees
$$..$$
in an input markdown file. Normally, this would result in the following error: