Closed jinlin82 closed 3 years ago
Thanks, I come up with a function by regexp which adds space before and after $ for each inline latex fragment in selected region, then org-fragtog
works. The function is:
(defun math-delimiter-add-space-inline(beg end)
(interactive "*r")
(let ((beg (if (region-active-p)
(region-beginning)
(line-beginning-position)))
(end (if (region-active-p)
(region-end)
(line-end-position))))
(save-restriction
(narrow-to-region beg end)
(save-excursion
(goto-char (point-min))
(while
(search-forward-regexp " *\\$\\([^$].*?[^$]\\)\\$[^$] *" nil t)
(replace-match " $\\1$ " nil nil))))
))
So I close this issue.
sorry to bother again, this works great in markdown-mode, thanks. But I have a small problem.
When there is no space before and after $. math preview is not activated, for example:
When in English math fragment always have space before and after $, but when in Eastern Asian languages, no space before and after $ is common.
Can this be fixed? Thanks.