emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ox-beamer and CUSTOM_ID
@ 2015-10-13 11:24 Fabrice Popineau
  2015-10-13 19:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-13 11:24 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

Hi,

Something I don't understand in ox-beamer.
I wanted to use the againframe feature.

I setup a CUSTOM_ID to foo on the first frame.

I use #foo as a BEAMER_REF in the againframe.

But ox-beamer insists in using its own generated label to refer to the
frame.
I trace it to org-beamer--get-label which looks only for label=%s in the
BEAMER_OPT property of the initial frame.
IMHO, it should look for a CUSTOM_ID too.
That would make it more consistent.

Am I missing something ?

Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 11:24 ox-beamer and CUSTOM_ID Fabrice Popineau
@ 2015-10-13 19:26 ` Nicolas Goaziou
  2015-10-13 19:38   ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-13 19:26 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Hello,

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> Something I don't understand in ox-beamer.
> I wanted to use the againframe feature.
>
> I setup a CUSTOM_ID to foo on the first frame.
>
> I use #foo as a BEAMER_REF in the againframe.
>
> But ox-beamer insists in using its own generated label to refer to the
> frame.
> I trace it to org-beamer--get-label which looks only for label=%s in the
> BEAMER_OPT property of the initial frame.
> IMHO, it should look for a CUSTOM_ID too.
> That would make it more consistent.
>
> Am I missing something ?

I don't understand the issue. BEAMER_REF: #foo generates the same
internal reference as :CUSTOM_ID: foo, doesn't it?


Regards,

-- 
Nicolas Goaziou

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 19:26 ` Nicolas Goaziou
@ 2015-10-13 19:38   ` Fabrice Popineau
  2015-10-13 19:50     ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-13 19:38 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-13 21:26 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Hello,
>
> I don't understand the issue. BEAMER_REF: #foo generates the same
> internal reference as :CUSTOM_ID: foo, doesn't it?
>
>
My point is that you need to set :

* Frame 1
:PROPERTIES:
:BEAMER_OPT: label=foo
:END:

* Frame 2
:PROPERTIES:
:BEAMER_env: againframe
:BEAMER_ref: #foo
:END:

because if you use CUSTOM_ID in the first frame, the link is not resolved.
The code at stake is :
ox-beamer:org-beamer-headline which calls ox-beamer:org-beamer--get-label
at line 624

Clearly, org-beamer--get-label doesn't make use of CUSTOM_ID.

It is a bit strange to have to use another way to set custom labels than a
CUSTOM_ID property.

Regards,

Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 19:38   ` Fabrice Popineau
@ 2015-10-13 19:50     ` Nicolas Goaziou
  2015-10-13 19:58       ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-13 19:50 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> 2015-10-13 21:26 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
>
>> Hello,
>>
>> I don't understand the issue. BEAMER_REF: #foo generates the same
>> internal reference as :CUSTOM_ID: foo, doesn't it?
>>
>>
> My point is that you need to set :
>
> * Frame 1
> :PROPERTIES:
> :BEAMER_OPT: label=foo
> :END:
>
> * Frame 2
> :PROPERTIES:
> :BEAMER_env: againframe
> :BEAMER_ref: #foo
> :END:

If I try to export this file, I get an error:

  user-error: Unable to resolve link: "foo"

which is to be expected since :CUSTOM_ID: foo doesn't exist.

> because if you use CUSTOM_ID in the first frame, the link is not
> resolved.

It should be. With the following document

  * Frame 1
  :PROPERTIES:
  :CUSTOM_ID: foo
  :END:

  * Frame 2
  :PROPERTIES:
  :BEAMER_env: againframe
  :BEAMER_ref: #foo
  :END:

I get

  \begin{document}

  \begin{frame}[label={sec:orgheadline1}]{Frame 1}
  \end{frame}

  \againframe{{sec:orgheadline1}}
  \end{document}

So, I'm still puzzled.

> The code at stake is :
> ox-beamer:org-beamer-headline which calls ox-beamer:org-beamer--get-label
> at line 624
>
> Clearly, org-beamer--get-label doesn't make use of CUSTOM_ID.

It doesn't need to, since CUSTOM_ID will not be used anyway in the final
output.

Regards,

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 19:50     ` Nicolas Goaziou
@ 2015-10-13 19:58       ` Fabrice Popineau
  2015-10-13 20:52         ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-13 19:58 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-13 21:50 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > 2015-10-13 21:26 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
> >
> >> Hello,
> >>
> >> I don't understand the issue. BEAMER_REF: #foo generates the same
> >> internal reference as :CUSTOM_ID: foo, doesn't it?
> >>
> >>
> > My point is that you need to set :
> >
> > * Frame 1
> > :PROPERTIES:
> > :BEAMER_OPT: label=foo
> > :END:
> >
> > * Frame 2
> > :PROPERTIES:
> > :BEAMER_env: againframe
> > :BEAMER_ref: #foo
> > :END:
>
> If I try to export this file, I get an error:
>
>   user-error: Unable to resolve link: "foo"
>
> which is to be expected since :CUSTOM_ID: foo doesn't exist.
>
> > because if you use CUSTOM_ID in the first frame, the link is not
> > resolved.
>
> It should be. With the following document
>
>   * Frame 1
>   :PROPERTIES:
>   :CUSTOM_ID: foo
>   :END:
>
>   * Frame 2
>   :PROPERTIES:
>   :BEAMER_env: againframe
>   :BEAMER_ref: #foo
>   :END:
>
> I get
>
>   \begin{document}
>
>   \begin{frame}[label={sec:orgheadline1}]{Frame 1}
>   \end{frame}
>
>   \againframe{{sec:orgheadline1}}
>   \end{document}
>
> So, I'm still puzzled.


This time , I'm the one who is puzzled:
what is the point in naming the link "foo" and getting sec:orgheadline1
instead? :-)

If you add :BEAMER_OPT: label=foo
to the properties of the first frame, then you get the foo label.
But that doesn't seem very obvious to me. Why not taking directly the
CUSTOM_ID label ?

Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 19:58       ` Fabrice Popineau
@ 2015-10-13 20:52         ` Nicolas Goaziou
  2015-10-13 21:12           ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-13 20:52 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> This time , I'm the one who is puzzled:
> what is the point in naming the link "foo" and getting sec:orgheadline1
> instead? :-)
>
> If you add :BEAMER_OPT: label=foo
> to the properties of the first frame, then you get the foo label.
> But that doesn't seem very obvious to me. Why not taking directly the
> CUSTOM_ID label ?

Because CUSTOM_ID's value may contain forbidden characters in LaTeX,
e.g., "%". See also `org-latex-prefer-user-labels', which is not
implemented in Beamer, since BEAMER_OPT can already force a value for
label.

Regards,

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 20:52         ` Nicolas Goaziou
@ 2015-10-13 21:12           ` Fabrice Popineau
  2015-10-13 22:18             ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-13 21:12 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-13 22:52 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > This time , I'm the one who is puzzled:
> > what is the point in naming the link "foo" and getting sec:orgheadline1
> > instead? :-)
> >
> > If you add :BEAMER_OPT: label=foo
> > to the properties of the first frame, then you get the foo label.
> > But that doesn't seem very obvious to me. Why not taking directly the
> > CUSTOM_ID label ?
>
> Because CUSTOM_ID's value may contain forbidden characters in LaTeX,
> e.g., "%".


Oh ... thanks for this explanation. Speaking for myself, I would have
prefered to
take the risk to use forbidden characters in CUSTOM_ID.


> See also `org-latex-prefer-user-labels', which is not
> implemented in Beamer, since BEAMER_OPT can already force a value for
> label.
>

This is a pity. Things would be more straightforward.

Regards,

Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 21:12           ` Fabrice Popineau
@ 2015-10-13 22:18             ` Nicolas Goaziou
  2015-10-14  9:47               ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-13 22:18 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> This is a pity. Things would be more straightforward.

Straightforward for what? Use againframes? Or force label?

Regards,

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-13 22:18             ` Nicolas Goaziou
@ 2015-10-14  9:47               ` Fabrice Popineau
  2015-10-14 11:57                 ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-14  9:47 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-14 0:18 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > This is a pity. Things would be more straightforward.
>
> Straightforward for what? Use againframes? Or force label?
>
>
Force label. Having to explicitly state it twice :

  * Frame 1
  :PROPERTIES:
  :CUSTOM_ID: foo
  :BEAMER_opt: label=foo
  :END:

is not exactly straightforward. The following (crude) patch would avoid it.

Anyway, the BEAMER_opt label= way of setting the label is not Org-y.

Regards,

Fabrice

diff --git a/vendor/org-mode/lisp/ox-beamer.el
b/vendor/org-mode/lisp/ox-beamer.el
index 24dcf19..cc8d241 100644
--- a/vendor/org-mode/lisp/ox-beamer.el
+++ b/vendor/org-mode/lisp/ox-beamer.el
@@ -333,11 +333,13 @@ INFO is a plist used as a communication channel.
 The value is either the label specified in \"BEAMER_opt\"
 property, or a fallback value built from headline's number.  This
 function assumes HEADLINE will be treated as a frame."
+  (if org-latex-prefer-user-labels
+      (org-element-property :CUSTOM_ID headline)
       (let ((opt (org-element-property :BEAMER_OPT headline)))
        (if (and (stringp opt)
                 (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)"
opt))
            (match-string 1 opt)
-      (format "{sec:%s}" (org-export-get-reference headline info)))))
+         (format "{sec:%s}" (org-export-get-reference headline info))))))

 (defun org-beamer--frame-level (headline info)
   "Return frame level in subtree containing HEADLINE.

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-14  9:47               ` Fabrice Popineau
@ 2015-10-14 11:57                 ` Nicolas Goaziou
  2015-10-14 12:18                   ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-14 11:57 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> 2015-10-14 0:18 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
>
>> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>>
>> > This is a pity. Things would be more straightforward.
>>
>> Straightforward for what? Use againframes? Or force label?
>>
>>
> Force label. Having to explicitly state it twice :
>
>   * Frame 1
>   :PROPERTIES:
>   :CUSTOM_ID: foo
>   :BEAMER_opt: label=foo
>   :END:
>
> is not exactly straightforward. The following (crude) patch would
> avoid it.

I'm not opposed to something like it, but it is no longer related to
againframe problem, isn't it?

Out of curiosity, why do you need to force a label?

> Anyway, the BEAMER_opt label= way of setting the label is not Org-y.

It isn't, but it is possible to set labels this way nonetheless, so Org
adapts to it.


Regards,

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-14 11:57                 ` Nicolas Goaziou
@ 2015-10-14 12:18                   ` Fabrice Popineau
  2015-10-15  8:37                     ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-14 12:18 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-14 13:57 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > 2015-10-14 0:18 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
>
> I'm not opposed to something like it, but it is no longer related to
> againframe problem, isn't it?
>
>
Sure. I came to the problem because of againframe.


> Out of curiosity, why do you need to force a label?


At some point LaTeX reported an error on some frame heading.
I wrongly inferred it could be the label.
I tried to force my own one and I was surprised CUSTOM_ID was not honoured
as it is in other backends (html).

I switch between ox-beamer and ox-reveal at the moment.
Albeit beamer gives better looking result, it is too much time consuming.

Regards,

Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-14 12:18                   ` Fabrice Popineau
@ 2015-10-15  8:37                     ` Nicolas Goaziou
  2015-10-15 16:54                       ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-15  8:37 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> At some point LaTeX reported an error on some frame heading.
> I wrongly inferred it could be the label.

It would be nice to investigate about this error, it it persists.

> I tried to force my own one and I was surprised CUSTOM_ID was not honoured
> as it is in other backends (html).

HTML is the exception, not the rule. It obeys to CUSTOM_ID because those
are "public", i.e., they may appear as such in a URL. There is no such
constraint in, e.g., LaTeX.

Anyway, now "ox-beamer" should obey to `org-latex-prefer-user-labels'
for custom ID.


Regards,

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-15  8:37                     ` Nicolas Goaziou
@ 2015-10-15 16:54                       ` Fabrice Popineau
  2015-10-15 19:25                         ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-15 16:54 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-15 10:37 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > At some point LaTeX reported an error on some frame heading.
> > I wrongly inferred it could be the label.
>
> It would be nice to investigate about this error, it it persists.
>
>
Beamer is very bad at reporting errors at their true origin.

Actually, I had 2 errors.

First all my Org->TeX files use Babel, and they doesn't seem to cope well
with colons in labels.
(org-lint even reports about it)
Unfortunately, the default naming scheme for internal labels is using
colons.
Hence I wanted to use my own labels.

(Actually, I don't understand what prevents "beamer 2015/01/05 3.36" to use
colons in
labels. I thought that this problem has been solved around beamer 3.30.)

The other error was elsewhere in the slide and it is a separate issue.
Actually I had A_{}_{i+1} somewhere. Unfortunately, it is quite easy to
enter such stuff
in Org mode with the right edit sequence (I need to pick this sequence and
report about it).
When the result is displayed (well, at least in my setup), you don't see
the double
subscript any more. It is displayed the same way A_{i+1} is.
You need to erase everything and retype it. Or turn off the sub/superscript
option (?).

Anyway, now "ox-beamer" should obey to `org-latex-prefer-user-labels'
> for custom ID.
>

Thanks!

Regards,

Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-15 16:54                       ` Fabrice Popineau
@ 2015-10-15 19:25                         ` Fabrice Popineau
  2015-10-15 19:48                           ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-15 19:25 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

2015-10-15 18:54 GMT+02:00 Fabrice Popineau <fabrice.popineau@gmail.com>:

>
>
> 2015-10-15 10:37 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
>
>> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>>
>> > At some point LaTeX reported an error on some frame heading.
>> > I wrongly inferred it could be the label.
>>
>> It would be nice to investigate about this error, it it persists.
>>
>>
> Beamer is very bad at reporting errors at their true origin.
>
> Actually, I had 2 errors.
>
> First all my Org->TeX files use Babel, and they doesn't seem to cope well
> with colons in labels.
> (org-lint even reports about it)
> Unfortunately, the default naming scheme for internal labels is using
> colons.
> Hence I wanted to use my own labels.
>
> (Actually, I don't understand what prevents "beamer 2015/01/05 3.36" to
> use colons in
> labels. I thought that this problem has been solved around beamer 3.30.)
>

Oh! I got it.

The problem is that beamer expects braces around a label with colon when
you setup the label
but *not when you ref it* :

\begin{frame}[label={sec:orgheadline1}]{Frame 1}
bla bla bla bla bla bla bla bla bla bla bla bla
\end{frame}

\againframe{sec:orgheadline1}

The braces at setup are required by the keyval package which is used to
parse the options.
However, the label is called sec:orgheadline1 and not {sec:orgheadline1}.
But at the moment, ox-beamer outputs :

\againframe{{sec:orgheadline1}}

I fixed it unintentionally by using my own label without colon.

So basically you need this:

diff --git a/vendor/org-mode/lisp/ox-beamer.el
b/vendor/org-mode/lisp/ox-beamer.el
index 24dcf19..75b51df 100644
--- a/vendor/org-mode/lisp/ox-beamer.el
+++ b/vendor/org-mode/lisp/ox-beamer.el
@@ -621,7 +623,7 @@ as a communication channel."
                                     (org-export-resolve-id-link link
info))))
                      ;; Now use user-defined label provided in TARGET
                      ;; headline, or fallback to standard one.
-                     (format "{%s}" (org-beamer--get-label target
info)))))))
+                     (format "%s" (org-beamer--get-label target info)))))))
        ;; Case 2: Creation of an appendix is requested.
        ((equal environment "appendix")
        (concat "\\appendix"


Fabrice

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-15 19:25                         ` Fabrice Popineau
@ 2015-10-15 19:48                           ` Nicolas Goaziou
  2015-10-15 20:20                             ` Fabrice Popineau
  0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-15 19:48 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> Oh! I got it.
>
> The problem is that beamer expects braces around a label with colon when
> you setup the label
> but *not when you ref it* :
>
> \begin{frame}[label={sec:orgheadline1}]{Frame 1}
> bla bla bla bla bla bla bla bla bla bla bla bla
> \end{frame}
>
> \againframe{sec:orgheadline1}
>
> The braces at setup are required by the keyval package which is used to
> parse the options.
> However, the label is called sec:orgheadline1 and not {sec:orgheadline1}.
> But at the moment, ox-beamer outputs :
>
> \againframe{{sec:orgheadline1}}
>
> I fixed it unintentionally by using my own label without colon.
>
> So basically you need this:
>
> diff --git a/vendor/org-mode/lisp/ox-beamer.el
> b/vendor/org-mode/lisp/ox-beamer.el
> index 24dcf19..75b51df 100644
> --- a/vendor/org-mode/lisp/ox-beamer.el
> +++ b/vendor/org-mode/lisp/ox-beamer.el
> @@ -621,7 +623,7 @@ as a communication channel."
>                                      (org-export-resolve-id-link link
> info))))
>                       ;; Now use user-defined label provided in TARGET
>                       ;; headline, or fallback to standard one.
> -                     (format "{%s}" (org-beamer--get-label target
> info)))))))
> +                     (format "%s" (org-beamer--get-label target info)))))))
>         ;; Case 2: Creation of an appendix is requested.
>         ((equal environment "appendix")
>         (concat "\\appendix"

Thanks for the debugging. Do you want to provide a patch against maint
for this ? Note that your library needs to be updated.

Regards,

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-15 19:48                           ` Nicolas Goaziou
@ 2015-10-15 20:20                             ` Fabrice Popineau
  2015-10-16 20:59                               ` Nicolas Goaziou
  0 siblings, 1 reply; 17+ messages in thread
From: Fabrice Popineau @ 2015-10-15 20:20 UTC (permalink / raw)
  To: Fabrice Popineau, emacs-orgmode@gnu.org

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

My small patch worked only for labels with colon.
With more extensive testing, I can propose this one against maint :

diff --git a/vendor/org-mode/lisp/ox-beamer.el
b/vendor/org-mode/lisp/ox-beamer.el
index 73d8a76..ee4f0d7 100644
--- a/vendor/org-mode/lisp/ox-beamer.el
+++ b/vendor/org-mode/lisp/ox-beamer.el
@@ -335,11 +335,11 @@ property, or a fallback value built from headline's
number.  This
 function assumes HEADLINE will be treated as a frame."
   (let ((opt (org-element-property :BEAMER_OPT headline)))
     (if (and (stringp opt)
-            (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt))
+            (string-match "\\(?:^\\|,\\)label={?\\(.*?\\)}?\\(?:$\\|,\\)"
opt))
        (match-string 1 opt)
       (or (and (plist-get info :latex-prefer-user-labels)
               (org-element-property :CUSTOM_ID headline))
-         (format "{sec:%s}"
+         (format "sec:%s"
                  (org-export-get-reference headline info))))))

 (defun org-beamer--frame-level (headline info)
@@ -444,8 +444,9 @@ used as a communication channel."
                                  (or (string-match "\\(^\\|,\\)label="
beamer-opt)
                                      (string-match "allowframebreaks"
beamer-opt)))
                       (list
-                       (format "label=%s"
-                               (org-beamer--get-label headline info)))))))
+                       (let* ((label (org-beamer--get-label headline info))
+                              (fmt (if (string-match ":" label)
"label={%s}" "label=%s")))
+                         (format fmt label)))))))
              ;; Change options list into a string.
              (org-beamer--normalize-argument
               (mapconcat

This way, the org-beamer--get-label function always returns a label without
braces.
Check especially the regexp. I hope I haven't introduce bad matches.

When the frame with the label is written, braces are added if needed.

Regards,

Fabrice

2015-10-15 21:48 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > Oh! I got it.
> >
> > The problem is that beamer expects braces around a label with colon when
> > you setup the label
> > but *not when you ref it* :
> >
> > \begin{frame}[label={sec:orgheadline1}]{Frame 1}
> > bla bla bla bla bla bla bla bla bla bla bla bla
> > \end{frame}
> >
> > \againframe{sec:orgheadline1}
> >
> > The braces at setup are required by the keyval package which is used to
> > parse the options.
> > However, the label is called sec:orgheadline1 and not {sec:orgheadline1}.
> > But at the moment, ox-beamer outputs :
> >
> > \againframe{{sec:orgheadline1}}
> >
> > I fixed it unintentionally by using my own label without colon.
> >
> > So basically you need this:
> >
> > diff --git a/vendor/org-mode/lisp/ox-beamer.el
> > b/vendor/org-mode/lisp/ox-beamer.el
> > index 24dcf19..75b51df 100644
> > --- a/vendor/org-mode/lisp/ox-beamer.el
> > +++ b/vendor/org-mode/lisp/ox-beamer.el
> > @@ -621,7 +623,7 @@ as a communication channel."
> >                                      (org-export-resolve-id-link link
> > info))))
> >                       ;; Now use user-defined label provided in TARGET
> >                       ;; headline, or fallback to standard one.
> > -                     (format "{%s}" (org-beamer--get-label target
> > info)))))))
> > +                     (format "%s" (org-beamer--get-label target
> info)))))))
> >         ;; Case 2: Creation of an appendix is requested.
> >         ((equal environment "appendix")
> >         (concat "\\appendix"
>
> Thanks for the debugging. Do you want to provide a patch against maint
> for this ? Note that your library needs to be updated.
>
> Regards,
>

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

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

* Re: ox-beamer and CUSTOM_ID
  2015-10-15 20:20                             ` Fabrice Popineau
@ 2015-10-16 20:59                               ` Nicolas Goaziou
  0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Goaziou @ 2015-10-16 20:59 UTC (permalink / raw)
  To: Fabrice Popineau; +Cc: emacs-orgmode@gnu.org

Fabrice Popineau <fabrice.popineau@gmail.com> writes:

> My small patch worked only for labels with colon.
> With more extensive testing, I can propose this one against maint :

Thank you

> diff --git a/vendor/org-mode/lisp/ox-beamer.el
> b/vendor/org-mode/lisp/ox-beamer.el
> index 73d8a76..ee4f0d7 100644
> --- a/vendor/org-mode/lisp/ox-beamer.el
> +++ b/vendor/org-mode/lisp/ox-beamer.el
> @@ -335,11 +335,11 @@ property, or a fallback value built from headline's
> number.  This
>  function assumes HEADLINE will be treated as a frame."
>    (let ((opt (org-element-property :BEAMER_OPT headline)))
>      (if (and (stringp opt)
> -            (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt))
> +            (string-match "\\(?:^\\|,\\)label={?\\(.*?\\)}?\\(?:$\\|,\\)"

It would remove un-balanced curly brackets, which may or may not be
a good idea.

I took the liberty to apply a patch based off yours on maint. Hopefully,
the issue should be solved.

Regards,

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

end of thread, other threads:[~2015-10-16 20:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 11:24 ox-beamer and CUSTOM_ID Fabrice Popineau
2015-10-13 19:26 ` Nicolas Goaziou
2015-10-13 19:38   ` Fabrice Popineau
2015-10-13 19:50     ` Nicolas Goaziou
2015-10-13 19:58       ` Fabrice Popineau
2015-10-13 20:52         ` Nicolas Goaziou
2015-10-13 21:12           ` Fabrice Popineau
2015-10-13 22:18             ` Nicolas Goaziou
2015-10-14  9:47               ` Fabrice Popineau
2015-10-14 11:57                 ` Nicolas Goaziou
2015-10-14 12:18                   ` Fabrice Popineau
2015-10-15  8:37                     ` Nicolas Goaziou
2015-10-15 16:54                       ` Fabrice Popineau
2015-10-15 19:25                         ` Fabrice Popineau
2015-10-15 19:48                           ` Nicolas Goaziou
2015-10-15 20:20                             ` Fabrice Popineau
2015-10-16 20:59                               ` 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).