From 4946aec91aa6de433beb1301c77ebbb8924a2404 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Thu, 10 Jan 2013 14:06:18 -1000 Subject: [PATCH] New LaTeX exporter: Add an option to toggle insertion of \hypersetup{...} in preamble * contrib/lisp/org-e-latex.el: Added an option, :texht, and a defcustom, org-e-latex-with-hyperref, to hold its default value. It is possible to configure the exporter to omit the hyperref package, which defines the \hypersetup{} command. --- contrib/lisp/org-e-latex.el | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el index b8f8aa9..f394bc2 100644 --- a/contrib/lisp/org-e-latex.el +++ b/contrib/lisp/org-e-latex.el @@ -164,7 +164,8 @@ :options-alist ((:date "DATE" nil org-e-latex-date-format t) (:latex-class "LATEX_CLASS" nil org-e-latex-default-class t) (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t) - (:latex-header-extra "LATEX_HEADER" nil nil newline))) + (:latex-header-extra "LATEX_HEADER" nil nil newline) + (:latex-hyperref-p nil "texht" org-e-latex-with-hyperref t))) @@ -399,6 +400,11 @@ toc:nil option, not to those generated with #+TOC keyword." :group 'org-export-e-latex :type 'string) +(defcustom org-e-latex-with-hyperref t + "Toggle insertion of \hypersetup{...} in the preamble." + :group 'org-export-e-latex + :type 'boolean) + ;;;; Headline (defcustom org-e-latex-format-headline-function nil @@ -1117,11 +1123,12 @@ holding export options." ;; Title (format "\\title{%s}\n" title) ;; Hyperref options. - (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))) + (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)))) ;; Document start. "\\begin{document}\n\n" ;; Title command. -- 1.8.0.2