From 6621592ab51446f4f2882d6b8b8e0447444ea7ea Mon Sep 17 00:00:00 2001
From: Thanos Apollo <public@thanosapollo.org>
Date: Tue, 8 Oct 2024 18:20:58 +0300
Subject: emacs: Update org-mode configuration.

---
 .config/emacs/init.el | 124 +++++++++++++++++++++++++++-----------------------
 1 file changed, 67 insertions(+), 57 deletions(-)

(limited to '.config/emacs/init.el')

diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index a32f288..b20cd7f 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -116,6 +116,73 @@
      ("\\<\\(TODO\\):" 1 font-lock-warning-face t)
      ("\\<\\(NOTE\\):" 1 font-lock-warning-face t))))
 
+(use-package org
+  :ensure t
+  :config
+  (setf org-directory "~/org/"
+	org-agenda-files '("~/org/seminars.org" "~/org/lectures.org")
+	org-default-notes-file (expand-file-name "notes.org" org-directory)
+	org-ellipsis " ▼"
+	org-log-done 'time
+	org-hide-emphasis-markers nil ;;change to t to hide emphasis markers
+	org-table-convert-region-max-lines 20000
+	org-log-done 'time
+	org-todo-keywords '((sequence "TODO(t)" "SEMINAR(s)" "LECTURE(l)" "DONE(d)")))
+
+  (setf org-imenu-depth 3)
+
+  (setf org-structure-template-alist
+	'(("e" . "src emacs-lisp")
+	  ("p" . "src python")
+	  ("l" . "src lisp")
+	  ("b" . "src bash")
+	  ("q" . "QUOTE")))
+
+  (require 'ox-latex)
+  (add-to-list 'org-latex-classes
+               '("article"
+		 "\\documentclass[11pt,a4paper]{article}
+\\usepackage[utf8]{inputenc}
+\\usepackage[T1]{fontenc}
+\\usepackage{fixltx2e}
+\\usepackage{graphicx}
+\\usepackage{longtable}
+\\usepackage{float}
+\\usepackage{wrapfig}
+\\usepackage{rotating}
+\\usepackage[normalem]{ulem}
+\\usepackage{amsmath}
+\\usepackage{textcomp}
+\\usepackage{marvosym}
+\\usepackage{wasysym}
+\\usepackage{amssymb}
+\\usepackage{hyperref}
+\\usepackage{mathpazo}
+\\usepackage{color}
+\\usepackage{enumerate}
+\\definecolor{bg}{rgb}{0.95,0.95,0.95}
+\\tolerance=1000
+      [NO-DEFAULT-PACKAGES]
+      [PACKAGES]
+      [EXTRA]
+\\linespread{1.1}
+\\hypersetup{pdfborder=0 0 0}"
+		 ("\\section{%s}" . "\\section*{%s}")
+		 ("\\subsection{%s}" . "\\subsection*{%s}")
+		 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+		 ("\\paragraph{%s}" . "\\paragraph*{%s}")))
+  :hook ((org-mode . (lambda () (display-line-numbers-mode -1) (flyspell-mode))))
+  :bind (:map org-mode-map (("C-c l" . org-store-link)
+			    ("C-c M-t" . org-todo))))
+
+;; Export
+
+(defun thanos/org-html-remove-curly-braces (text backend info)
+  "Remove curly braces for superscripts and subscripts in HTML export."
+  (when (org-export-derived-backend-p backend 'html 'latex)
+    (replace-regexp-in-string
+     "{\\([^}]*?\\)}" "\\1" text)))
+
 (use-package emacs
   :ensure nil
   :config
@@ -252,63 +319,6 @@
 (tooltip-mode -1)
 (menu-bar-mode -1)
 
-(use-package org
-  :ensure t
-  :config
-  (setf org-directory "~/org/"
-	org-agenda-files '("~/org/seminars.org" "~/org/lectures.org")
-	org-default-notes-file (expand-file-name "notes.org" org-directory)
-	org-ellipsis " "
-	org-log-done 'time
-	org-hide-emphasis-markers nil ;;change to t to hide emphasis markers
-	org-table-convert-region-max-lines 20000
-	org-log-done 'time
-	org-todo-keywords '((sequence "TODO(t)" "SEMINAR(s)" "LECTURE(l)" "DONE(d)")))
-
-  (setf org-structure-template-alist
-	'(("e" . "src emacs-lisp")
-	  ("p" . "src python")
-	  ("l" . "src lisp")
-	  ("b" . "src bash")
-	  ("q" . "QUOTE")))
-
-  (require 'ox-latex)
-  (add-to-list 'org-latex-classes
-               '("article"
-		 "\\documentclass[11pt,a4paper]{article}
-\\usepackage[utf8]{inputenc}
-\\usepackage[T1]{fontenc}
-\\usepackage{fixltx2e}
-\\usepackage{graphicx}
-\\usepackage{longtable}
-\\usepackage{float}
-\\usepackage{wrapfig}
-\\usepackage{rotating}
-\\usepackage[normalem]{ulem}
-\\usepackage{amsmath}
-\\usepackage{textcomp}
-\\usepackage{marvosym}
-\\usepackage{wasysym}
-\\usepackage{amssymb}
-\\usepackage{hyperref}
-\\usepackage{mathpazo}
-\\usepackage{color}
-\\usepackage{enumerate}
-\\definecolor{bg}{rgb}{0.95,0.95,0.95}
-\\tolerance=1000
-      [NO-DEFAULT-PACKAGES]
-      [PACKAGES]
-      [EXTRA]
-\\linespread{1.1}
-\\hypersetup{pdfborder=0 0 0}"
-		 ("\\section{%s}" . "\\section*{%s}")
-		 ("\\subsection{%s}" . "\\subsection*{%s}")
-		 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
-		 ("\\paragraph{%s}" . "\\paragraph*{%s}")))
-  :hook ((org-mode . (lambda () (display-line-numbers-mode -1) (flyspell-mode))))
-  :bind (:map org-mode-map (("C-c l" . org-store-link)
-			    ("C-c M-t" . org-todo))))
-
 (defun org-insert-book ()
   "Insert org-link from ~/Library for book."
   (interactive)
-- 
cgit v1.2.3