]> git.donarmstrong.com Git - emacs.git/blobdiff - .emacs
use latexmk for everything; fix package list
[emacs.git] / .emacs
diff --git a/.emacs b/.emacs
index 65a31cacae7119b9640cf43687c72992ed105d9a..d56140bc9f20880f371801fc87fe322df659313a 100644 (file)
--- a/.emacs
+++ b/.emacs
@@ -604,6 +604,25 @@ Argument DESCRIPTION MIME description."
 (setq-default org-directory "/home/don/org-mode/")
 (setq-default org-mobile-inbox-for-pull "/home/don/org-mode/from-mobile.org")
 
+;; org mode ical export
+(setq org-icalendar-timezone "America/Los_Angeles")
+(setq org-icalendar-use-scheduled '(todo-start event-if-todo))
+(setq org-icalendar-store-UID t)
+
+;; org babel support
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . t )
+   (R . t)
+   (latex . t)))
+;; org-babel-by-backend
+(defmacro org-babel-by-backend (&rest body)
+   `(case (if (boundp 'backend) 
+              (org-export-backend-name backend)
+            nil) ,@body))
+
+
+
 ;; org latex
 ;; stolen from http://kieranhealy.org/esk/kjhealy.html
 (require 'org-latex)   
@@ -612,7 +631,7 @@ Argument DESCRIPTION MIME description."
 ;; default listings package instead, use
 ;; (setq org-latex-listings t)
 ;; and change references to "minted" below to "listings"
-(setq org-latex-listings 'minted)
+(setq org-latex-listings 'minted)
 
 ;; default settings for minted code blocks
 (setq org-latex-minted-options
@@ -645,45 +664,34 @@ Argument DESCRIPTION MIME description."
                ("\\subsection{%s}" . "\\subsection*{%s}")
                ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
 
+(add-to-list 'org-latex-classes
+             '("letter"
+               "\\documentclass[11pt]{letter}"
+               ("\\section{%s}" . "\\section*{%s}")
+               ("\\subsection{%s}" . "\\subsection*{%s}")
+               ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+               ("\\paragraph{%s}" . "\\paragraph*{%s}")
+               ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+
 ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
 ;; but adapted to use latexmk 4.22 or higher.  
-(defun my-auto-tex-cmd ()
-  "When exporting from .org with latex, automatically run latex,
-                     pdflatex, or xelatex as appropriate, using latexmk."
-  (let ((texcmd)))
-  ;; default command: pdflatex 
-  (setq texcmd "latexmk -pdflatex='pdflatex -synctex=1 --shell-escape --' -pdf %f")        
-  ;; pdflatex -> .pdf
-  (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
-      (setq texcmd "latexmk -pdflatex='pdflatex -synctex=1 --shell-escape' -pdf %f"))
-  ;; xelatex -> .pdf
-  (if (string-match "LATEX_CMD: xelatex" (buffer-string))
-      (setq texcmd "latexmk -pdflatex='xelatex -syntex=1 --shell-escape' -bibtex -use-make -pdf %f"))
-  ;; LaTeX compilation command
-  (setq org-latex-to-pdf-process (list texcmd)))
-
-(add-hook 'org-latex-after-initial-vars-hook 'my-auto-tex-cmd)
+(setq org-latex-pdf-process '("latexmk -pdflatex=xelatex -bibtex -use-make -pdf %f"))
 
 ;; Default packages included in /every/ tex file, latex, pdflatex or xelatex
+(setq org-latex-default-packages-alist
+      '(("" "fontspec" t)
+        ("" "xunicode" t)
+        ))
 (setq org-latex-packages-alist
       '(("" "graphicx" t)
+        ("" "fontspec" t)
+        ("" "xunicode" t)
+        ("" "hyperref" t)
+        ("" "url" t)
+        ("" "rotating" t)
         ("" "longtable" nil)
         ("" "float" )))
 
-;; Custom packages
-(defun my-auto-tex-parameters ()
-  "Automatically select the tex packages to include. See https://github.com/kjhealy/latex-custom-kjh for the support files included here."
-  ;; default packages for ordinary latex or pdflatex export
-  (setq org-latex-default-packages-alist
-        '(("AUTO" "inputenc" t)
-          ("minted,minion" "org-preamble-pdflatex" t)))        
-  ;; Packages to include when xelatex is used
-  (if (string-match "LATEX_CMD: xelatex" (buffer-string))
-      (setq org-latex-default-packages-alist
-            '(("minted" "org-preamble-xelatex" t) ))))
-
-(add-hook 'org-latex-after-initial-vars-hook 'my-auto-tex-parameters)
-
 ; support ignoring headers in org mode export to latex
 ; from http://article.gmane.org/gmane.emacs.orgmode/67692
 (defadvice org-latex-headline (around my-latex-skip-headlines