config/doom: latex tweaking and tinwery
This commit is contained in:
parent
01e263f6fa
commit
3509d68b75
|
@ -120,6 +120,8 @@ Version 2019-11-04 2021-02-16"
|
||||||
|
|
||||||
(setq initial-major-mode 'org-mode)
|
(setq initial-major-mode 'org-mode)
|
||||||
(add-to-list 'auto-mode-alist '("/journal/" . org-mode))
|
(add-to-list 'auto-mode-alist '("/journal/" . org-mode))
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.twee\\'" . twee-chapbook-mode))
|
||||||
|
(add-hook 'twee-chapbook-mode-hook 'twee-mode)
|
||||||
(whitespace-mode 0)
|
(whitespace-mode 0)
|
||||||
(auto-correct-mode)
|
(auto-correct-mode)
|
||||||
|
|
||||||
|
@ -238,12 +240,12 @@ Version 2019-11-04 2021-02-16"
|
||||||
(setq org-id-method 'org
|
(setq org-id-method 'org
|
||||||
org-id-ts-format "%Y%m%dT%H%M%S")
|
org-id-ts-format "%Y%m%dT%H%M%S")
|
||||||
|
|
||||||
;; From https://github.com/org-roam/org-roam/issues/1935#issuecomment-968047007
|
;; Automatically add modified stamp - https://github.com/org-roam/org-roam/issues/1935#issuecomment-968047007
|
||||||
(require 'time-stamp)
|
(require 'time-stamp)
|
||||||
(setq time-stamp-start "modified:[ ]+\\\\?")
|
(setq time-stamp-start "modified:[ ]+\\\\?")
|
||||||
(setq time-stamp-end "$")
|
(setq time-stamp-end "$")
|
||||||
(setq time-stamp-format "%Y-%m-%dT%H%M%S")
|
(setq time-stamp-format "%Y-%m-%dT%H%M%S")
|
||||||
(add-hook 'before-save-hook #'time-stamp)
|
(add-hook 'before-save-hook 'time-stamp)
|
||||||
|
|
||||||
;; Visuals
|
;; Visuals
|
||||||
; https?[0-z.\/-]*\.(png|jpg)\?[^?]*
|
; https?[0-z.\/-]*\.(png|jpg)\?[^?]*
|
||||||
|
@ -382,6 +384,7 @@ Version 2019-11-04 2021-02-16"
|
||||||
(setq org-roam-db-update-on-save nil
|
(setq org-roam-db-update-on-save nil
|
||||||
org-roam-extract-new-file-path "${slug}.org"
|
org-roam-extract-new-file-path "${slug}.org"
|
||||||
+org-roam-open-buffer-on-find-file nil)
|
+org-roam-open-buffer-on-find-file nil)
|
||||||
|
(add-hook 'org-capture-after-finalize-hook (lambda () (if (org-roam-file-p) (org-roam-db-sync))))
|
||||||
|
|
||||||
(setq my/org-roam-capture-props ":properties:\n:id: ${slug}\n:created: %<%Y-%m-%dT%H%M%S>\n:modified: <>\n:end:\n")
|
(setq my/org-roam-capture-props ":properties:\n:id: ${slug}\n:created: %<%Y-%m-%dT%H%M%S>\n:modified: <>\n:end:\n")
|
||||||
(setq my/org-roam-capture-title "\n#+title: ${title}")
|
(setq my/org-roam-capture-title "\n#+title: ${title}")
|
||||||
|
@ -400,7 +403,7 @@ Version 2019-11-04 2021-02-16"
|
||||||
)
|
)
|
||||||
|
|
||||||
(defvar my/auto-org-roam-db-sync--timer nil)
|
(defvar my/auto-org-roam-db-sync--timer nil)
|
||||||
(defvar my/auto-org-roam-db-sync--timer-interval 30)
|
(defvar my/auto-org-roam-db-sync--timer-interval 10)
|
||||||
(define-minor-mode my/auto-org-roam-db-sync-mode
|
(define-minor-mode my/auto-org-roam-db-sync-mode
|
||||||
"Toggle automatic `org-roam-db-sync' when Emacs is idle.
|
"Toggle automatic `org-roam-db-sync' when Emacs is idle.
|
||||||
Reference: `auto-save-visited-mode'"
|
Reference: `auto-save-visited-mode'"
|
||||||
|
@ -411,10 +414,10 @@ Version 2019-11-04 2021-02-16"
|
||||||
(when my/auto-org-roam-db-sync-mode
|
(when my/auto-org-roam-db-sync-mode
|
||||||
(run-with-idle-timer
|
(run-with-idle-timer
|
||||||
my/auto-org-roam-db-sync--timer-interval :repeat
|
my/auto-org-roam-db-sync--timer-interval :repeat
|
||||||
#'my/org-roam-update))))
|
#'org-roam-db-sync))))
|
||||||
|
|
||||||
(defun my/org-roam-update ()
|
(defun my/org-roam-update ()
|
||||||
"Update org-roam database and sync ids to org if in org-mode"
|
"If in org-mode, update org-roam database and sync ids to orgids"
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (equal major-mode 'org-mode) (org-roam-db-sync) (let ((org-display-remote-inline-images 'skip)) (org-roam-update-org-id-locations)) (org-mode-restart)))
|
(when (equal major-mode 'org-mode) (org-roam-db-sync) (let ((org-display-remote-inline-images 'skip)) (org-roam-update-org-id-locations)) (org-mode-restart)))
|
||||||
|
|
||||||
|
@ -422,7 +425,8 @@ Version 2019-11-04 2021-02-16"
|
||||||
)
|
)
|
||||||
|
|
||||||
(after! ox
|
(after! ox
|
||||||
(setq org-latex-toc-command "\\tableofcontents*\n\n")
|
|
||||||
|
(setq org-latex-toc-command "\\tableofcontents\n\n")
|
||||||
;; Insert linebreak after headings tagged with "newpage" when exporting through latex - https://emacs.stackexchange.com/a/30892
|
;; Insert linebreak after headings tagged with "newpage" when exporting through latex - https://emacs.stackexchange.com/a/30892
|
||||||
(defun org/get-headline-string-element (headline backend info)
|
(defun org/get-headline-string-element (headline backend info)
|
||||||
(let ((prop-point (next-property-change 0 headline)))
|
(let ((prop-point (next-property-change 0 headline)))
|
||||||
|
@ -435,12 +439,11 @@ Version 2019-11-04 2021-02-16"
|
||||||
(add-to-list 'org-export-filter-headline-functions
|
(add-to-list 'org-export-filter-headline-functions
|
||||||
'org/ensure-latex-clearpage)
|
'org/ensure-latex-clearpage)
|
||||||
|
|
||||||
(setq org-latex-to-pdf-process
|
;(setq org-latex-to-pdf-process '("xelatex -interaction nonstopmode %f" "xelatex -interaction nonstopmode %f"))
|
||||||
'("xelatex -interaction nonstopmode %f"
|
|
||||||
"xelatex -interaction nonstopmode %f")) ;; for multiple passes
|
|
||||||
;; Exporting - https://orgmode.org/manual/Export-Settings.html
|
;; Exporting - https://orgmode.org/manual/Export-Settings.html
|
||||||
(setq ;org-latex-pdf-process '("latexmk -shell-escape -outdir=/tmp/latexmk -f -pdf %F && mv %f /tmp/latexmk && mv /tmp/latexmk/%b.pdf %o") ; https://emacs.stackexchange.com/a/48351
|
(setq org-latex-pdf-process '("latexmk -shell-escape -pdfxe -pdfxelatex=\"xelatex --shell-escape\" -outdir=/tmp/latexmk -f -pdf %F && mv %f /tmp/latexmk && mv /tmp/latexmk/%b.pdf %o") ; https://emacs.stackexchange.com/a/48351
|
||||||
org-latex-packages-alist '(("" "fullpage") ("avoid-all" "widows-and-orphans") ("" "svg"))
|
org-latex-packages-alist '(("" "fullpage") ("avoid-all" "widows-and-orphans") ("" "svg"))
|
||||||
|
org-latex-listings 'minted
|
||||||
org-export-with-tags nil
|
org-export-with-tags nil
|
||||||
org-export-with-tasks 'done
|
org-export-with-tasks 'done
|
||||||
org-export-with-todo-keywords nil
|
org-export-with-todo-keywords nil
|
||||||
|
@ -449,6 +452,8 @@ Version 2019-11-04 2021-02-16"
|
||||||
org-ascii-text-width 999
|
org-ascii-text-width 999
|
||||||
org-export-headline-levels 4
|
org-export-headline-levels 4
|
||||||
org-latex-default-class "article4"
|
org-latex-default-class "article4"
|
||||||
|
org-export-with-sub-superscripts '{}
|
||||||
|
org-use-sub-superscripts '{}
|
||||||
)
|
)
|
||||||
|
|
||||||
(require 'ox-extra)
|
(require 'ox-extra)
|
||||||
|
|
|
@ -49,13 +49,16 @@
|
||||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||||
;(unpin! t)
|
;(unpin! t)
|
||||||
|
|
||||||
|
(setq straight-host-usernames '((github . "xeruf")))
|
||||||
|
|
||||||
(package! emms)
|
(package! emms)
|
||||||
|
|
||||||
(unpin! evil-collection)
|
(unpin! evil-collection)
|
||||||
(package! ox-context
|
(package! ox-context
|
||||||
:recipe (:host github :repo "Jason-S-Ross/ox-context"))
|
:recipe (:host github :repo "Jason-S-Ross/ox-context"))
|
||||||
(package! websocket)
|
(package! websocket)
|
||||||
(package! org-roam-ui :recipe (:host github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
|
(package! org-roam-ui
|
||||||
|
:recipe (:host github :repo "org-roam/org-roam-ui" :files ("*.el" "out")))
|
||||||
|
|
||||||
; https://elpa.gnu.org/packages/auto-correct.html
|
; https://elpa.gnu.org/packages/auto-correct.html
|
||||||
(package! auto-correct)
|
(package! auto-correct)
|
||||||
|
@ -64,8 +67,7 @@
|
||||||
(package! evil-replace-with-register) ; grrrrr
|
(package! evil-replace-with-register) ; grrrrr
|
||||||
(package! visual-fill-column) ; Soft line wrapping at character count
|
(package! visual-fill-column) ; Soft line wrapping at character count
|
||||||
|
|
||||||
(package! activity-watch-mode
|
(package! activity-watch-mode :recipe (:fork t)) ; eagle eyes
|
||||||
:recipe (:host github :repo "xeruf/activity-watch-mode")) ; eagle eyes
|
|
||||||
(package! togetherly) ; Collaborative editing
|
(package! togetherly) ; Collaborative editing
|
||||||
(package! direnv) ; directory-local environment for haskell-nix things
|
(package! direnv) ; directory-local environment for haskell-nix things
|
||||||
|
|
||||||
|
@ -84,4 +86,9 @@
|
||||||
(package! plantuml-mode
|
(package! plantuml-mode
|
||||||
:recipe (:host github :repo "a1exsh/plantuml-mode"))
|
:recipe (:host github :repo "a1exsh/plantuml-mode"))
|
||||||
|
|
||||||
|
(package! twee-mode
|
||||||
|
:recipe (:host github :repo "magoyette/twee-mode"))
|
||||||
|
(package! twee-chapbot-mode
|
||||||
|
:recipe (:host github :repo "magoyette/twee-chapbook-mode"))
|
||||||
|
|
||||||
(package! kill-or-bury-alive) ; https://github.com/mrkkrp/kill-or-bury-alive
|
(package! kill-or-bury-alive) ; https://github.com/mrkkrp/kill-or-bury-alive
|
||||||
|
|
Loading…
Reference in New Issue