Function: org-latex--make-option-string

org-latex--make-option-string is a byte-compiled function defined in ox-latex.el.gz.

Signature

(org-latex--make-option-string OPTIONS &optional SEPARATOR)

Documentation

Return a comma or SEPARATOR separated string of keywords and values.

OPTIONS is an alist where the key is the options keyword as a string, and the value a list containing the keyword value, or nil.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-latex.el.gz
(defun org-latex--make-option-string (options &optional separator)
  "Return a comma or SEPARATOR separated string of keywords and values.
OPTIONS is an alist where the key is the options keyword as
a string, and the value a list containing the keyword value, or
nil."
  (mapconcat (lambda (pair)
               (let ((keyword (car pair))
                     (value (pcase (cdr pair)
                              ((pred stringp) (cdr pair))
                              ((pred consp) (cadr pair)))))
                 (concat keyword
                         (when value
                           (concat "="
                                   (if (string-match-p (rx (any "[]")) value)
                                       (format "{%s}" value)
                                     value))))))
             options
             (or separator ",")))