EmacsConfigs/custom-latex.el

22 lines
770 B
EmacsLisp
Raw Permalink Normal View History

2024-06-06 08:42:43 +02:00
;; 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
2024-06-06 09:10:16 +02:00
(and todo (format "{\%s} " todo))
2024-06-06 08:42:43 +02:00
;; 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)