From 1df08f1ebcc46e236f1351d48e92e723816ffdaf Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sun, 8 Mar 2026 23:41:51 -0700 Subject: mass remove headers and centralise it --- config/emacs.org | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'config/emacs.org') diff --git a/config/emacs.org b/config/emacs.org index 0705af9..57aae97 100644 --- a/config/emacs.org +++ b/config/emacs.org @@ -1,7 +1,7 @@ #+title: Emacs Configuration #+author: Preston Pan #+description: my personal emacs configuration for NixOS -#+html_head: + * Introduction This is my Vanilla Emacs configuration, made to work with my NixOS configuration. For that reason, you will not see :ensure t inside any use-package declaration, for emacs packages @@ -164,6 +164,13 @@ This is my org mode configuration, which also configures latex. (org-pretty-entities t "prettify org mode") (org-agenda-files (list "~/monorepo/agenda.org" "~/org/notes.org" "~/org/agenda.org") "set default org files") (org-default-notes-file (concat org-directory "/notes.org") "Notes file") + (org-html-with-latex 'html) + (org-html-mathjax-options nil) + (org-html-mathjax-template "") + (org-html-container-element "main") + (org-html-head-extra "\n\n\n\n\n\n") + (org-latex-to-html-convert-command + "printf '%%s' %i | pandoc -f latex -t html --mathml | tr -d '\\n' | sed -e 's/^

//' -e 's/<\\/p>$//'") (org-html-viewport '((width "device-width") (initial-scale "1.0") (minimum-scale "1.0")) "Prevent zooming out past default size") @@ -192,6 +199,21 @@ This is my org mode configuration, which also configures latex. (require 'ox-publish) (require 'org-tempo) (require 'org-habit) + (require 'ob-latex) + + (defun my-org-html-latex-environment-pandoc-fix (orig-fun latex-environment contents info) + "Force `ox-html' to use the convert command for LaTeX environments when set to 'html." + (let ((processing-type (plist-get info :with-latex))) + (if (eq processing-type 'html) + (let* ((latex-frag (org-remove-indentation + (org-element-property :value latex-environment))) + (converted (org-format-latex-as-html latex-frag))) + (format "

\n\n%s\n\n
" + converted)) + (funcall orig-fun latex-environment contents info)))) + + (advice-add 'org-html-latex-environment :around #'my-org-html-latex-environment-pandoc-fix) + (org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (python . t) @@ -332,7 +354,7 @@ I use org-journal to journal about my life, and it's a part of my website: "Custom function to create journal header." (concat (pcase org-journal-file-type - (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything\n#+DESCRIPTION: My daily journal entry\n#+AUTHOR: Preston Pan\n#+HTML_HEAD: \n#+html_head: \n#+html_head: \n#+options: broken-links:t") + (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything\n#+DESCRIPTION: My daily journal entry\n#+AUTHOR: Preston Pan\n#+options: broken-links:t") (`weekly "#+TITLE: Weekly Journal\n#+STARTUP: folded") (`monthly "#+TITLE: Monthly Journal\n#+STARTUP: folded") (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded")))) @@ -745,7 +767,7 @@ For all my mathematics and programming notes: (org-roam-directory (file-truename "~/monorepo/mindmap") "Set org-roam directory inside monorepo") (org-roam-capture-templates '(("d" "default" plain "%?" :target (file+head "${title}.org" - "#+title: ${title}\n#+author: Preston Pan\n#+html_head: \n#+html_head: \n#+html_head: \n#+options: broken-links:t") + "#+title: ${title}\n#+author: Preston Pan\n#+description:\n#+options: broken-links:t") :unnarrowed t)) "org-roam files start with this snippet by default") :config (org-roam-db-autosync-mode) -- cgit v1.3