From 0ea8c582393e14431971a2b7df5707870ebdc09a Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Thu, 6 Jun 2024 08:42:43 +0200 Subject: [PATCH] Added custom-latex.el --- README.md | 3 +++ custom-latex.el | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 custom-latex.el diff --git a/README.md b/README.md index 4e0324a..15446e1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # EmacsConfigs +> Various settings for Emacs using Doom + +- `custom-latex.el`: Exchanges default export of TOOD items diff --git a/custom-latex.el b/custom-latex.el new file mode 100644 index 0000000..f0ccc94 --- /dev/null +++ b/custom-latex.el @@ -0,0 +1,21 @@ + +;; Default latex export behaviour is +;; \item {\bfseries\sffamily TODO} TITLE TEXT \hfill{}\textsc{TAGS} +;; +;; Change to +;; \item {\bfseries\sffamily TODO} TITLE TEXT \marginpar{\textsc{TAGS}} + + +(defun my-org-latex-format-headline-function (todo todo-type priority text tags _info) + "Custom function to format headlines for LaTeX export." + (concat + ;; Add the TODO keyword with a different formatting + (and todo (format "{\\%s} " todo)) + ;; Add the priority if present + (and priority (when priority (format "\\hspace{0.2em}\\%c" priority))) + ;; Add the headline text + (format "%s" text) + ;; Add tags if present + (and tags (format " \\marginpar\\textsc{%s}" tags)))) + +(setq org-latex-format-headline-function #'my-org-latex-format-headline-function)