(require 'ox-latex) (setq-local org-latex-classes '(("chapter-code" "\\documentclass{chapter-code}" ("\\chapter{%s}" . "\\chapter*{%s}") ("\\section{%s}" . "\\section*{%s}")))) (setq org-latex-hyperref-template " \\hypersetup{\n pdfauthor={%a},\n pdftitle={%t},\n pdfkeywords={%k}, pdfsubject={%d},\n pdfcreator={%c},\n pdflang={%L},\n colorlinks=true}\n") (local-set-key (kbd "C-c t") (lambda nil (interactive) (save-match-data (let ((string (buffer-string)) (pos 0) (tag 0)) (while (string-match "<>" string pos) (setq tag (max tag (string-to-number (match-string 1 string))) pos (match-end 0))) (insert "<>")))))