From 510bb46b69aa9f00821a57372bae1cb4eeabc6d1 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Fri, 27 Mar 2015 13:46:08 +0100 Subject: [PATCH] ox-koma-letter: Add hyperref support * ox-koma-letter.el (org-koma-letter-template): Insert hyperref setup. --- contrib/lisp/ox-koma-letter.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 1a351abc4..6a9c5045d 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -618,11 +618,9 @@ holding export options." (format "\\setkomavar{fromaddress}{%s}\n" from-address))) ;; Date. (format "\\date{%s}\n" (org-export-data (org-export-get-date info) info)) - ;; Document start - "\\begin{document}\n\n" - ;; Subject and title + ;; Hyperref, document start, and subject and title. (let ((with-subject (plist-get info :with-subject))) - (when with-subject + (when (and with-subject (plist-get info :with-title)) (concat (unless (eq with-subject t) (format "\\KOMAoption{subject}{%s}\n" @@ -639,10 +637,18 @@ holding export options." (org-string-nw-p (org-export-data (plist-get info :title) info)))) (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 - (and subject (format "\\setkomavar{subject}{%s}\n" subject)) - (and title (format "\\setkomavar{title}{%s}\n" title)) + ;; Hyperref. + (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")))))) ;; Letter start. (format "\\begin{letter}{%%\n%s}\n\n"