kaushalmodi / ox-hugo

A carefully crafted Org exporter back-end for Hugo
https://ox-hugo.scripter.co
GNU General Public License v3.0
867 stars 130 forks source link

How to keep origin math equations? Is there is a toggle for it? #653

Closed young40 closed 2 years ago

young40 commented 2 years ago

There are some site support $$ better than \[ .

So in that case, keep the origin math equations means a lot.

Thanks!

kaushalmodi commented 2 years ago

There are some site support $$ better than [ .

I didn't quite get that. Can you provide a minimal reproducible example?

So in that case, keep the origin math equations means a lot.

Until Hugo is able to parse the equations natively, I don't think we can remove the escaping.

It's difficult to act upon this suggestion, unless you can share an example git repository that shows the unescaped Math equations in Markdown content work well with just Hugo + MathJax.

young40 commented 2 years ago

@kaushalmodi thank u, got it.

I'll add a post process after exported to markdown in my work flow.

kaushalmodi commented 2 years ago

I haven't been able to understand your issue entirely. If you don't want ox-hugo to do any escaping of Math equations when exporting, you can add this Emacs-Lisp advice to your Emacs config:

(defun my/org-blackfriday-escape-chars-in-equation (str)
  str)
(advice-add 'org-blackfriday-escape-chars-in-equation :override #'my/org-blackfriday-escape-chars-in-equation)

Sorry, I am unable to help much without a reproducible example to see the exact issue you are facing.