X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=emacs_el%2Fconfiguration%2Forg-mode-configuration.el;h=0af973acbf05482bd1202a46a2c3612f346618f4;hb=9fc89af6c7a27cff07b3c25fa5a29497d799305f;hp=973e00257177f5c0573457c1715623d06871e5b0;hpb=bf6a6e868a5f2cfc3c3d2e323f16f10622433a85;p=lib.git diff --git a/emacs_el/configuration/org-mode-configuration.el b/emacs_el/configuration/org-mode-configuration.el index 973e002..0af973a 100644 --- a/emacs_el/configuration/org-mode-configuration.el +++ b/emacs_el/configuration/org-mode-configuration.el @@ -106,6 +106,7 @@ "~/projects/org-notes/uddin.org" "~/projects/org-notes/reviews.org" "~/projects/org-notes/hpcbio.org" + "~/org-mode/from-mobile.org" "~/projects/org-notes/fh.org"))) (set-register ?n (cons 'file "~/projects/org-notes/notes.org")) @@ -121,6 +122,13 @@ (setq org-global-properties '(("Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00"))) (setq org-columns-default-format "%40ITEM(Task) %6Effort{:} %CLOCKSUM %PRIORITY %TODO %13SCHEDULED %13DEADLINE %TAGS") +;; add automatic reminders for appointments +(defadvice org-agenda-redo (after org-agenda-redo-add-appts) + "Pressing `r' on the agenda will also add appointments." + (progn + (setq appt-time-msg-list nil) + (org-agenda-to-appt))) + (setq org-default-notes-file "~/projects/org-notes/notes.org") (setq org-id-link-to-org-use-id t) (setq org-capture-templates ;; mail-specific note template, identified by "m" @@ -408,7 +416,7 @@ Maildir, or by Message-ID." "Open a paper pdf by bibtex key" (interactive "bibtex key: ") (shell-command - (format "%s -p evince %s" + (format "%s -p evince_annot %s" (substitute-in-file-name "$HOME/bin/bibtex_to_paper") bibtexkey))) (org-add-link-type "papers-pdf" 'open-research-paper-pdf) @@ -441,8 +449,8 @@ Maildir, or by Message-ID." 'my-rtcite-export-handler) -(setq-default org-mobile-directory "/rzlab.ucr.edu:/sites/dav.donarmstrong.com/root/org/") -(when (string= system-name "rzlab.ucr.edu") +(setq-default org-mobile-directory "/linnode.donarmstrong.com:/sites/dav.donarmstrong.com/root/org/") +(when (string= system-name "linnode.donarmstrong.com") (setq-default org-mobile-directory "/sites/dav.donarmstrong.com/root/org/")) (setq-default org-directory "/home/don/org-mode/") (setq-default org-mobile-inbox-for-pull "/home/don/org-mode/from-mobile.org") @@ -462,13 +470,20 @@ Maildir, or by Message-ID." (ditaa . t) (dot . t) )) +;; use graphviz-dot for dot things +(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)) ;; org-babel-by-backend (defmacro org-babel-by-backend (&rest body) `(case (if (boundp 'backend) (org-export-backend-name backend) nil) ,@body)) +(defun my/fix-inline-images () + (when org-inline-image-overlays + (org-redisplay-inline-images))) +(add-hook 'org-babel-after-execute-hook + 'my/fix-inline-images) ;; ;; org latex ;; ;; stolen from http://kieranhealy.org/esk/kjhealy.html @@ -537,13 +552,41 @@ Maildir, or by Message-ID." ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) +(add-to-list 'org-latex-classes + '("dlacv" + "\\documentclass{dlacv} +[NO-DEFAULT-PACKAGES] +[NO-PACKAGES] +[NO-EXTRA]" + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) + + +(add-to-list 'org-latex-classes + '("dlaresume" + "\\documentclass{dlaresume} +[NO-DEFAULT-PACKAGES] +[NO-PACKAGES] +[NO-EXTRA]" + ("\\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. -(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) @@ -554,6 +597,9 @@ Maildir, or by Message-ID." ("" "longtable" nil) ("" "float" ))) +;; make equations larger +(setq org-format-latex-options (plist-put org-format-latex-options :scale 2.0)) + (defun org-create-formula--latex-header () "Return LaTeX header appropriate for previewing a LaTeX snippet." (let ((info (org-combine-plists (org-export--get-global-options @@ -834,6 +880,7 @@ Skip project and sub-project tasks, habits, and loose non-project tasks." (setq org-clock-in-resume t) ;; Change tasks to NEXT when clocking in (setq org-clock-in-switch-to-state 'bh/clock-in-to-next) +;; (setq org-clock-in-switch-to-state "NEXT") ;; Separate drawers for clocking and logs (setq org-drawers (quote ("PROPERTIES" "LOGBOOK"))) ;; Save clock data and state changes and notes in the LOGBOOK drawer @@ -852,6 +899,8 @@ Skip project and sub-project tasks, habits, and loose non-project tasks." ;; Include current clocking task in clock reports (setq org-clock-report-include-clocking-task t) +;; the cache seems to be broken +(setq org-element-use-cache nil) (defvar bh/keep-clock-running nil) @@ -1000,6 +1049,28 @@ same directory as the org-buffer and insert a link to this file." (insert (concat "[[" my/org-insert-screenshot/filename "]]")) (org-display-inline-images)) +(defun my/fix-inline-images () + (when org-inline-image-overlays + (org-redisplay-inline-images))) + +(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. @@ -1031,4 +1102,16 @@ same directory as the org-buffer and insert a link to this file." (min (1+ (match-end 0)) end))) (unless (bolp) (insert "\n")))))))))))) +; from https://emacs.stackexchange.com/questions/909/how-can-i-have-an-agenda-timeline-view-of-multiple-files +(defun org-agenda-timeline-all (&optional arg) + (interactive "P") + (with-temp-buffer + (dolist (org-agenda-file org-agenda-files) + (insert-file-contents org-agenda-file nil) + (end-of-buffer) + (newline)) + (write-file "/tmp/timeline.org") + (org-agenda arg "L"))) +(define-key org-mode-map (kbd "C-c t") 'org-agenda-timeline-all) + (provide 'org-mode-configuration)