- (require 'ox-latex)
- (add-to-list 'org-latex-classes
- '("memarticle"
- "\\documentclass[11pt,oneside,article]{memoir}\n"
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
- ("\\paragraph{%s}" . "\\paragraph*{%s}")
- ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
-
- (setq org-beamer-outline-frame-options "")
- (add-to-list 'org-latex-classes
- '("beamer"
- "\\documentclass[ignorenonframetext]{beamer}
- [NO-DEFAULT-PACKAGES]
- [PACKAGES]
- [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
- '("membook"
- "\\documentclass[11pt,oneside]{memoir}\n"
- ("\\chapter{%s}" . "\\chapter*{%s}")
- ("\\section{%s}" . "\\section*{%s}")
- ("\\subsection{%s}" . "\\subsection*{%s}")
- ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
-
- (add-to-list 'org-latex-classes
- '("letter"
- "\\documentclass[11pt]{letter}
- [NO-DEFAULT-PACKAGES]
- [PACKAGES]
- [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
- '("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 -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)
- ("" "unicode-math" t)
- ))
- (setq org-latex-packages-alist
- '(("" "graphicx" t)
- ("" "fontspec" t)
- ("" "xunicode" t)
- ("" "hyperref" t)
- ("" "url" t)
- ("" "rotating" t)
- ("" "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
- (org-export-get-backend 'latex))
- (org-export--get-inbuffer-options
- (org-export-get-backend 'latex)))))
- (org-latex-guess-babel-language
- (org-latex-guess-inputenc
- (org-splice-latex-header
- org-format-latex-header
- org-latex-default-packages-alist
- nil t
- (plist-get info :latex-header)))
- info)))
-
-
- ; 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
- (headline contents info) activate)
- (if (member "ignoreheading" (org-element-property :tags headline))
- (setq ad-return-value contents)
- ad-do-it))
-
- ;; keep latex logfiles
-
- (setq org-latex-remove-logfiles nil)
-
- ;; Resume clocking task when emacs is restarted
- (org-clock-persistence-insinuate)
- ;;
- ;; Show lot of clocking history so it's easy to pick items off the C-F11 list
- (setq org-clock-history-length 23)
- ;; Resume clocking task on clock-in if the clock is open
- (setq org-clock-in-resume t)
- ;; Change tasks to NEXT when clocking in; this avoids clocking in when
- ;; there are things like PHONE calls
- (setq org-clock-in-switch-to-state 'bh/clock-in-to-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
- (setq org-clock-into-drawer t)
- (setq org-log-into-drawer t)
- ;; Sometimes I change tasks I'm clocking quickly - this removes clocked tasks with 0:00 duration
- (setq org-clock-out-remove-zero-time-clocks t)
- ;; Clock out when moving task to a done state
- (setq org-clock-out-when-done t)
- ;; Save the running clock and all clock history when exiting Emacs, load it on startup
- (setq org-clock-persist t)
- ;; Do not prompt to resume an active clock
- (setq org-clock-persist-query-resume nil)
- ;; Enable auto clock resolution for finding open clocks
- (setq org-clock-auto-clock-resolution (quote when-no-clock-is-running))
- ;; 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)
-
- (defun bh/is-task-p ()
- "Any task with a todo keyword and no subtask"
- (save-restriction
- (widen)
- (let ((has-subtask)
- (subtree-end (save-excursion (org-end-of-subtree t)))
- (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
- (save-excursion
- (forward-line 1)
- (while (and (not has-subtask)
- (< (point) subtree-end)
- (re-search-forward "^\*+ " subtree-end t))
- (when (member (org-get-todo-state) org-todo-keywords-1)
- (setq has-subtask t))))
- (and is-a-task (not has-subtask)))))
- (defun bh/is-project-p ()
- "Any task with a todo keyword subtask"
- (save-restriction
- (widen)
- (let ((has-subtask)
- (subtree-end (save-excursion (org-end-of-subtree t)))
- (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
- (save-excursion
- (forward-line 1)
- (while (and (not has-subtask)
- (< (point) subtree-end)
- (re-search-forward "^\*+ " subtree-end t))
- (when (member (org-get-todo-state) org-todo-keywords-1)
- (setq has-subtask t))))
- (and is-a-task has-subtask))))
-
- (defun bh/is-subproject-p ()
- "Any task which is a subtask of another project"
- (let ((is-subproject)
+(use-package ox-extra
+ :config
+ (ox-extras-activate '(ignore-headlines)))
+(require 'ox-latex)
+(add-to-list 'org-latex-classes
+ '("memarticle"
+ "\\documentclass[11pt,oneside,article]{memoir}\n"
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+ ("\\paragraph{%s}" . "\\paragraph*{%s}")
+ ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
+
+(setq org-beamer-outline-frame-options "")
+(add-to-list 'org-latex-classes
+ '("beamer"
+ "\\documentclass[ignorenonframetext]{beamer}
+[NO-DEFAULT-PACKAGES]
+[PACKAGES]
+[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
+ '("membook"
+ "\\documentclass[11pt,oneside]{memoir}\n"
+ ("\\chapter{%s}" . "\\chapter*{%s}")
+ ("\\section{%s}" . "\\section*{%s}")
+ ("\\subsection{%s}" . "\\subsection*{%s}")
+ ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
+
+(add-to-list 'org-latex-classes
+ '("letter"
+ "\\documentclass[11pt]{letter}
+[NO-DEFAULT-PACKAGES]
+[PACKAGES]
+[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
+ '("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 -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)
+ ("" "unicode-math" t)
+ ))
+(setq org-latex-packages-alist
+ '(("" "graphicx" t)
+ ("" "fontspec" t)
+ ("" "xunicode" t)
+ ("" "hyperref" t)
+ ("" "url" t)
+ ("" "rotating" t)
+ ("" "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
+ (org-export-get-backend 'latex))
+ (org-export--get-inbuffer-options
+ (org-export-get-backend 'latex)))))
+ (org-latex-guess-babel-language
+ (org-latex-guess-inputenc
+ (org-splice-latex-header
+ org-format-latex-header
+ org-latex-default-packages-alist
+ nil t
+ (plist-get info :latex-header)))
+ info)))
+
+
+; 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
+ (headline contents info) activate)
+ (if (member "ignoreheading" (org-element-property :tags headline))
+ (setq ad-return-value contents)
+ ad-do-it))
+
+;; keep latex logfiles
+
+(setq org-latex-remove-logfiles nil)
+
+;; Resume clocking task when emacs is restarted
+(org-clock-persistence-insinuate)
+;;
+;; Show lot of clocking history so it's easy to pick items off the C-F11 list
+(setq org-clock-history-length 23)
+;; Resume clocking task on clock-in if the clock is open
+(setq org-clock-in-resume t)
+;; Change tasks to NEXT when clocking in; this avoids clocking in when
+;; there are things like PHONE calls
+(setq org-clock-in-switch-to-state 'bh/clock-in-to-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
+(setq org-clock-into-drawer t)
+(setq org-log-into-drawer t)
+;; Sometimes I change tasks I'm clocking quickly - this removes clocked tasks with 0:00 duration
+(setq org-clock-out-remove-zero-time-clocks t)
+;; Clock out when moving task to a done state
+(setq org-clock-out-when-done t)
+;; Save the running clock and all clock history when exiting Emacs, load it on startup
+(setq org-clock-persist t)
+;; Do not prompt to resume an active clock
+(setq org-clock-persist-query-resume nil)
+;; Enable auto clock resolution for finding open clocks
+(setq org-clock-auto-clock-resolution (quote when-no-clock-is-running))
+;; 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)
+
+(defun bh/is-task-p ()
+ "Any task with a todo keyword and no subtask"
+ (save-restriction
+ (widen)
+ (let ((has-subtask)
+ (subtree-end (save-excursion (org-end-of-subtree t)))
+ (is-a-task (member (nth 2 (org-heading-components)) org-todo-keywords-1)))
+ (save-excursion
+ (forward-line 1)
+ (while (and (not has-subtask)
+ (< (point) subtree-end)
+ (re-search-forward "^\*+ " subtree-end t))
+ (when (member (org-get-todo-state) org-todo-keywords-1)
+ (setq has-subtask t))))
+ (and is-a-task (not has-subtask)))))
+(defun bh/is-project-p ()
+ "Any task with a todo keyword subtask"
+ (save-restriction
+ (widen)
+ (let ((has-subtask)
+ (subtree-end (save-excursion (org-end-of-subtree t)))