From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Hirn Subject: org-export-latex-hyperref-options-format Date: Mon, 17 Feb 2014 14:41:27 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11348500fe9d2a04f2a02df7 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFV0b-0004CG-8S for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 15:41:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFV0U-0007jP-ET for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 15:41:45 -0500 Received: from mail-oa0-x22d.google.com ([2607:f8b0:4003:c02::22d]:53614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFV0U-0007h9-7B for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 15:41:38 -0500 Received: by mail-oa0-f45.google.com with SMTP id i11so18324603oag.18 for ; Mon, 17 Feb 2014 12:41:27 -0800 (PST) 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: emacs-orgmode@gnu.org --001a11348500fe9d2a04f2a02df7 Content-Type: text/plain; charset=ISO-8859-1 Hello. I recently upgraded to org 8 from the builtin org (7.x) of Emacs 24.3 and lost the ability to customize the \hypersetup block via the custom var org-export-latex-hyperref-options-format. Platform is OSX, Emacs installed via homebrew and org-mode updated via package.el. Org 7.x defines the var in org-latex.el. Because it's a builtin, the custom var still displays in the 'org-latex-export group when configuring options. However, the new export logic from ox-latex.el does not define this custom var, nor does it respect the value if it is set. This is doubly confusing because it appears the var is available, but it actually unused. I found this thread from September which describes the same issue, but the patch did not address adding the custom var back and seems to have died. http://lists.gnu.org/archive/html/emacs-orgmode/2013-09/msg01364.html I've created a patch via git format-patch which adds the custom var to ox-latex.el and makes use of it. Thanks for considering it. rom 0df51396b04bd785948032055e48b40787c15d98 Mon Sep 17 00:00:00 2001 From: Joe Hirn Date: Mon, 17 Feb 2014 14:39:35 -0600 Subject: [PATCH] add org-export-latex-hyperref-options-format custom var back to latex exporter --- ox-latex.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ox-latex.el b/ox-latex.el index 19f055e..9724def 100644 --- a/ox-latex.el +++ b/ox-latex.el @@ -186,6 +186,17 @@ :group 'org-export-latex :type '(string :tag "LaTeX class")) +(defcustom org-export-latex-hyperref-options-format + "\\hypersetup{\n pdfkeywords={%s},\n pdfsubject={%s},\n pdfcreator={Emacs Org-mode version %s}}\n" + "A format string for hyperref options. +When non-nil, it must contain three %s format specifications +which will respectively be replaced by the document's keywords, +its description and the Org's version number, as a string. Set +this option to the empty string if you don't want to include +hyperref options altogether." + :type 'string + :group 'org-export-latex) + (defcustom org-latex-classes '(("article" "\\documentclass[11pt]{article}" @@ -1119,7 +1130,7 @@ holding export options." (format "\\title{%s}\n" title) ;; Hyperref options. (when (plist-get info :latex-hyperref-p) - (format "\\hypersetup{\n pdfkeywords={%s},\n pdfsubject={%s},\n pdfcreator={%s}}\n" + (format org-export-latex-hyperref-options-format (or (plist-get info :keywords) "") (or (plist-get info :description) "") (if (not (plist-get info :with-creator)) "" -- 1.8.5.4 --001a11348500fe9d2a04f2a02df7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello. I recently upgraded to org 8 from the builtin org (= 7.x) of Emacs 24.3 and lost the ability to customize the \hypersetup block = via the custom var org-export-latex-hyperref-options-format. Platform is OS= X, Emacs installed via homebrew and org-mode updated via package.el.=A0
Org 7.x defines the var in org-latex.el. Because it's a = builtin, the custom var still displays in the 'org-latex-export group w= hen configuring options. However, the new export logic from ox-latex.el doe= s not define this custom var, nor does it respect the value if it is set. T= his is doubly confusing because it appears the var is available, but it act= ually unused.

I found this thread from September which describes the = same issue, but the patch did not address adding the custom var back and se= ems to have died. http://lists.gnu.org/archive/html/emacs-orgmode/20= 13-09/msg01364.html

I've created a patch via git format-patch which add= s the custom var to ox-latex.el and makes use of it. Thanks for considering= it.


rom 0df51396b04bd7859= 48032055e48b40787c15d98 Mon Sep 17 00:00:00 2001
From: Joe Hirn <joseph.hir= n@gmail.com>
Date: Mon, 17 Feb 2014 14:39:35 -0600
Subject: [PATCH] add org-export-latex-hyperref-options-format custom var= back
=A0to latex exporter

---
=A0ox-late= x.el | 13 ++++++++++++-
=A01 file changed, 12 insertions(+), 1 de= letion(-)

diff --git a/ox-latex.el b/ox-latex.el
index 19f055e..9724def 100644
--- a/ox-latex.el
++= + b/ox-latex.el
@@ -186,6 +186,17 @@
=A0 =A0:group '= ;org-export-latex
=A0 =A0:type '(string :tag "LaTeX clas= s"))

+(defcustom org-export-latex-hyperref-options-format
+ =A0"\\hypersetup{\n =A0pdfkeywords=3D{%s},\n =A0pdfsubject= =3D{%s},\n =A0pdfcreator=3D{Emacs Org-mode version %s}}\n"
+= =A0"A format string for hyperref options.
+When non-nil, it must contain three %s format specifications
+which will respectively be replaced by the document's keywords,
+its description and the Org's version number, as a string. =A0Se= t
+this option to the empty string if you don't want to include
+hyperref options altogether."
+ =A0:type 'string<= /div>
+ =A0:group 'org-export-latex)
+
=A0(defc= ustom org-latex-classes
=A0 =A0'(("article"
=A0 =A0 =A0 "\\docume= ntclass[11pt]{article}"
@@ -1119,7 +1130,7 @@ holding export= options."
=A0 =A0 =A0 (format "\\title{%s}\n" tit= le)
=A0 =A0 =A0 ;; Hyperref options.
=A0 =A0 =A0 (when (plist-get inf= o :latex-hyperref-p)
- =A0 =A0 =A0 (format "\\hypersetup{\n = =A0pdfkeywords=3D{%s},\n =A0pdfsubject=3D{%s},\n =A0pdfcreator=3D{%s}}\n&qu= ot;
+ =A0 =A0 =A0 (format org-export-latex-hyperref-options-forma= t
=A0 =A0 =A0 =A0 (or= (plist-get info :keywords) "")
=A0 =A0 =A0 =A0 (or (plist-get info :descriptio= n) "")
=A0 =A0 =A0 =A0 (if= (not (plist-get info :with-creator)) ""
--
1= .8.5.4





--001a11348500fe9d2a04f2a02df7--