summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dye <tsd@tsdye.com>2013-01-10 14:06:18 -1000
committerNicolas Goaziou <n.goaziou@gmail.com>2013-01-12 11:56:23 +0100
commitc1ecc518358884a8f028a055fdf907363eb6a37c (patch)
treee5617be3a0ec12c3cb3ad8a2a4a3fb70a3cff120
parent09f108ec576f6c7a7a33d0a3cdec9478ad1c9627 (diff)
downloadorg-mode-c1ecc518358884a8f028a055fdf907363eb6a37c.tar.gz
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.
-rw-r--r--contrib/lisp/org-e-latex.el24
1 files changed, 16 insertions, 8 deletions
diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el
index b8f8aa9..7d165d3 100644
--- a/contrib/lisp/org-e-latex.el
+++ b/contrib/lisp/org-e-latex.el
@@ -30,8 +30,8 @@
;; `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
-;; either a string or a symbol.
+;; "LATEX_CLASS_OPTIONS" and "LATEX_HEADER", and a new OPTIONS item:
+;; "textht".
;;
;; Table export can be controlled with a number of attributes (through
;; ATTR_LATEX keyword).
@@ -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,12 @@ 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 +1124,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.