summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Hirn <joseph.hirn@gmail.com>2014-02-28 09:40:37 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-02-28 09:47:17 +0100
commit73714684e4f8836a80891c053b952151a90b93da (patch)
treed12b3b7186684f6eeea5970b21541c358fa55d14
parentbd9e0ad63deb7fe601bb370cf611405eccae4dde (diff)
downloadorg-mode-73714684e4f8836a80891c053b952151a90b93da.tar.gz
ox-latex: Allow customization of hyperrefsetup
* lisp/ox-latex.el (org-latex-hyperref-template): New variable. (org-latex-with-hyperref): Remove variable. (org-latex-template): Use new variable.
-rw-r--r--lisp/ox-latex.el31
1 files changed, 20 insertions, 11 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 50a08f6..f11d5d4 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -106,7 +106,7 @@
(:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
(:latex-header "LATEX_HEADER" nil nil newline)
(:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
- (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
+ (:latex-hyperref nil nil org-latex-hyperref-template t)
(:latex-custom-id-labels nil nil org-latex-custom-id-as-label))
:filters-alist '((:filter-options . org-latex-math-block-options-filter)
(:filter-parse-tree . org-latex-math-block-tree-filter)))
@@ -348,11 +348,19 @@ the toc:nil option, not to those generated with #+TOC keyword."
:group 'org-export-latex
:type 'string)
-(defcustom org-latex-with-hyperref t
- "Toggle insertion of \\hypersetup{...} in the preamble."
+(defcustom org-latex-hyperref-template
+ "\\hypersetup{\n pdfkeywords={%k},\n pdfsubject={%d},\n pdfcreator={%c}}\n"
+ "Template for hyperref package options.
+
+Value is a format string, which can contain the following placeholders:
+
+ %k for KEYWORDS line
+ %d for DESCRIPTION line
+ %c for CREATOR line
+
+Set it to the empty string to ignore the command completely."
:group 'org-export-latex
- :type 'boolean
- :safe #'booleanp)
+ :type 'string)
;;;; Headline
@@ -1188,12 +1196,13 @@ holding export options."
;; Title
(format "\\title{%s}\n" title)
;; Hyperref options.
- (when (plist-get info :latex-hyperref-p)
- (format "\\hypersetup{\n pdfkeywords={%s},\n pdfsubject={%s},\n pdfcreator={%s}}\n"
- (or (plist-get info :keywords) "")
- (or (plist-get info :description) "")
- (if (not (plist-get info :with-creator)) ""
- (plist-get info :creator))))
+ (format-spec (plist-get info :latex-hyperref)
+ (format-spec-make
+ ?k (or (plist-get info :keywords) "")
+ ?d (or (plist-get info :description)"")
+ ?c (if (plist-get info :with-creator)
+ (plist-get info :creator)
+ "")))
;; Document start.
"\\begin{document}\n\n"
;; Title command.