publish.el 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ;; publish.el --- Publish org-mode project on Gitlab Pages
  2. ;; Author: Rasmus
  3. (package-initialize)
  4. (require 'org)
  5. (require 'ox-publish)
  6. (require 'ox-extra)
  7. (ox-extras-activate '(latex-header-blocks ignore-headlines))
  8. (setq org-publish-use-timestamps-flag nil)
  9. (setq user-full-name "Samuel W. Flint")
  10. (setq user-mail-address "swflint@flintfam.org")
  11. (setq org-export-with-smart-quotes t
  12. org-export-with-toc t
  13. org-export-with-todo-keywords t)
  14. (setf org-latex-image-default-width ""
  15. org-latex-table-scientific-notation "%s\\times10^{%s}"
  16. org-latex-prefer-user-labels t
  17. org-export-latex-hyperref-format "\\hyperref{%s}"
  18. org-latex-listings t
  19. org-latex-packages-alist '(("" "lmodern" nil)
  20. ("" "natbib" nil)
  21. ("" "csquotes" nil)
  22. ("" "color" nil)
  23. ("" "listings" nil)
  24. ("" "color" nil)
  25. ("UTF8" "inputenc" nil))
  26. org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
  27. "bibtex %b"
  28. "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
  29. "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
  30. (defvar site-attachments
  31. (regexp-opt '("jpg" "jpeg" "gif" "png" "svg"
  32. "ico" "cur" "css" "js" "woff" "html" "pdf")))
  33. (setq org-publish-project-alist
  34. (list
  35. (list "site-org"
  36. :base-directory "."
  37. :base-extension "org"
  38. :recursive t
  39. :publishing-function '(org-latex-publish-to-pdf)
  40. :publishing-directory "./public"
  41. :exclude (regexp-opt '("README" "draft")))
  42. (list "site" :components '("site-org"))))
  43. (setf org-confirm-babel-evaluate
  44. (lambda (lang body)
  45. (declare (ignorable lang body))
  46. nil))