Function: org-latex-src--engrave-mathescape-p

org-latex-src--engrave-mathescape-p is a byte-compiled function defined in ox-latex.el.gz.

Signature

(org-latex-src--engrave-mathescape-p INFO OPTIONS)

Documentation

From the export INFO plist, and the per-block OPTIONS, determine mathescape.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-latex.el.gz
(defun org-latex-src--engrave-mathescape-p (info options)
  "From the export INFO plist, and the per-block OPTIONS, determine mathescape."
  (let ((default-options (plist-get info :latex-engraved-options))
        (mathescape-status
         (lambda (opts)
           (cl-some
            (lambda (opt)
              (or (and
                   (null (cdr opt))
                   (cond
                    ((string-match-p
                      "\\(?:^\\|,\\)mathescape=false\\(?:,\\|$\\)"
                      (car opt))
                     'no)
                    ((or (string-match-p
                          "\\(?:^\\|,\\)mathescape\\(?:=true\\)?\\(?:,\\|$\\)"
                          (car opt))
                         (string= "mathescape" (car opt)))
                     'yes)))
                  (and
                   (string= (car opt) "mathescape")
                   (cond
                    ((or (and (stringp (cdr opt)) (string= (cdr opt) "true"))
                         (equal '("true") (cdr opt)))
                     'yes)
                    ((or (and (stringp (cdr opt)) (string= "false" (cdr opt)))
                         (equal '("false") (cdr opt)))
                     'no)))))
            opts))))
    (let ((mathescape (or (funcall mathescape-status default-options)
                          (funcall mathescape-status options))))
      (when (eq mathescape 'yes)
        (or engrave-faces-latex-mathescape t)))))