Created
August 5, 2016 05:26
-
-
Save dryman/47bbce3789b59f137f179510a43a6508 to your computer and use it in GitHub Desktop.
Minimal org-mode setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(setq package-archives | |
'(("org" . "http://orgmode.org/elpa/") | |
("gnu" . "http://elpa.gnu.org/packages") | |
("marmalade"."http://marmalade-repo.org/packages/") | |
("melpa"."http://melpa.org/packages/"))) | |
(package-initialize) | |
(defun ensure-package-installed (&rest packages) | |
"Download the package if it were not installed" | |
(mapcar | |
(lambda (package) | |
(if (not (package-installed-p package)) | |
(progn | |
(package-refresh-contents) | |
(package-install package)))) | |
packages)) | |
(ensure-package-installed | |
'exec-path-from-shell | |
'gnuplot) | |
(when (memq window-system '(mac ns)) | |
(exec-path-from-shell-initialize)) | |
(org-babel-do-load-languages | |
'org-babel-load-languages | |
'((gnuplot . t) | |
(python . t) | |
(R . t) | |
(perl . t))) | |
(setq org-startup-with-inline-images t) | |
(setq org-pretty-entities t) | |
(setq org-confirm-babel-evaluate nil) | |
(add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images) | |
(setq org-publish-project-alist | |
'(("notes-files" | |
:base-directory "~/notes" | |
:exclude "public_html" | |
:publishing-directory "~/notes/public_html/" | |
:publishing-function org-html-publish-to-html) | |
("notes-assets" | |
:base-directory "~/notes/" | |
:exclude "public_html" | |
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf" | |
:publishing-directory "~/notes/public_html/" | |
:publishing-function org-publish-attachment | |
:recursive t) | |
("notes" | |
:components ("notes-files" "notes-assets")))) | |
;; The defaults mathjax is old and slow | |
(setf org-html-mathjax-options | |
'((path "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML") | |
(scale "100") | |
(align "center") | |
(indent "2em") | |
(mathml nil))) | |
(setf org-html-mathjax-template | |
"<script type=\"text/javascript\" src=\"%PATH\"></script>") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment