;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
;; but adapted to use latexmk 4.22 or higher.
-(setq org-latex-pdf-process '("latexmk -pdflatex=xelatex -bibtex -use-make -pdf %f"))
+(setq org-latex-pdf-process '("latexmk -f -pdflatex=xelatex -bibtex -use-make -pdf %f"))
;; Default packages included in /every/ tex file, latex, pdflatex or xelatex
(setq org-latex-default-packages-alist
- '(("" "amsmath" t)))
+ '(("" "amsmath" t)
+ ("" "unicode-math" t)
+ ))
(setq org-latex-packages-alist
'(("" "graphicx" t)
("" "fontspec" t)
(add-hook 'org-babel-after-execute-hook 'my/fix-inline-images)
+;; use xelatex to preview with imagemagick
+(add-to-list 'org-preview-latex-process-alist
+ '(xelateximagemagick
+ :programs ("xelatex" "convert")
+ :description "pdf > png"
+ :message "you need to install xelatex and imagemagick"
+ :use-xcolor t
+ :image-input-type "pdf"
+ :image-output-type "png"
+ :image-size-adjust (1.0 . 1.0)
+ :latex-compiler ("xelatex -interaction nonstopmode -output-directory %o %f")
+ :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O"))
+ )
+;; use xelatex by default
+(setq org-preview-latex-default-process 'xelateximagemagick)
+
; from http://orgmode.org/Changes.html
(defun my/org-repair-property-drawers ()
"Fix properties drawers in current buffer.