Browse Source

Merge branch 'master' of orgmode.org:org-mode

Bastien Guerry 5 years ago
parent
commit
06c98ceb60
2 changed files with 27 additions and 18 deletions
  1. 11 10
      contrib/lisp/org-e-beamer.el
  2. 16 8
      contrib/lisp/org-e-latex.el

+ 11 - 10
contrib/lisp/org-e-beamer.el

@@ -30,11 +30,11 @@
 ;; `org-e-beamer-export-to-latex' ("tex" file) and
 ;; `org-e-beamer-export-to-pdf' ("pdf" file).
 ;;
-;; On top of buffer keywords supported by `e-latex' back-end (see
-;; `org-e-latex-options-alist'), this back-end introduces the
-;; following keywords: "BEAMER_THEME", "BEAMER_COLOR_THEME",
-;; "BEAMER_FONT_THEME", "BEAMER_INNER_THEME" and "BEAMER_OUTER_THEME".
-;; All accept options in square brackets.
+;; On top of buffer keywords and options items supported by `e-latex'
+;; back-end (see `org-e-latex-options-alist'), this back-end
+;; introduces the following keywords: "BEAMER_THEME",
+;; "BEAMER_COLOR_THEME", "BEAMER_FONT_THEME", "BEAMER_INNER_THEME" and
+;; "BEAMER_OUTER_THEME".  All accept options in square brackets.
 ;;
 ;; Moreover, headlines now fall into three categories: sectioning
 ;; elements, frames and blocks.
@@ -874,11 +874,12 @@ holding export options."
      ;; 7. Title
      (format "\\title{%s}\n" title)
      ;; 8. 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))))
      ;; 9. Document start.
      "\\begin{document}\n\n"
      ;; 10. Title command.

+ 16 - 8
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.