Wrap "words separated by space characters" groups in LaTeX commands
This commit is contained in:
parent
5974a1c84a
commit
1011bba04e
10
README.org
10
README.org
@ -2262,10 +2262,10 @@ configuration.
|
|||||||
#'engrave-faces-latex--protect-content-mathescape
|
#'engrave-faces-latex--protect-content-mathescape
|
||||||
#'engrave-faces-latex--protect-content)
|
#'engrave-faces-latex--protect-content)
|
||||||
content)))
|
content)))
|
||||||
(if (string-match-p "\\`[\n[:space:]]+\\'" content)
|
;; Wrap "words separated by space characters" groups in LaTeX commands.
|
||||||
protected-content
|
;; Do not wrap newlines and other whitespace separating those groups.
|
||||||
;; Move newlines with whitespace outside the engrave face commands.
|
(let ((regexp (rx (or (group-n 1 (+ graph ) (* (*? print) (+ graph)))
|
||||||
(let ((regexp "\\(?1:[^\n]+\\)\\|\\(?2:\n[[:space:]]*\\)")
|
(group-n 2 (+ (any "\n" space))))))
|
||||||
(slug (when (and style
|
(slug (when (and style
|
||||||
(eq engrave-faces-latex-output-style 'preset))
|
(eq engrave-faces-latex-output-style 'preset))
|
||||||
(plist-get (cdr style) :slug)))
|
(plist-get (cdr style) :slug)))
|
||||||
@ -2279,7 +2279,7 @@ configuration.
|
|||||||
(push (engrave-faces-latex-face-apply faces pc) stack)))
|
(push (engrave-faces-latex-face-apply faces pc) stack)))
|
||||||
(when-let ((pc (match-string 2 protected-content)))
|
(when-let ((pc (match-string 2 protected-content)))
|
||||||
(push pc stack)))
|
(push pc stack)))
|
||||||
(apply #'concat (nreverse stack)))))))
|
(apply #'concat (nreverse stack))))))
|
||||||
|
|
||||||
(with-eval-after-load 'emacs
|
(with-eval-after-load 'emacs
|
||||||
(defun toggle-engrave-faces-latex-face-mapper-override ()
|
(defun toggle-engrave-faces-latex-face-mapper-override ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user