summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-10-08 18:20:58 +0300
committerThanos Apollo <[email protected]>2024-10-08 18:20:58 +0300
commit6621592ab51446f4f2882d6b8b8e0447444ea7ea (patch)
tree4f63b02f1b31f604be2bc49f3b91255ade3c429b /.config/emacs
parenta9748be0c1ab5215eed2854b13884b9b2e6fbabf (diff)
emacs: Update org-mode configuration.
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/init.el124
1 files changed, 67 insertions, 57 deletions
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)