Function: org-latex--remove-packages

org-latex--remove-packages is a byte-compiled function defined in ox-latex.el.gz.

Signature

(org-latex--remove-packages PKG-ALIST INFO)

Documentation

Remove packages based on the current LaTeX compiler.

PKG-ALIST is a list of packages, as in org-latex-packages-alist and org-latex-default-packages-alist. If the fourth argument of a package is neither nil nor a member of the LaTeX compiler associated to the document, the package is removed.

Return new list of packages.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-latex.el.gz
(defun org-latex--remove-packages (pkg-alist info)
  "Remove packages based on the current LaTeX compiler.

PKG-ALIST is a list of packages, as in `org-latex-packages-alist'
and `org-latex-default-packages-alist'.  If the fourth argument
of a package is neither nil nor a member of the LaTeX compiler
associated to the document, the package is removed.

Return new list of packages."
  (let ((compiler (or (plist-get info :latex-compiler) "")))
    (if (not (member-ignore-case compiler org-latex-compilers)) pkg-alist
      (cl-remove-if-not
       (lambda (package)
	 (pcase package
	   (`(,_ ,_ ,_ nil) t)
	   (`(,_ ,_ ,_ ,compilers) (member-ignore-case compiler compilers))
	   (_ t)))
       pkg-alist))))