all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* org-export-latex-hyperref-options-format
@ 2014-02-17 20:41 Joe Hirn
  2014-02-17 22:13 ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-17 20:41 UTC (permalink / raw)
  To: emacs-orgmode

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

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 <joseph.hirn@gmail.com>
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

[-- Attachment #2: Type: text/html, Size: 3734 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-17 20:41 org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-17 22:13 ` Nicolas Goaziou
  2014-02-17 22:59   ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-17 22:13 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode

Hello,

Joe Hirn <joseph.hirn@gmail.com> writes:

> 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.

The problem will go with the next Emacs release.

> 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

Actually, there is a way to ignore hypersetup block. See
`org-latex-with-hyperref'.

If you really want a custom command, I think it is better to first
disable it with the variable aforementioned, then include your own
with #+latex_header or in a custom latex class (see
`org-latex-classes').

You can also use a filter to change it on the fly, but that would be
less straightforward.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-17 22:13 ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-17 22:59   ` Joe Hirn
  2014-02-17 23:23     ` org-export-latex-hyperref-options-format Nicolas Goaziou
  2014-02-17 23:25     ` org-export-latex-hyperref-options-format Rasmus
  0 siblings, 2 replies; 34+ messages in thread
From: Joe Hirn @ 2014-02-17 22:59 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

Hm. That's disappointing. I really prefer the original behavior. I don't
want to copy #+latex_header to get this default behavior into each of my
org-mode files.

I guess I'll just have to maintain this by redefining the entire
org-latex-template function to look at my variable instead of the hard
coded string. A pain but apparently my own option.

Thanks.


On Mon, Feb 17, 2014 at 4:13 PM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > 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.
>
> The problem will go with the next Emacs release.
>
> > 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
>
> Actually, there is a way to ignore hypersetup block. See
> `org-latex-with-hyperref'.
>
> If you really want a custom command, I think it is better to first
> disable it with the variable aforementioned, then include your own
> with #+latex_header or in a custom latex class (see
> `org-latex-classes').
>
> You can also use a filter to change it on the fly, but that would be
> less straightforward.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 2706 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-17 22:59   ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-17 23:23     ` Nicolas Goaziou
  2014-02-17 23:42       ` org-export-latex-hyperref-options-format Joe Hirn
  2014-02-17 23:25     ` org-export-latex-hyperref-options-format Rasmus
  1 sibling, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-17 23:23 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode

Joe Hirn <joseph.hirn@gmail.com> writes:

> Hm. That's disappointing. I really prefer the original behavior. I don't
> want to copy #+latex_header to get this default behavior into each of my
> org-mode files.

I suggested other ways to handle it.

Anyway your patch has two drawbacks:

  1. It is partly redundant with `org-latex-with-hyperref'.

  2. A mere format string doesn't provide real flexibility (e.g., what if
     I don't want the pdfkeywords part?) when you want some.  Perhaps
     something based on `format-spec' would be better.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-17 22:59   ` org-export-latex-hyperref-options-format Joe Hirn
  2014-02-17 23:23     ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-17 23:25     ` Rasmus
  1 sibling, 0 replies; 34+ messages in thread
From: Rasmus @ 2014-02-17 23:25 UTC (permalink / raw)
  To: emacs-orgmode

Joe Hirn <joseph.hirn@gmail.com> writes:

> Hm. That's disappointing. I really prefer the original behavior. I don't
> want to copy #+latex_header to get this default behavior into each of my
> org-mode files.
>
> I guess I'll just have to maintain this by redefining the entire
> org-latex-template function to look at my variable instead of the hard
> coded string. A pain but apparently my own option.

Before doing so reread Nicholas' suggestion.

I.e.:
Set org-latex-with-hyperref to nil.  Look at org-latex-classes and add
your preferred hypersetup to a new class (note an Org LaTeX class is a
predefined preamble in LaTeX terms).  Set org-latex-default-class to
your new class.

If this is not flexible enough use a filter.  Several filter examples
modifying the preamble have been posted on this list.

—Rasmus

> On Mon, Feb 17, 2014 at 4:13 PM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:
>
>> Hello,
>>
>> Joe Hirn <joseph.hirn@gmail.com> writes:
>>
>> > 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.
>>
>> The problem will go with the next Emacs release.
>>
>> > 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
>>
>> Actually, there is a way to ignore hypersetup block. See
>> `org-latex-with-hyperref'.
>>
>> If you really want a custom command, I think it is better to first
>> disable it with the variable aforementioned, then include your own
>> with #+latex_header or in a custom latex class (see
>> `org-latex-classes').
>>
>> You can also use a filter to change it on the fly, but that would be
>> less straightforward.
>>
>>
>> Regards,
>>
>> --
>> Nicolas Goaziou
>>

-- 
El Rey ha muerto. ¡Larga vida al Rey!

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

* Re: org-export-latex-hyperref-options-format
  2014-02-17 23:23     ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-17 23:42       ` Joe Hirn
  2014-02-19 13:05         ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-17 23:42 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

I'm sorry man. That may have came off wrong. Did not mean to sound
ungrateful.

Thanks for offering the workarounds and thanks for responding.

I definitely agree with drawback #2.

So I understand, you're recommending I disable org-latex-with-hyperref and
then add my own \\hypersetup. My goal would be to avoid placing a #+ entry
into every .org file I compose. Which var would be the easiest to to adjust
so I can emit \\hypersetup by default and still access the info map that is
passed to org-latex-template. I'd like to get the keywords, subject and
creator variables that are emitted right now.




On Mon, Feb 17, 2014 at 5:23 PM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > Hm. That's disappointing. I really prefer the original behavior. I don't
> > want to copy #+latex_header to get this default behavior into each of my
> > org-mode files.
>
> I suggested other ways to handle it.
>
> Anyway your patch has two drawbacks:
>
>   1. It is partly redundant with `org-latex-with-hyperref'.
>
>   2. A mere format string doesn't provide real flexibility (e.g., what if
>      I don't want the pdfkeywords part?) when you want some.  Perhaps
>      something based on `format-spec' would be better.
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 1965 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-17 23:42       ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-19 13:05         ` Nicolas Goaziou
  2014-02-19 16:21           ` org-export-latex-hyperref-options-format Joe Hirn
  2014-02-19 22:43           ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 2 replies; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-19 13:05 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode

Hello,

Joe Hirn <joseph.hirn@gmail.com> writes:

> So I understand, you're recommending I disable org-latex-with-hyperref and
> then add my own \\hypersetup. My goal would be to avoid placing a #+ entry
> into every .org file I compose. Which var would be the easiest to to adjust
> so I can emit \\hypersetup by default and still access the info map that is
> passed to org-latex-template. I'd like to get the keywords, subject and
> creator variables that are emitted right now.

On a personal level, if you only need to add keyword-value pairs,
I think the simplest solution is to add a class in `org-latex-classes',
where you insert an additional "\hypersetup{...}" command. You don't
need to change `org-latex-with-hyperref' in this case.

You can also use a (final) filter to install this command if you don't
want to bother creating a new class.

On a more general level, I'll welcome a solution replacing
`org-latex-with-hyperref' with `org-latex-hyperref-template', which
could be either nil (no hyperref command) or a string with some
placeholders (e.g. %k for keywords).

What do you think?


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-19 13:05         ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-19 16:21           ` Joe Hirn
  2014-02-19 22:43           ` org-export-latex-hyperref-options-format Joe Hirn
  1 sibling, 0 replies; 34+ messages in thread
From: Joe Hirn @ 2014-02-19 16:21 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

I think that's a great idea.

Thanks for helping me workaround my individual problem and advice on what
type of patch you're welcoming.

I just happen to have the free time today so I'll try to get a patch to
you.


On Wed, Feb 19, 2014 at 7:05 AM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > So I understand, you're recommending I disable org-latex-with-hyperref
> and
> > then add my own \\hypersetup. My goal would be to avoid placing a #+
> entry
> > into every .org file I compose. Which var would be the easiest to to
> adjust
> > so I can emit \\hypersetup by default and still access the info map that
> is
> > passed to org-latex-template. I'd like to get the keywords, subject and
> > creator variables that are emitted right now.
>
> On a personal level, if you only need to add keyword-value pairs,
> I think the simplest solution is to add a class in `org-latex-classes',
> where you insert an additional "\hypersetup{...}" command. You don't
> need to change `org-latex-with-hyperref' in this case.
>
> You can also use a (final) filter to install this command if you don't
> want to bother creating a new class.
>
> On a more general level, I'll welcome a solution replacing
> `org-latex-with-hyperref' with `org-latex-hyperref-template', which
> could be either nil (no hyperref command) or a string with some
> placeholders (e.g. %k for keywords).
>
> What do you think?
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 2157 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-19 13:05         ` org-export-latex-hyperref-options-format Nicolas Goaziou
  2014-02-19 16:21           ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-19 22:43           ` Joe Hirn
  2014-02-20 10:22             ` org-export-latex-hyperref-options-format Nicolas Goaziou
  1 sibling, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-19 22:43 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

Hi just sat down to code this up. I assume the keywords are so we can use
data within the plist argument (info) passed to `org-latex-template'. But
I'm not exactly sure what you mean by %k for keywords.

Are you suggesting we could do something like:

"\\hypersetup{\n  pdfkeywords={%kkeywords},\n
 pdfsubject={%kdescription},\n  pdfcreator={%kcreator}}\n"

If that's the idea, is there a more powerful construct than regex matching
for achieving this? Otherwise, can you give me an example of what you had
in mind for the keyword placeholders.

Thanks


On Wed, Feb 19, 2014 at 7:05 AM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > So I understand, you're recommending I disable org-latex-with-hyperref
> and
> > then add my own \\hypersetup. My goal would be to avoid placing a #+
> entry
> > into every .org file I compose. Which var would be the easiest to to
> adjust
> > so I can emit \\hypersetup by default and still access the info map that
> is
> > passed to org-latex-template. I'd like to get the keywords, subject and
> > creator variables that are emitted right now.
>
> On a personal level, if you only need to add keyword-value pairs,
> I think the simplest solution is to add a class in `org-latex-classes',
> where you insert an additional "\hypersetup{...}" command. You don't
> need to change `org-latex-with-hyperref' in this case.
>
> You can also use a (final) filter to install this command if you don't
> want to bother creating a new class.
>
> On a more general level, I'll welcome a solution replacing
> `org-latex-with-hyperref' with `org-latex-hyperref-template', which
> could be either nil (no hyperref command) or a string with some
> placeholders (e.g. %k for keywords).
>
> What do you think?
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 2562 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-19 22:43           ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-20 10:22             ` Nicolas Goaziou
  2014-02-20 12:34               ` org-export-latex-hyperref-options-format Joseph Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-20 10:22 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode

Hello,

Joe Hirn <joseph.hirn@gmail.com> writes:

> Hi just sat down to code this up. I assume the keywords are so we can use
> data within the plist argument (info) passed to `org-latex-template'. But
> I'm not exactly sure what you mean by %k for keywords.
>
> Are you suggesting we could do something like:
>
> "\\hypersetup{\n  pdfkeywords={%kkeywords},\n
>  pdfsubject={%kdescription},\n  pdfcreator={%kcreator}}\n"
>
> If that's the idea, is there a more powerful construct than regex matching
> for achieving this? Otherwise, can you give me an example of what you had
> in mind for the keyword placeholders.

I'm suggesting to use `format-spec', e.g., something like:

  (and org-latex-hyperref-template
       (format-spec org-latex-hyperref-template
                    (format-spec-make
                     ?k (or (plist-get info :keywords) "")
                     ?d (or (plist-get info :description) "")
                     ?c (if (not (plist-get info :with-creator)) ""
                          (plist-get info :creator)))))

Thus, when `org-latex-hyperref-template' is nil, no "\hyperref" command
is inserted, otherwise, it is a format string where %k is replaced with
KEYWORDS, %d with DESCRIPTION and %c with CREATOR.

Default value for the variable would be:

  "\\hypersetup{\n  pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"

A (require 'format-spec) will be needed in the beginning of
"ox-latex.el".


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-20 10:22             ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-20 12:34               ` Joseph Hirn
  2014-02-20 17:58                 ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Joseph Hirn @ 2014-02-20 12:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

Ok. I was hesitant to require anything additional but I should be able
to knock this out.

Thx again.

Sent from my iPhone

> On Feb 20, 2014, at 4:22 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
>
> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
>> Hi just sat down to code this up. I assume the keywords are so we can use
>> data within the plist argument (info) passed to `org-latex-template'. But
>> I'm not exactly sure what you mean by %k for keywords.
>>
>> Are you suggesting we could do something like:
>>
>> "\\hypersetup{\n  pdfkeywords={%kkeywords},\n
>> pdfsubject={%kdescription},\n  pdfcreator={%kcreator}}\n"
>>
>> If that's the idea, is there a more powerful construct than regex matching
>> for achieving this? Otherwise, can you give me an example of what you had
>> in mind for the keyword placeholders.
>
> I'm suggesting to use `format-spec', e.g., something like:
>
>  (and org-latex-hyperref-template
>       (format-spec org-latex-hyperref-template
>                    (format-spec-make
>                     ?k (or (plist-get info :keywords) "")
>                     ?d (or (plist-get info :description) "")
>                     ?c (if (not (plist-get info :with-creator)) ""
>                          (plist-get info :creator)))))
>
> Thus, when `org-latex-hyperref-template' is nil, no "\hyperref" command
> is inserted, otherwise, it is a format string where %k is replaced with
> KEYWORDS, %d with DESCRIPTION and %c with CREATOR.
>
> Default value for the variable would be:
>
>  "\\hypersetup{\n  pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
>
> A (require 'format-spec) will be needed in the beginning of
> "ox-latex.el".
>
>
> Regards,
>
> --
> Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-20 12:34               ` org-export-latex-hyperref-options-format Joseph Hirn
@ 2014-02-20 17:58                 ` Joe Hirn
  2014-02-20 20:51                   ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-20 17:58 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

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

Hi Nicholas.

I was able to test this on my local machine and it seems to work as we
discussed.

If there are any other changes to the patch you'd like to see, please let
me know.

Thanks for your help. I really appreciate it.


****************BEGIN PATCH**********************
diff --git a/ox-latex.el b/ox-latex.el
index 19f055e..9ed6372 100644
--- a/ox-latex.el
+++ b/ox-latex.el
@@ -103,7 +103,7 @@
    (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
    (:latex-header "LATEX_HEADER" nil nil newline)
    (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
-   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
+   (:latex-hyperref-p nil "texht" (if org-latex-hyperref-template t) t)
    ;; Redefine regular options.
    (:date "DATE" nil "\\today" t)))

@@ -341,10 +341,11 @@ the toc:nil option, not to those generated with #+TOC
keyword."
   :group 'org-export-latex
   :type 'string)

-(defcustom org-latex-with-hyperref t
-  "Toggle insertion of \\hypersetup{...} in the preamble."
+
+(defcustom org-latex-hyperref-template "\\hypersetup{\n
 pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
+  "The value of \\hyperrefsetup{...} in the preamble. String is a
format-spec which accepts keywords for %k (pdfkeywords), %d
(pdfdescription) and %c (pdfcreator). Set to nil for no \\hyperrefsetup."
   :group 'org-export-latex
-  :type 'boolean)
+  :type 'string)

 ;;;; Headline

@@ -1119,11 +1120,13 @@ 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"
-       (or (plist-get info :keywords) "")
-       (or (plist-get info :description) "")
-       (if (not (plist-get info :with-creator)) ""
- (plist-get info :creator))))
+       (format-spec org-latex-hyperref-template
+                    (format-spec-make
+                     ?k (or (plist-get info :keywords) "")
+                     ?d (or (plist-get info :description)"")
+                     ?c (if (plist-get info :with-creator)
+                            (plist-get info :creator)
+                          ""))))
      ;; Document start.
      "\\begin{document}\n\n"
      ;; Title command.
****************END  PATCH**********************


On Thu, Feb 20, 2014 at 6:34 AM, Joseph Hirn <joseph.hirn@gmail.com> wrote:

> Ok. I was hesitant to require anything additional but I should be able
> to knock this out.
>
> Thx again.
>
> Sent from my iPhone
>
> > On Feb 20, 2014, at 4:22 AM, Nicolas Goaziou <n.goaziou@gmail.com>
> wrote:
> >
> > Hello,
> >
> > Joe Hirn <joseph.hirn@gmail.com> writes:
> >
> >> Hi just sat down to code this up. I assume the keywords are so we can
> use
> >> data within the plist argument (info) passed to `org-latex-template'.
> But
> >> I'm not exactly sure what you mean by %k for keywords.
> >>
> >> Are you suggesting we could do something like:
> >>
> >> "\\hypersetup{\n  pdfkeywords={%kkeywords},\n
> >> pdfsubject={%kdescription},\n  pdfcreator={%kcreator}}\n"
> >>
> >> If that's the idea, is there a more powerful construct than regex
> matching
> >> for achieving this? Otherwise, can you give me an example of what you
> had
> >> in mind for the keyword placeholders.
> >
> > I'm suggesting to use `format-spec', e.g., something like:
> >
> >  (and org-latex-hyperref-template
> >       (format-spec org-latex-hyperref-template
> >                    (format-spec-make
> >                     ?k (or (plist-get info :keywords) "")
> >                     ?d (or (plist-get info :description) "")
> >                     ?c (if (not (plist-get info :with-creator)) ""
> >                          (plist-get info :creator)))))
> >
> > Thus, when `org-latex-hyperref-template' is nil, no "\hyperref" command
> > is inserted, otherwise, it is a format string where %k is replaced with
> > KEYWORDS, %d with DESCRIPTION and %c with CREATOR.
> >
> > Default value for the variable would be:
> >
> >  "\\hypersetup{\n  pdfkeywords={%k},\n  pdfsubject={%d},\n
>  pdfcreator={%c}}\n"
> >
> > A (require 'format-spec) will be needed in the beginning of
> > "ox-latex.el".
> >
> >
> > Regards,
> >
> > --
> > Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 6500 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-20 17:58                 ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-20 20:51                   ` Nicolas Goaziou
  2014-02-20 21:52                     ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-20 20:51 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode@gnu.org

Hello,

Joe Hirn <joseph.hirn@gmail.com> writes:

> I was able to test this on my local machine and it seems to work as we
> discussed.
>
> If there are any other changes to the patch you'd like to see, please let
> me know.

Thank you for the patch. Here are a few comments.

> -   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
> +   (:latex-hyperref-p nil "texht" (if org-latex-hyperref-template t) t)

I think we can drop the "-p" suffix since this is no longer a predicate.
So the property can be named :latex-hyperref.

Also we can replace "texht" with nil since it doesn't make much sense to
specify a full template from the OPTIONS line.

Eventually, the default value should be `org-latex-hyperref-template'.

This boils down to the following line:

  (:latex-hyperref nil nil org-latex-hyperref-template t)

> -(defcustom org-latex-with-hyperref t
> -  "Toggle insertion of \\hypersetup{...} in the preamble."
> +
> +(defcustom org-latex-hyperref-template "\\hypersetup{\n
>  pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
> +  "The value of \\hyperrefsetup{...} in the preamble. String is a
> format-spec which accepts keywords for %k (pdfkeywords), %d
> (pdfdescription) and %c (pdfcreator). Set to nil for no \\hyperrefsetup."
>    :group 'org-export-latex
> -  :type 'boolean)
> +  :type 'string)

The first line of the docstring should contain complete sentences only.
I would say something along the lines:

  "Template for hyperref package options.

Value is a format string, which can contain the following placeholders:

  %k for KEYWORDS line
  %d for DESCRIPTION line
  %c for CREATOR line

An empty string disables the setup."

Since you specify :type as 'string, it is wrong to expect a nil value in
the variable. Note that nil is not an absolute necessity. We can allow
to disable the template with an empty string instead.

> +       (format-spec org-latex-hyperref-template
> +                    (format-spec-make
> +                     ?k (or (plist-get info :keywords) "")
> +                     ?d (or (plist-get info :description)"")
> +                     ?c (if (plist-get info :with-creator)
> +                            (plist-get info :creator)
> +                          ""))))

You are not using the :latex-hyperref property. This should be:

  (format-spec (plist-get info :latex-hyperref)
               ...)


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-20 20:51                   ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-20 21:52                     ` Joe Hirn
  2014-02-20 22:53                       ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-20 21:52 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

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

I really appreciate your review. Sorry for the pedestrian code submission.
I don't get candid critical feedback on my e-lisp, so it's great to learn
more about its idioms and conventions.

I'll incorporate your feedback into a new patch.


On Thu, Feb 20, 2014 at 2:51 PM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > I was able to test this on my local machine and it seems to work as we
> > discussed.
> >
> > If there are any other changes to the patch you'd like to see, please let
> > me know.
>
> Thank you for the patch. Here are a few comments.
>
> > -   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
> > +   (:latex-hyperref-p nil "texht" (if org-latex-hyperref-template t) t)
>
> I think we can drop the "-p" suffix since this is no longer a predicate.
> So the property can be named :latex-hyperref.
>
> Also we can replace "texht" with nil since it doesn't make much sense to
> specify a full template from the OPTIONS line.
>
> Eventually, the default value should be `org-latex-hyperref-template'.
>
> This boils down to the following line:
>
>   (:latex-hyperref nil nil org-latex-hyperref-template t)
>
> > -(defcustom org-latex-with-hyperref t
> > -  "Toggle insertion of \\hypersetup{...} in the preamble."
> > +
> > +(defcustom org-latex-hyperref-template "\\hypersetup{\n
> >  pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
> > +  "The value of \\hyperrefsetup{...} in the preamble. String is a
> > format-spec which accepts keywords for %k (pdfkeywords), %d
> > (pdfdescription) and %c (pdfcreator). Set to nil for no \\hyperrefsetup."
> >    :group 'org-export-latex
> > -  :type 'boolean)
> > +  :type 'string)
>
> The first line of the docstring should contain complete sentences only.
> I would say something along the lines:
>
>   "Template for hyperref package options.
>
> Value is a format string, which can contain the following placeholders:
>
>   %k for KEYWORDS line
>   %d for DESCRIPTION line
>   %c for CREATOR line
>
> An empty string disables the setup."
>
> Since you specify :type as 'string, it is wrong to expect a nil value in
> the variable. Note that nil is not an absolute necessity. We can allow
> to disable the template with an empty string instead.
>
> > +       (format-spec org-latex-hyperref-template
> > +                    (format-spec-make
> > +                     ?k (or (plist-get info :keywords) "")
> > +                     ?d (or (plist-get info :description)"")
> > +                     ?c (if (plist-get info :with-creator)
> > +                            (plist-get info :creator)
> > +                          ""))))
>
> You are not using the :latex-hyperref property. This should be:
>
>   (format-spec (plist-get info :latex-hyperref)
>                ...)
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 3859 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-20 21:52                     ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-20 22:53                       ` Joe Hirn
  2014-02-21 17:28                         ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-20 22:53 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

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

With recommended changes.

******** BEGIN PATCH *********
diff --git a/ox-latex.el b/ox-latex.el
index 19f055e..f6e5a09 100644
--- a/ox-latex.el
+++ b/ox-latex.el
@@ -103,7 +103,7 @@
    (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
    (:latex-header "LATEX_HEADER" nil nil newline)
    (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
-   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
+   (:latex-hyperref nil nil org-latex-hyperref-template t)
    ;; Redefine regular options.
    (:date "DATE" nil "\\today" t)))

@@ -341,10 +341,18 @@ the toc:nil option, not to those generated with #+TOC
keyword."
   :group 'org-export-latex
   :type 'string)

-(defcustom org-latex-with-hyperref t
-  "Toggle insertion of \\hypersetup{...} in the preamble."
+(defcustom org-latex-hyperref-template "\\hypersetup{\n
pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
+  "Template for hyperref package options.
+
+Value is a format string, which can contain the following placeholders:
+
+  %k for KEYWORDS line
+  %d for DESCRIPTION line
+  %c for CREATOR line
+
+An empty string disables the setup."
   :group 'org-export-latex
-  :type 'boolean)
+  :type 'string)

 ;;;; Headline

@@ -1118,12 +1126,13 @@ holding export options."
      ;; Title
      (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"
-       (or (plist-get info :keywords) "")
-       (or (plist-get info :description) "")
-       (if (not (plist-get info :with-creator)) ""
- (plist-get info :creator))))
+     (format-spec (plist-get info :latex-hyperref)
+                  (format-spec-make
+                   ?k (or (plist-get info :keywords) "")
+                   ?d (or (plist-get info :description)"")
+                   ?c (if (plist-get info :with-creator)
+                          (plist-get info :creator)
+                        "")))
      ;; Document start.
      "\\begin{document}\n\n"
      ;; Title command.
******** END PATCH *********


On Thu, Feb 20, 2014 at 3:52 PM, Joe Hirn <joseph.hirn@gmail.com> wrote:

> I really appreciate your review. Sorry for the pedestrian code submission.
> I don't get candid critical feedback on my e-lisp, so it's great to learn
> more about its idioms and conventions.
>
> I'll incorporate your feedback into a new patch.
>
>
> On Thu, Feb 20, 2014 at 2:51 PM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:
>
>> Hello,
>>
>> Joe Hirn <joseph.hirn@gmail.com> writes:
>>
>> > I was able to test this on my local machine and it seems to work as we
>> > discussed.
>> >
>> > If there are any other changes to the patch you'd like to see, please
>> let
>> > me know.
>>
>> Thank you for the patch. Here are a few comments.
>>
>> > -   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
>> > +   (:latex-hyperref-p nil "texht" (if org-latex-hyperref-template t) t)
>>
>> I think we can drop the "-p" suffix since this is no longer a predicate.
>> So the property can be named :latex-hyperref.
>>
>> Also we can replace "texht" with nil since it doesn't make much sense to
>> specify a full template from the OPTIONS line.
>>
>> Eventually, the default value should be `org-latex-hyperref-template'.
>>
>> This boils down to the following line:
>>
>>   (:latex-hyperref nil nil org-latex-hyperref-template t)
>>
>> > -(defcustom org-latex-with-hyperref t
>> > -  "Toggle insertion of \\hypersetup{...} in the preamble."
>> > +
>> > +(defcustom org-latex-hyperref-template "\\hypersetup{\n
>> >  pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
>> > +  "The value of \\hyperrefsetup{...} in the preamble. String is a
>> > format-spec which accepts keywords for %k (pdfkeywords), %d
>> > (pdfdescription) and %c (pdfcreator). Set to nil for no
>> \\hyperrefsetup."
>> >    :group 'org-export-latex
>> > -  :type 'boolean)
>> > +  :type 'string)
>>
>> The first line of the docstring should contain complete sentences only.
>> I would say something along the lines:
>>
>>   "Template for hyperref package options.
>>
>> Value is a format string, which can contain the following placeholders:
>>
>>   %k for KEYWORDS line
>>   %d for DESCRIPTION line
>>   %c for CREATOR line
>>
>> An empty string disables the setup."
>>
>> Since you specify :type as 'string, it is wrong to expect a nil value in
>> the variable. Note that nil is not an absolute necessity. We can allow
>> to disable the template with an empty string instead.
>>
>> > +       (format-spec org-latex-hyperref-template
>> > +                    (format-spec-make
>> > +                     ?k (or (plist-get info :keywords) "")
>> > +                     ?d (or (plist-get info :description)"")
>> > +                     ?c (if (plist-get info :with-creator)
>> > +                            (plist-get info :creator)
>> > +                          ""))))
>>
>> You are not using the :latex-hyperref property. This should be:
>>
>>   (format-spec (plist-get info :latex-hyperref)
>>                ...)
>>
>>
>> Regards,
>>
>> --
>> Nicolas Goaziou
>>
>
>

[-- Attachment #2: Type: text/html, Size: 7702 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-20 22:53                       ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-21 17:28                         ` Nicolas Goaziou
  2014-02-21 18:35                           ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-21 17:28 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode@gnu.org

Hello,

Joe Hirn <joseph.hirn@gmail.com> writes:

> With recommended changes.

Thank you. It looks good.

Could you add a commit message (see "Commit messages and ChangeLog
entries" section in http://orgmode.org/worg/org-contribute.html) and
send it again, using "git format-patch"?


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-21 17:28                         ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-21 18:35                           ` Joe Hirn
  2014-02-22  9:39                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-21 18:35 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

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

Here you go.

Thanks a lot for all your help. Was really nice working on it with you.


From af2a8066be01b94504fff9e009617ce186bd9e03 Mon Sep 17 00:00:00 2001
From: Joe Hirn <joseph.hirn@gmail.com>
Date: Fri, 21 Feb 2014 12:15:58 -0600
Subject: [PATCH] Allow customization of hyperrefsetup via
 `org-latex-hyperref-template'

* ox-latex.el (org-latex-hyperref-template): Add custom var
`org-latex-hyperref-template' to enable
  customization of the \\hypersetup{...}. The value is a format-spec
  with placeholders for KEYWORDS, DESCRIPTION and CREATOR.

  (org-latex-with-hyperref): Remove custom var
  `org-latex-with-hyperref'. Set `org-latex-hyperref-template' to
  an empty string to disable the \\hypersetup{...} output.

  (org-latex-template): Make use of new `org-latex-hyperref-template'
  when emitting \\hypersetup{...}.

This patch allows the user to emit custom options for the
\\hypersetup{...} options which are used by the \\hyperref package.

Modfied by Joe Hirn with advice from Nicholas Goaziou

TINYCHANGE
---
 ox-latex.el | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/ox-latex.el b/ox-latex.el
index 19f055e..f6e5a09 100644
--- a/ox-latex.el
+++ b/ox-latex.el
@@ -103,7 +103,7 @@
    (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
    (:latex-header "LATEX_HEADER" nil nil newline)
    (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
-   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
+   (:latex-hyperref nil nil org-latex-hyperref-template t)
    ;; Redefine regular options.
    (:date "DATE" nil "\\today" t)))

@@ -341,10 +341,18 @@ the toc:nil option, not to those generated with #+TOC
keyword."
   :group 'org-export-latex
   :type 'string)

-(defcustom org-latex-with-hyperref t
-  "Toggle insertion of \\hypersetup{...} in the preamble."
+(defcustom org-latex-hyperref-template "\\hypersetup{\n
pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
+  "Template for hyperref package options.
+
+Value is a format string, which can contain the following placeholders:
+
+  %k for KEYWORDS line
+  %d for DESCRIPTION line
+  %c for CREATOR line
+
+An empty string disables the setup."
   :group 'org-export-latex
-  :type 'boolean)
+  :type 'string)

 ;;;; Headline

@@ -1118,12 +1126,13 @@ holding export options."
      ;; Title
      (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"
-       (or (plist-get info :keywords) "")
-       (or (plist-get info :description) "")
-       (if (not (plist-get info :with-creator)) ""
- (plist-get info :creator))))
+     (format-spec (plist-get info :latex-hyperref)
+                  (format-spec-make
+                   ?k (or (plist-get info :keywords) "")
+                   ?d (or (plist-get info :description)"")
+                   ?c (if (plist-get info :with-creator)
+                          (plist-get info :creator)
+                        "")))
      ;; Document start.
      "\\begin{document}\n\n"
      ;; Title command.
-- 
1.8.5.4



On Fri, Feb 21, 2014 at 11:28 AM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > With recommended changes.
>
> Thank you. It looks good.
>
> Could you add a commit message (see "Commit messages and ChangeLog
> entries" section in http://orgmode.org/worg/org-contribute.html) and
> send it again, using "git format-patch"?
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 5967 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-21 18:35                           ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-22  9:39                             ` Nicolas Goaziou
  2014-02-22 16:42                               ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-02-22  9:39 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode@gnu.org

Hello,

Joe Hirn <joseph.hirn@gmail.com> writes:

> Here you go.

Thank you for the patch.

Unfortunately, I cannot apply it on master branch. Would you mind
updating your repository and generate the patch again?


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-02-22  9:39                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-02-22 16:42                               ` Joe Hirn
  2014-02-22 17:02                                 ` org-export-latex-hyperref-options-format Bastien
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-22 16:42 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

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

Where can I clone the master branch from? I requested access to clone it
from the contribution page but was told that's reserved for frequent
committers. I generated this patch against the most recent version pulled
down from package.el (version 20140210).


On Sat, Feb 22, 2014 at 3:39 AM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> Hello,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > Here you go.
>
> Thank you for the patch.
>
> Unfortunately, I cannot apply it on master branch. Would you mind
> updating your repository and generate the patch again?
>
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 1272 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-22 16:42                               ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-02-22 17:02                                 ` Bastien
  2014-02-24 21:51                                   ` org-export-latex-hyperref-options-format Joe Hirn
  0 siblings, 1 reply; 34+ messages in thread
From: Bastien @ 2014-02-22 17:02 UTC (permalink / raw)
  To: Joe Hirn; +Cc: emacs-orgmode@gnu.org, Nicolas Goaziou

Hi Joe,

Joe Hirn <joseph.hirn@gmail.com> writes:

> Where can I clone the master branch from?

This should do the trick:

~$ git clone git://orgmode.org/org-mode.git

Best,

-- 
 Bastien

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

* Re: org-export-latex-hyperref-options-format
  2014-02-22 17:02                                 ` org-export-latex-hyperref-options-format Bastien
@ 2014-02-24 21:51                                   ` Joe Hirn
  2014-03-21  8:00                                     ` org-export-latex-hyperref-options-format Bastien
  0 siblings, 1 reply; 34+ messages in thread
From: Joe Hirn @ 2014-02-24 21:51 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode@gnu.org, Nicolas Goaziou

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

Against the latest master:

**************BEGIN PATCH*************
From 996e75b3538e60049645a5025a390be603425b8b Mon Sep 17 00:00:00 2001
From: Joe Hirn <joseph.hirn@gmail.com>
Date: Mon, 24 Feb 2014 15:23:09 -0600
Subject: [PATCH] Allow customization of hyperrefsetup via
 `org-latex-hyperref-template'

* ox-latex.el (org-latex-hyperref-template): Add custom var
`org-latex-hyperref-template' to enable
  customization of the \\hypersetup{...}. The value is a format-spec
  with placeholders for KEYWORDS, DESCRIPTION and CREATOR.

  (org-latex-with-hyperref): Remove custom var
  `org-latex-with-hyperref'. Set `org-latex-hyperref-template' to
  an empty string to disable the \\hypersetup{...} output.

  (org-latex-template): Make use of new `org-latex-hyperref-template'
  when emitting \\hypersetup{...}.

This patch allows the user to emit custom options for the
\\hypersetup{...} options which are used by the \\hyperref package.

Modfied by Joe Hirn with advice from Nicholas Goaziou

TINYCHANGE
---
 lisp/ox-latex.el | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 50a08f6..8f9dcdd 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -106,7 +106,7 @@
    (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
    (:latex-header "LATEX_HEADER" nil nil newline)
    (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
-   (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
+   (:latex-hyperref nil nil org-latex-hyperref-template t)
    (:latex-custom-id-labels nil nil org-latex-custom-id-as-label))
   :filters-alist '((:filter-options . org-latex-math-block-options-filter)
    (:filter-parse-tree . org-latex-math-block-tree-filter)))
@@ -348,11 +348,19 @@ the toc:nil option, not to those generated with #+TOC
keyword."
   :group 'org-export-latex
   :type 'string)

-(defcustom org-latex-with-hyperref t
-  "Toggle insertion of \\hypersetup{...} in the preamble."
+
+(defcustom org-latex-hyperref-template "\\hypersetup{\n
pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
+  "Template for hyperref package options.
+
+Value is a format string, which can contain the following placeholders:
+
+  %k for KEYWORDS line
+  %d for DESCRIPTION line
+  %c for CREATOR line
+
+An empty string disables the setup."
   :group 'org-export-latex
-  :type 'boolean
-  :safe #'booleanp)
+  :type 'string)

 ;;;; Headline

@@ -1188,12 +1196,13 @@ holding export options."
      ;; Title
      (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"
-       (or (plist-get info :keywords) "")
-       (or (plist-get info :description) "")
-       (if (not (plist-get info :with-creator)) ""
- (plist-get info :creator))))
+     (format-spec (plist-get info :latex-hyperref)
+  (format-spec-make
+   ?k (or (plist-get info :keywords) "")
+   ?d (or (plist-get info :description)"")
+   ?c (if (plist-get info :with-creator)
+  (plist-get info :creator)
+ "")))
      ;; Document start.
      "\\begin{document}\n\n"
      ;; Title command.
--
1.8.5.4
******************* END PATCH *********************************


On Sat, Feb 22, 2014 at 11:02 AM, Bastien <bzg@gnu.org> wrote:

> Hi Joe,
>
> Joe Hirn <joseph.hirn@gmail.com> writes:
>
> > Where can I clone the master branch from?
>
> This should do the trick:
>
> ~$ git clone git://orgmode.org/org-mode.git
>
> Best,
>
> --
>  Bastien
>

[-- Attachment #2: Type: text/html, Size: 7027 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-02-24 21:51                                   ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-03-21  8:00                                     ` Bastien
  2014-03-21 13:03                                       ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 1 reply; 34+ messages in thread
From: Bastien @ 2014-03-21  8:00 UTC (permalink / raw)
  To: Joe Hirn; +Cc: Nicolas Goaziou, emacs-orgmode@gnu.org

Hi Joe,

Joe Hirn <joseph.hirn@gmail.com> writes:

> Against the latest master:

can you repost the patch by creating another thread with [PATCH]
in the subject line, and using plain text instead of HTML format?

If you don't use plain text email, simply attach the patch instead
of including it in the body of the email.

Nicolas, I'll let you decide whether this can be applid (on top
of master).

Thanks,

-- 
 Bastien

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21  8:00                                     ` org-export-latex-hyperref-options-format Bastien
@ 2014-03-21 13:03                                       ` Nicolas Goaziou
  2014-03-21 13:06                                         ` org-export-latex-hyperref-options-format Bastien
  0 siblings, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-03-21 13:03 UTC (permalink / raw)
  To: Bastien; +Cc: Joe Hirn, emacs-orgmode@gnu.org

Hello,

Bastien <bzg@gnu.org> writes:

> can you repost the patch by creating another thread with [PATCH]
> in the subject line, and using plain text instead of HTML format?
>
> If you don't use plain text email, simply attach the patch instead
> of including it in the body of the email.
>
> Nicolas, I'll let you decide whether this can be applid (on top
> of master).

I think this patch is already in master.


Regards

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 13:03                                       ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-03-21 13:06                                         ` Bastien
  2014-03-21 16:51                                           ` org-export-latex-hyperref-options-format Thomas S. Dye
  0 siblings, 1 reply; 34+ messages in thread
From: Bastien @ 2014-03-21 13:06 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Joe Hirn, emacs-orgmode@gnu.org

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> I think this patch is already in master.

Indeed, sorry for the noise,

PS: let's confirm on the list when a patch gets applied, that
helps archiving threads faster.

-- 
 Bastien

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 13:06                                         ` org-export-latex-hyperref-options-format Bastien
@ 2014-03-21 16:51                                           ` Thomas S. Dye
  2014-03-21 17:11                                             ` org-export-latex-hyperref-options-format Joe Hirn
  2014-03-21 17:23                                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
  0 siblings, 2 replies; 34+ messages in thread
From: Thomas S. Dye @ 2014-03-21 16:51 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode@gnu.org, Joe Hirn, Nicolas Goaziou

Aloha all,

I noticed yesterday that a legacy document with this option:

#+OPTIONS: texht:nil

is now broken in a recent Org mode from master.

The following lines now appear in the LaTeX export, when they didn't before:

\hypersetup{
 pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 24.3.1 (Org mode 8.2.5h)}}

I haven't looked at this patch, but I'm guessing that it is responsible.

It would be great if the texht option could still be supported.  If not,
can someone offer advice on the best way to set
org-latex-hyperref-template to achieve the same file-local effect?

All the best,
Tom


Bastien <bzg@gnu.org> writes:

> Hi Nicolas,
>
> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> I think this patch is already in master.
>
> Indeed, sorry for the noise,
>
> PS: let's confirm on the list when a patch gets applied, that
> helps archiving threads faster.

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 16:51                                           ` org-export-latex-hyperref-options-format Thomas S. Dye
@ 2014-03-21 17:11                                             ` Joe Hirn
  2014-03-21 17:23                                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
  1 sibling, 0 replies; 34+ messages in thread
From: Joe Hirn @ 2014-03-21 17:11 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Bastien, emacs-orgmode@gnu.org, Nicolas Goaziou

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

Thanks for the report. I'm not super familiar with how the texht option
works. I did made the following change base on recommendation from Nicolas
in the :options-alist.

(:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
to
(:latex-hyperref nil nil org-latex-hyperref-template t)

From Nicolas: "... we can replace "texht" with nil since it doesn't make
much sense to specify a full template from the OPTIONS line."

I believe the patch worked without substituting "texht" with nil in this
line.

I'm not sure if this is a regression or if your document requires updating.
That's not my call. Just chiming in with what's relevant to this side
effect you're experiencing.


On Fri, Mar 21, 2014 at 11:51 AM, Thomas S. Dye <tsd@tsdye.com> wrote:

> Aloha all,
>
> I noticed yesterday that a legacy document with this option:
>
> #+OPTIONS: texht:nil
>
> is now broken in a recent Org mode from master.
>
> The following lines now appear in the LaTeX export, when they didn't
> before:
>
> \hypersetup{
>  pdfkeywords={},
>   pdfsubject={},
>   pdfcreator={Emacs 24.3.1 (Org mode 8.2.5h)}}
>
> I haven't looked at this patch, but I'm guessing that it is responsible.
>
> It would be great if the texht option could still be supported.  If not,
> can someone offer advice on the best way to set
> org-latex-hyperref-template to achieve the same file-local effect?
>
> All the best,
> Tom
>
>
> Bastien <bzg@gnu.org> writes:
>
> > Hi Nicolas,
> >
> > Nicolas Goaziou <n.goaziou@gmail.com> writes:
> >
> >> I think this patch is already in master.
> >
> > Indeed, sorry for the noise,
> >
> > PS: let's confirm on the list when a patch gets applied, that
> > helps archiving threads faster.
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>

[-- Attachment #2: Type: text/html, Size: 2849 bytes --]

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 16:51                                           ` org-export-latex-hyperref-options-format Thomas S. Dye
  2014-03-21 17:11                                             ` org-export-latex-hyperref-options-format Joe Hirn
@ 2014-03-21 17:23                                             ` Nicolas Goaziou
  2014-03-21 18:38                                               ` org-export-latex-hyperref-options-format Thomas S. Dye
  1 sibling, 1 reply; 34+ messages in thread
From: Nicolas Goaziou @ 2014-03-21 17:23 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: Bastien, Joe Hirn, emacs-orgmode@gnu.org

Hello,

tsd@tsdye.com (Thomas S. Dye) writes:

> It would be great if the texht option could still be supported.

The equivalent property is no longer a boolean. It can have complex
values, which cannot be set on the OPTIONS line. 

> If not, can someone offer advice on the best way to set
> org-latex-hyperref-template to achieve the same file-local effect?

Assuming `org-export-allow-bind-keywords' is non-nil, does

  #+BIND: org-latex-hyperref-template ""

work?


Regards,

-- 
Nicolas Goaziou

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 17:23                                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
@ 2014-03-21 18:38                                               ` Thomas S. Dye
  2014-03-21 21:19                                                 ` org-export-latex-hyperref-options-format Nick Dokos
  0 siblings, 1 reply; 34+ messages in thread
From: Thomas S. Dye @ 2014-03-21 18:38 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Bastien, Joe Hirn, emacs-orgmode@gnu.org

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> If not, can someone offer advice on the best way to set
>> org-latex-hyperref-template to achieve the same file-local effect?
>
> Assuming `org-export-allow-bind-keywords' is non-nil, does
>
>   #+BIND: org-latex-hyperref-template ""
>
> work?

I can't get this to work.

Here is the top of my Org mode file:

  #+TITLE: Structure and Growth of the Leeward Kohala Field System: An Analysis with Directed Graphs
  #+DATE:
  #+LANGUAGE:  en
  #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t ':t ^:{}
  #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:nil pri:nil tags:not-in-toc
  #+BIND: org-latex-hyperref-template ""
  #+LATEX_CLASS: plos-devel
  #+STARTUP: entitiespretty
  #+PROPERTY: header-args:sh :eval no-export

The variable org-export-allow-bind-keywords is t.

When I open this file and ask for information about
org-latex-hyperref-template, I get this:

  org-latex-hyperref-template is a variable defined in `ox-latex.el'.
  Its value is
  "\\hypersetup{\n pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"

Org-mode version 8.2.5h (release_8.2.5h-757-gc444e4 @
/Users/dk/.emacs.d/src/org-mode/lisp/)

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 18:38                                               ` org-export-latex-hyperref-options-format Thomas S. Dye
@ 2014-03-21 21:19                                                 ` Nick Dokos
  2014-03-21 21:47                                                   ` org-export-latex-hyperref-options-format Thomas S. Dye
  0 siblings, 1 reply; 34+ messages in thread
From: Nick Dokos @ 2014-03-21 21:19 UTC (permalink / raw)
  To: emacs-orgmode

tsd@tsdye.com (Thomas S. Dye) writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>>> If not, can someone offer advice on the best way to set
>>> org-latex-hyperref-template to achieve the same file-local effect?
>>
>> Assuming `org-export-allow-bind-keywords' is non-nil, does
>>
>>   #+BIND: org-latex-hyperref-template ""
>>
>> work?
>
> I can't get this to work.
>
> Here is the top of my Org mode file:
>
>   #+TITLE: Structure and Growth of the Leeward Kohala Field System: An Analysis with Directed Graphs
>   #+DATE:
>   #+LANGUAGE:  en
>   #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t ':t ^:{}
>   #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:nil pri:nil tags:not-in-toc
>   #+BIND: org-latex-hyperref-template ""
>   #+LATEX_CLASS: plos-devel
>   #+STARTUP: entitiespretty
>   #+PROPERTY: header-args:sh :eval no-export
>
> The variable org-export-allow-bind-keywords is t.
>
> When I open this file and ask for information about
> org-latex-hyperref-template, I get this:
>
>   org-latex-hyperref-template is a variable defined in `ox-latex.el'.
>   Its value is
>   "\\hypersetup{\n pdfkeywords={%k},\n  pdfsubject={%d},\n  pdfcreator={%c}}\n"
>
> Org-mode version 8.2.5h (release_8.2.5h-757-gc444e4 @
> /Users/dk/.emacs.d/src/org-mode/lisp/)
>

#+BIND is supposed to bind the variable *during export*. The test is to
run the export and see if the hyperref stuff is gone from the tex file.

Nick

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 21:19                                                 ` org-export-latex-hyperref-options-format Nick Dokos
@ 2014-03-21 21:47                                                   ` Thomas S. Dye
  2014-03-21 22:19                                                     ` org-export-latex-hyperref-options-format Charles Millar
  2014-03-21 22:39                                                     ` org-export-latex-hyperref-options-format Nick Dokos
  0 siblings, 2 replies; 34+ messages in thread
From: Thomas S. Dye @ 2014-03-21 21:47 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Aloha Nick,

Nick Dokos <ndokos@gmail.com> writes:

> #+BIND is supposed to bind the variable *during export*. The test is to
> run the export and see if the hyperref stuff is gone from the tex file.
>
> Nick

I did run the export and the hyperref stuff was still in the tex file.

I'm exporting asynchronously--perhaps that's the problem?  The old
#+OPTIONS: texht:nil worked for asynchronous export, though, so I was
expecting that BIND would do the same.

I guess I could set org-export-hyperref-template to "" in the
asynchronous export initialization file ...

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 21:47                                                   ` org-export-latex-hyperref-options-format Thomas S. Dye
@ 2014-03-21 22:19                                                     ` Charles Millar
  2014-03-21 22:39                                                     ` org-export-latex-hyperref-options-format Nick Dokos
  1 sibling, 0 replies; 34+ messages in thread
From: Charles Millar @ 2014-03-21 22:19 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

Thomas,

Thomas S. Dye wrote:
> Aloha Nick,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> #+BIND is supposed to bind the variable *during export*. The test is to
>> run the export and see if the hyperref stuff is gone from the tex file.
>>
>> Nick
>
> I did run the export and the hyperref stuff was still in the tex file.
>
> I'm exporting asynchronously--perhaps that's the problem?  The old
> #+OPTIONS: texht:nil worked for asynchronous export, though, so I was
> expecting that BIND would do the same.
>
> I guess I could set org-export-hyperref-template to "" in the
> asynchronous export initialization file ...
>
> All the best,
> Tom
>

Nick pointed out this thread to me when I had a similar (or the same) 
problem. I changed the hyperref template to the empty string.

   http://thread.gmane.org/gmane.emacs.orgmode/82430

Charlie Millar

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 21:47                                                   ` org-export-latex-hyperref-options-format Thomas S. Dye
  2014-03-21 22:19                                                     ` org-export-latex-hyperref-options-format Charles Millar
@ 2014-03-21 22:39                                                     ` Nick Dokos
  2014-03-22 18:26                                                       ` org-export-latex-hyperref-options-format Thomas S. Dye
  1 sibling, 1 reply; 34+ messages in thread
From: Nick Dokos @ 2014-03-21 22:39 UTC (permalink / raw)
  To: emacs-orgmode

tsd@tsdye.com (Thomas S. Dye) writes:

> Aloha Nick,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> #+BIND is supposed to bind the variable *during export*. The test is to
>> run the export and see if the hyperref stuff is gone from the tex file.
>>
>> Nick
>
> I did run the export and the hyperref stuff was still in the tex file.
>
> I'm exporting asynchronously--perhaps that's the problem?  The old
> #+OPTIONS: texht:nil worked for asynchronous export, though, so I was
> expecting that BIND would do the same.
>

I tried both with and without async (deleting the tex file before
starting each time - I also used the default latex class, since I don't
have plos-devel): either way the hyperref stuff was gone.

Here's the org file:

--8<---------------cut here---------------start------------->8---
#+TITLE: Structure and Growth of the Leeward Kohala Field System: An Analysis with Directed Graphs
#+DATE:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t ':t ^:{}
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:nil pri:nil tags:not-in-toc
#+BIND: org-latex-hyperref-template ""
#+STARTUP: entitiespretty
#+PROPERTY: header-args:sh :eval no-export

* foo

bar
--8<---------------cut here---------------end--------------->8---


Org-mode version 8.2.5h (release_8.2.5h-782-g040ec4 @
/home/nick/elisp/org-mode/lisp/)

Nick

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

* Re: org-export-latex-hyperref-options-format
  2014-03-21 22:39                                                     ` org-export-latex-hyperref-options-format Nick Dokos
@ 2014-03-22 18:26                                                       ` Thomas S. Dye
  2014-03-23 21:39                                                         ` org-export-latex-hyperref-options-format Thomas S. Dye
  0 siblings, 1 reply; 34+ messages in thread
From: Thomas S. Dye @ 2014-03-22 18:26 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Aloha Nick,

Nick Dokos <ndokos@gmail.com> writes:

> tsd@tsdye.com (Thomas S. Dye) writes:
>
>> Aloha Nick,
>>
>> Nick Dokos <ndokos@gmail.com> writes:
>>
>>> #+BIND is supposed to bind the variable *during export*. The test is to
>>> run the export and see if the hyperref stuff is gone from the tex file.
>>>
>>> Nick
>>
>> I did run the export and the hyperref stuff was still in the tex file.
>>
>> I'm exporting asynchronously--perhaps that's the problem?  The old
>> #+OPTIONS: texht:nil worked for asynchronous export, though, so I was
>> expecting that BIND would do the same.
>>
>
> I tried both with and without async (deleting the tex file before
> starting each time - I also used the default latex class, since I don't
> have plos-devel): either way the hyperref stuff was gone.

It is part of an Org mode template for the open access journal PLOS
One.  You can find it here, if need be:
http://orgmode.org/worg/exporters/plos-one-template-worg.html

The template is set up to produce two pdf files, one with hyperref and
the other without.  I suspect this is the root of the problem I'm
having.  The old option used to suppress the hyperref stuff in one of
the tex files, but kept it available for the other tex file.

Somehow, the logic of that has changed and I suspect I'm going to have
to find a way to set up hyperref for the document that needs it, rather
than shutting it off for the document that doesn't need it.

I had a look at ox-latex and the PLOS One template this morning over
coffee, but wasn't able to find a smoking gun.

Your simple test case works as expected here.

All the best,
Tom

>
> Here's the org file:
>
> #+TITLE: Structure and Growth of the Leeward Kohala Field System: An Analysis with Directed Graphs
> #+DATE:
> #+LANGUAGE:  en
> #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t ':t ^:{}
> #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:nil pri:nil tags:not-in-toc
> #+BIND: org-latex-hyperref-template ""
> #+STARTUP: entitiespretty
> #+PROPERTY: header-args:sh :eval no-export
>
> * foo
>
> bar
>
>
> Org-mode version 8.2.5h (release_8.2.5h-782-g040ec4 @
> /home/nick/elisp/org-mode/lisp/)
>
> Nick
>
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

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

* Re: org-export-latex-hyperref-options-format
  2014-03-22 18:26                                                       ` org-export-latex-hyperref-options-format Thomas S. Dye
@ 2014-03-23 21:39                                                         ` Thomas S. Dye
  0 siblings, 0 replies; 34+ messages in thread
From: Thomas S. Dye @ 2014-03-23 21:39 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

tsd@tsdye.com (Thomas S. Dye) writes:

> The template is set up to produce two pdf files, one with hyperref and
> the other without.  I suspect this is the root of the problem I'm
> having.

Nope. The asynchronous process had to allow bind keywords.

All is well.

Tom

-- 
Thomas S. Dye
http://www.tsdye.com

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

end of thread, other threads:[~2014-03-23 21:40 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 20:41 org-export-latex-hyperref-options-format Joe Hirn
2014-02-17 22:13 ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-17 22:59   ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-17 23:23     ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-17 23:42       ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-19 13:05         ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-19 16:21           ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-19 22:43           ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-20 10:22             ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-20 12:34               ` org-export-latex-hyperref-options-format Joseph Hirn
2014-02-20 17:58                 ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-20 20:51                   ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-20 21:52                     ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-20 22:53                       ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-21 17:28                         ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-21 18:35                           ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-22  9:39                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-02-22 16:42                               ` org-export-latex-hyperref-options-format Joe Hirn
2014-02-22 17:02                                 ` org-export-latex-hyperref-options-format Bastien
2014-02-24 21:51                                   ` org-export-latex-hyperref-options-format Joe Hirn
2014-03-21  8:00                                     ` org-export-latex-hyperref-options-format Bastien
2014-03-21 13:03                                       ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-03-21 13:06                                         ` org-export-latex-hyperref-options-format Bastien
2014-03-21 16:51                                           ` org-export-latex-hyperref-options-format Thomas S. Dye
2014-03-21 17:11                                             ` org-export-latex-hyperref-options-format Joe Hirn
2014-03-21 17:23                                             ` org-export-latex-hyperref-options-format Nicolas Goaziou
2014-03-21 18:38                                               ` org-export-latex-hyperref-options-format Thomas S. Dye
2014-03-21 21:19                                                 ` org-export-latex-hyperref-options-format Nick Dokos
2014-03-21 21:47                                                   ` org-export-latex-hyperref-options-format Thomas S. Dye
2014-03-21 22:19                                                     ` org-export-latex-hyperref-options-format Charles Millar
2014-03-21 22:39                                                     ` org-export-latex-hyperref-options-format Nick Dokos
2014-03-22 18:26                                                       ` org-export-latex-hyperref-options-format Thomas S. Dye
2014-03-23 21:39                                                         ` org-export-latex-hyperref-options-format Thomas S. Dye
2014-02-17 23:25     ` org-export-latex-hyperref-options-format Rasmus

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.