diff --git a/latex-publish.el b/latex-publish.el index ba1a13ebc09cfcacc5111dc0016c76c67edc1d72..3f68a322295942c8f20a50410348a8ddd317639d 100644 --- a/latex-publish.el +++ b/latex-publish.el @@ -18,6 +18,17 @@ undesirable behavior." (add-to-list 'output pkg t))) (setq org-latex-default-packages-alist output))) +(defun remove-from-org-latex-packages-alist (package) + "Removes `package' from the list of packages that are included by default when +exporting from Org to LaTeX, i.e. from `org-latex-packages-alist'. This is +useful for controlling the order in which some of the packages are loaded in +order to prevent conflicts or other undesirable behavior." + (let ((output '())) + (dolist (pkg org-latex-packages-alist) + (unless (string= package (nth 1 pkg)) + (add-to-list 'output pkg t))) + (setq org-latex-packages-alist output))) + ;; Custom publishing function for LaTeX files. This is useful when we need to ;; publish a manually written LaTeX file to PDF (e. g. a poster). (defun latex-publish-to-pdf (plist filename pub-dir)