jekyll-katex
jekyll-katex copied to clipboard
Macro options?
Hi,
Thank you for this Jekyll plugin. It works really well so far. However, I tried adding macros to the configuration, like so:
katex:
rendering_options:
macros:
- "\\Nat": "\\mathbb{N}"
I tried several variations with quotes and backslashes, but none of them works. Is it supported?
@Jaxan thanks for opening this issue. Only a few rendering_options
are actually supported, and macros
is currently not one of them. It looks like it should be fairly easy to add support for. I'll work on this as soon as I am returned from traveling abroad.
+1, would appreciate this feature.
@dshemetov @jaxan Thanks for bringing this back up. Do either of you have some examples of complex macros you want to provide? I want to make sure I understand the use case and test against them.
Would something like the following in yaml
work?
katex:
js_path: "{{ Gem::lib_path }}/assets/js" # Path used to search for katex.min.js
rendering_options:
# ...
macros:
"mymacro": "x^2"
"fooMacro": "\frac{1}{x}"
Yes, that looks good. Commands with arguments would also be good to test, e.g. expectation. I think this should just work (it's on their main page).
macros:
"\\E": "\\mathbb{E}\\left[ #1 \\right]"
Just wanted to add another +1/check for any updates on this issue. Macro support would make this awesome plugin even better!