emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] New LaTeX exporter, switch for hypersetup
@ 2013-01-09 19:33 Thomas S. Dye
  2013-01-10 21:22 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2013-01-09 19:33 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Aloha all,

The attached patch introduces a new option, texht, that inhibits
insertion of \hypersetup when it is set to nil.

I don't think I fully understand how :options-alist works.  With the
attached patch I was expecting to be able to use #+LATEX_HYPER: nil, but
this didn't work for me.

The motivation for the patch is that I'm attempting to export to a
journal specification that stipulates which packages must be used and
prohibits any additions---hyperref isn't on the list.

All the best,
Tom


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to org-e-latex.el --]
[-- Type: text/x-patch, Size: 2423 bytes --]

From 448c9fe103d6b0f9a4ce42cbafc6d67093b7494e Mon Sep 17 00:00:00 2001
From: Thomas Dye <tsd@tsdye.com>
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)
+		  ))
 
 
 \f
@@ -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


[-- Attachment #3: Type: text/plain, Size: 146 bytes --]


-- 
T.S. Dye & Colleagues, Archaeologists
735 Bishop St, Suite 315, Honolulu, HI 96813
Tel: 808-529-0866, Fax: 808-529-0884
http://www.tsdye.com

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-12 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-09 19:33 [PATCH] New LaTeX exporter, switch for hypersetup Thomas S. Dye
2013-01-10 21:22 ` Nicolas Goaziou
2013-01-11  0:20   ` Thomas S. Dye
2013-01-12 11:07     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).