From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: [PATCH] New LaTeX exporter, switch for hypersetup Date: Wed, 09 Jan 2013 09:33:09 -1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tt1PN-00011s-R7 for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 14:33:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tt1PJ-0001iQ-Rr for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 14:33:53 -0500 Received: from oproxy5-pub.bluehost.com ([67.222.38.55]:59128) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Tt1PJ-0001i1-Jb for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 14:33:49 -0500 Received: from [72.253.173.33] (port=50675 helo=poto.local) by box472.bluehost.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1Tt1Or-0006CA-Vu for emacs-orgmode@gnu.org; Wed, 09 Jan 2013 12:33:23 -0700 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-LaTeX-exporter-Add-an-option-to-toggle-hypersetu.patch Content-Description: Patch to org-e-latex.el >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 --=-=-= Content-Type: text/plain -- 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 --=-=-=--