ox-koma-letter: Add hyperref support

* ox-koma-letter.el (org-koma-letter-template): Insert hyperref setup.
This commit is contained in:
Rasmus 2015-03-27 13:46:08 +01:00
parent 69cab81ffa
commit 510bb46b69
1 changed files with 13 additions and 7 deletions

View File

@ -618,11 +618,9 @@ holding export options."
(format "\\setkomavar{fromaddress}{%s}\n" from-address))) (format "\\setkomavar{fromaddress}{%s}\n" from-address)))
;; Date. ;; Date.
(format "\\date{%s}\n" (org-export-data (org-export-get-date info) info)) (format "\\date{%s}\n" (org-export-data (org-export-get-date info) info))
;; Document start ;; Hyperref, document start, and subject and title.
"\\begin{document}\n\n"
;; Subject and title
(let ((with-subject (plist-get info :with-subject))) (let ((with-subject (plist-get info :with-subject)))
(when with-subject (when (and with-subject (plist-get info :with-title))
(concat (concat
(unless (eq with-subject t) (unless (eq with-subject t)
(format "\\KOMAoption{subject}{%s}\n" (format "\\KOMAoption{subject}{%s}\n"
@ -639,10 +637,18 @@ holding export options."
(org-string-nw-p (org-string-nw-p
(org-export-data (plist-get info :title) info)))) (org-export-data (plist-get info :title) info))))
(subject (if title-as-subject (or subject* title*) subject*)) (subject (if title-as-subject (or subject* title*) subject*))
(title (if title-as-subject (and subject* title*) title*))) (title (if title-as-subject (and subject* title*) title*))
(hyperref-template (plist-get info :latex-hyperref-template))
(spec (append (list (cons ?t (or title subject "")))
(org-latex--format-spec info))))
(concat (concat
(and subject (format "\\setkomavar{subject}{%s}\n" subject)) ;; Hyperref.
(and title (format "\\setkomavar{title}{%s}\n" title)) (format-spec hyperref-template spec)
;; Document start.
"\\begin{document}\n\n"
;; Subject and title.
(when subject (format "\\setkomavar{subject}{%s}\n" subject))
(when title (format "\\setkomavar{title}{%s}\n" title))
(when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n")))))) (when (or (org-string-nw-p title) (org-string-nw-p subject)) "\n"))))))
;; Letter start. ;; Letter start.
(format "\\begin{letter}{%%\n%s}\n\n" (format "\\begin{letter}{%%\n%s}\n\n"