Mentions légales du service

Skip to content
Snippets Groups Projects
Commit dd373941 authored by FELŠÖCI Marek's avatar FELŠÖCI Marek
Browse files

Add function for removing a package from list of default LaTeX packages

parent 8e272801
No related branches found
No related tags found
No related merge requests found
Pipeline #749194 failed
...@@ -75,6 +75,18 @@ ...@@ -75,6 +75,18 @@
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(defun remove-from-org-latex-default-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-default-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-default-packages-alist)
(unless (string= package (nth 1 pkg))
(add-to-list 'output pkg t)))
(setq org-latex-default-packages-alist output)))
;; Load languages for code block evaluation. ;; Load languages for code block evaluation.
(org-babel-do-load-languages (org-babel-do-load-languages
'org-babel-load-languages 'org-babel-load-languages
......
...@@ -6,6 +6,18 @@ ...@@ -6,6 +6,18 @@
;; Preserve user-defined labels during the export to PDF via LaTeX. ;; Preserve user-defined labels during the export to PDF via LaTeX.
(setq org-latex-prefer-user-labels t) (setq org-latex-prefer-user-labels t)
(defun remove-from-org-latex-default-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-default-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-default-packages-alist)
(unless (string= package (nth 1 pkg))
(add-to-list 'output pkg t)))
(setq org-latex-default-packages-alist output)))
;; Custom publishing function for LaTeX files. This is useful when we need to ;; 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). ;; publish a manually written LaTeX file to PDF (e. g. a poster).
(defun latex-publish-to-pdf (plist filename pub-dir) (defun latex-publish-to-pdf (plist filename pub-dir)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment