Added custom-latex.el

This commit is contained in:
FrederikBaerentsen 2024-06-06 08:42:43 +02:00
parent c964908e44
commit 0ea8c58239
2 changed files with 24 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# EmacsConfigs
> Various settings for Emacs using Doom
- `custom-latex.el`: Exchanges default export of TOOD items

21
custom-latex.el Normal file
View File

@ -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)