publish.el 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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-todo-keywords '((sequence "TODO(t)" "WORKING(w)" "|" "DONE(d)")
  12. (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
  13. (sequence "|" "CANCELLED(c)")))
  14. (setq org-export-with-smart-quotes t
  15. org-export-with-toc t
  16. org-export-with-todo-keywords t)
  17. (setf org-latex-image-default-width ""
  18. org-latex-table-scientific-notation "%s\\times10^{%s}"
  19. org-latex-prefer-user-labels t
  20. org-export-latex-hyperref-format "\\hyperref{%s}"
  21. org-latex-listings t
  22. org-latex-packages-alist '(("" "lmodern" nil)
  23. ("" "natbib" nil)
  24. ("" "csquotes" nil)
  25. ("" "color" nil)
  26. ("" "listings" nil)
  27. ("" "color" nil)
  28. ("UTF8" "inputenc" nil))
  29. org-latex-classes '(("article" "\\documentclass[10pt,twoside,letterpaper]{article}"
  30. ("\\section{%s}" . "\\section*{%s}")
  31. ("\\subsection{%s}" . "\\subsection*{%s}")
  32. ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  33. ("\\paragraph{%s}" . "\\paragraph*{%s}")
  34. ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
  35. ("report" "\\documentclass[11pt]{report}"
  36. ("\\chapter{%s}" . "\\chapter*{%s}")
  37. ("\\section{%s}" . "\\section*{%s}")
  38. ("\\subsection{%s}" . "\\subsection*{%s}")
  39. ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
  40. ("\\paragraph{%s}" . "\\paragraph*{%s}"))
  41. ("book" "\\documentclass[11pt]{book}"
  42. ("\\part{%s}" . "\\part*{%s}")
  43. ("\\chapter{%s}" . "\\chapter*{%s}")
  44. ("\\section{%s}" . "\\section*{%s}")
  45. ("\\subsection{%s}" . "\\subsection*{%s}")
  46. ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
  47. ("beamer" "\\documentclass{beamer}" org-beamer-sectioning))
  48. org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
  49. "bibtex %b"
  50. "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
  51. "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
  52. (defvar site-attachments
  53. (regexp-opt '("jpg" "jpeg" "gif" "png" "svg"
  54. "ico" "cur" "css" "js" "woff" "html" "pdf")))
  55. (setq org-publish-project-alist
  56. (list
  57. (list "site-org"
  58. :base-directory "."
  59. :base-extension "org"
  60. :recursive t
  61. :publishing-function '(org-latex-publish-to-pdf)
  62. :publishing-directory "./public"
  63. :exclude (regexp-opt '("README" "draft")))
  64. (list "site" :components '("site-org"))))
  65. (setf org-confirm-babel-evaluate
  66. (lambda (lang body)
  67. (declare (ignorable lang body))
  68. nil))