From 448c9fe103d6b0f9a4ce42cbafc6d67093b7494e Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Wed, 9 Jan 2013 09:19:14 -1000 Subject: [PATCH] New LaTeX exporter: Add an option to toggle \hypersetup * contrib/lisp/org-e-latex.el: Added an option :texht that toggles insertion of \hypersetup{} in the tex file. It is possible to configure LaTeX export to omit the hyperref package where the \hypersetup command is defined. --- contrib/lisp/org-e-latex.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el index 79ae355..c4e7b99 100644 --- a/contrib/lisp/org-e-latex.el +++ b/contrib/lisp/org-e-latex.el @@ -29,8 +29,8 @@ ;; functions are available: `org-e-latex-publish-to-latex' and ;; `org-e-latex-publish-to-pdf'. ;; -;; The library introduces three new buffer keywords: "LATEX_CLASS", -;; "LATEX_CLASS_OPTIONS" and "LATEX_HEADER". Their value can be +;; The library introduces four new buffer keywords: "LATEX_CLASS", +;; "LATEX_CLASS_OPTIONS", "LATEX_HEADER", and "LATEX_HYPER". Their value can be ;; either a string or a symbol. ;; ;; Table export can be controlled with a number of attributes (through @@ -164,7 +164,9 @@ :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) + (:with-hyper "LATEX_HYPER" "texht" t t) + )) @@ -1117,11 +1119,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 :with-hyper) + (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