ccr/startup.el

26 lines
785 B
EmacsLisp

(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 "<<tag:\\([0-9]+\\)>>" string pos)
(setq tag (max tag
(string-to-number (match-string 1 string)))
pos (match-end 0)))
(insert "<<tag:" (number-to-string (1+ tag)) ">>")))))