Browse Source

Added a PDF generator

Samuel W. Flint 7 years ago
parent
commit
ed48227e6f
4 changed files with 70 additions and 1 deletions
  1. 1 0
      .gitignore
  2. 12 0
      .gitlab-ci.yml
  3. 1 1
      larcs.org
  4. 56 0
      publish.el

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 # -*- mode: gitignore; -*-
 .*
 !.gitignore
+!.gitlab-ci.yml
 *.lisp
 *\[*\]
 *.asd

+ 12 - 0
.gitlab-ci.yml

@@ -0,0 +1,12 @@
+# image: moul/emacs
+
+pages:
+  script:
+    - emacs --batch --eval "(progn (require 'package) (add-to-list 'package-archives '(\"org\" . \"http://orgmode.org/elpa/\") t) (package-initialize) (package-refresh-contents) (package-install 'org-plus-contrib))"
+    - emacs --batch --no-init-file --load publish.el --funcall org-publish-all
+  artifacts:
+    paths:
+      - public
+  only:
+    - master
+

+ 1 - 1
larcs.org

@@ -679,7 +679,7 @@ CLOSED: [2016-06-21 Tue 22:10]
 
 The task of collecting all variables in a given expression is fairly important to the task of algebraic manipulation.  This is accomplished using a fairly simple recursive algorithm, collecting the elements that are classified as variables.
 
-An expression is passed in, and if a variable, it is collected, if non-atomic, all but the first element are passed again to ~collect-variables~, and it happens all over again, this time, with those variables being added to the list, and when all is said and done, a list of all variables in a given expression is returned.  See figure [[fig:variable-collection]] for a graphical representation.
+An expression is passed in, and if a variable, it is collected, if non-atomic, all but the first element are passed again to ~collect-variables~, and it happens all over again, this time, with those variables being added to the list, and when all is said and done, a list of all variables in a given expression is returned.  See the following figure for a graphical representation.
 
 #+Caption: Variable Collection
 #+Name: variable-collection

+ 56 - 0
publish.el

@@ -0,0 +1,56 @@
+;; publish.el --- Publish org-mode project on Gitlab Pages
+;; Author: Rasmus
+(package-initialize)
+
+(require 'org)
+(require 'ox-publish)
+(require 'ox-extra)
+(ox-extras-activate '(latex-header-blocks ignore-headlines))
+
+(setq org-publish-use-timestamps-flag nil)
+
+(setq user-full-name "Samuel W. Flint")
+(setq user-mail-address "swflint@flintfam.org")
+
+(setq org-export-with-section-numbers nil
+      org-export-with-smart-quotes t
+      org-export-with-toc t
+      org-export-with-todo-keywords t)
+
+(setf org-latex-image-default-width ""
+      org-latex-table-scientific-notation "%s\\times10^{%s}"
+      org-latex-prefer-user-labels t
+      org-export-latex-hyperref-format "\\hyperref{%s}"
+      org-latex-listings t
+      org-latex-packages-alist '(("" "lmodern" nil)
+                                 ("" "natbib" nil)
+                                 ("" "csquotes" nil)
+                                 ("" "color" nil)
+                                 ("" "listings" nil)
+                                 ("" "color" nil)
+                                 ("UTF8" "inputenc" nil))
+      org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
+                              "bibtex %b"
+                              "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
+                              "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
+
+(defvar site-attachments
+  (regexp-opt '("jpg" "jpeg" "gif" "png" "svg"
+                "ico" "cur" "css" "js" "woff" "html" "pdf")))
+
+(setq org-publish-project-alist
+      (list
+       (list "site-org"
+             :base-directory "."
+             :base-extension "org"
+             :recursive t
+             :publishing-function '(org-latex-publish-to-pdf)
+             :publishing-directory "./public"
+             :exclude (regexp-opt '("README" "draft")))
+       (list "site" :components '("site-org"))))
+
+
+(setf org-confirm-babel-evaluate
+      (lambda (lang body)
+        (declare (ignorable lang body))
+        nil))