emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug with label names in beamer export
@ 2015-06-16 19:11 Suvayu Ali
  2015-06-16 19:36 ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Suvayu Ali @ 2015-06-16 19:11 UTC (permalink / raw)
  To: Emacs Org mode

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

Hi,

I encountered a strange problem today, exporting to beamer didn't
produce any pages eventhough it compiled just fine!  It turns out it's
how Org exported the labels.  They should be wrapped in {..}.  See this
TeX.SX question for more: http://tex.stackexchange.com/q/250640/4416

The attached patch should fix the issue.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: 0001-ox-beamer-Wrap-labels-in-braces-in-beamer-export.patch --]
[-- Type: text/plain, Size: 1069 bytes --]

From e82cd7bf86dc01d1038a442fd66ba8b97ec7a23e Mon Sep 17 00:00:00 2001
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Date: Tue, 16 Jun 2015 21:04:21 +0200
Subject: [PATCH] ox-beamer: Wrap labels in braces in beamer export

* lisp/ox-beamer.el (org-beamer--get-label): wrap labels in {..}

The `:' in the label name causes an argument parsing problem, for more
see <http://tex.stackexchange.com/q/250640/4416>.
---
 lisp/ox-beamer.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index dafadb3..3119bd4 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -337,7 +337,7 @@ function assumes HEADLINE will be treated as a frame."
     (if (and (stringp opt)
 	     (string-match "\\(?:^\\|,\\)label=\\(.*?\\)\\(?:$\\|,\\)" opt))
 	(match-string 1 opt)
-      (concat "sec:" (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.
-- 
2.4.3


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

* Re: Bug with label names in beamer export
  2015-06-16 19:11 Bug with label names in beamer export Suvayu Ali
@ 2015-06-16 19:36 ` Rasmus
  2015-06-16 20:18   ` Nicolas Goaziou
  2015-06-17  6:35   ` Suvayu Ali
  0 siblings, 2 replies; 6+ messages in thread
From: Rasmus @ 2015-06-16 19:36 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> The attached patch should fix the issue.

Pushed, thanks.  I changed the commit message slightly.

> * lisp/ox-beamer.el (org-beamer--get-label): wrap labels in {..}

You don't need the "lisp/" prefix.  Capitalize after the colon.  Should
end with period.

Rasmus

-- 
Slowly unravels in a ball of yarn and the devil collects it

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

* Re: Bug with label names in beamer export
  2015-06-16 19:36 ` Rasmus
@ 2015-06-16 20:18   ` Nicolas Goaziou
  2015-06-16 20:25     ` Rasmus
  2015-06-17  6:35   ` Suvayu Ali
  1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-06-16 20:18 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>
>> The attached patch should fix the issue.
>
> Pushed, thanks.  I changed the commit message slightly.
>
>> * lisp/ox-beamer.el (org-beamer--get-label): wrap labels in {..}
>
> You don't need the "lisp/" prefix.  Capitalize after the colon.  Should
> end with period.

Thanks. Nitpick however: wouldn't it be more readable to use "sec-" as
a prefix instead of "sec:" in order to solve the issue?


Regards,

-- 
Nicolas Goaziou

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

* Re: Bug with label names in beamer export
  2015-06-16 20:18   ` Nicolas Goaziou
@ 2015-06-16 20:25     ` Rasmus
  2015-06-16 20:41       ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-06-16 20:25 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Thanks. Nitpick however: wouldn't it be more readable to use "sec-" as
> a prefix instead of "sec:" in order to solve the issue?

I like "sec:", but the only package that actually relies on this, on the
top of my head, is autoref.  I prefer {sec:whatever} over sec-whatever.

Rasmus

-- 
Dobbelt-A

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

* Re: Bug with label names in beamer export
  2015-06-16 20:25     ` Rasmus
@ 2015-06-16 20:41       ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2015-06-16 20:41 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> I like "sec:", but the only package that actually relies on this, on the
> top of my head, is autoref.  I prefer {sec:whatever} over
> sec-whatever.

OK. Let's keep it this way then. Thanks.

Regards,

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

* Re: Bug with label names in beamer export
  2015-06-16 19:36 ` Rasmus
  2015-06-16 20:18   ` Nicolas Goaziou
@ 2015-06-17  6:35   ` Suvayu Ali
  1 sibling, 0 replies; 6+ messages in thread
From: Suvayu Ali @ 2015-06-17  6:35 UTC (permalink / raw)
  To: emacs-orgmode

On Tue, Jun 16, 2015 at 09:36:26PM +0200, Rasmus wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > The attached patch should fix the issue.
> 
> Pushed, thanks.  I changed the commit message slightly.
> 
> > * lisp/ox-beamer.el (org-beamer--get-label): wrap labels in {..}
> 
> You don't need the "lisp/" prefix.  Capitalize after the colon.  Should
> end with period.

Thank you!

-- 
Suvayu

Open source is the future. It sets us free.

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

end of thread, other threads:[~2015-06-17  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 19:11 Bug with label names in beamer export Suvayu Ali
2015-06-16 19:36 ` Rasmus
2015-06-16 20:18   ` Nicolas Goaziou
2015-06-16 20:25     ` Rasmus
2015-06-16 20:41       ` Nicolas Goaziou
2015-06-17  6:35   ` Suvayu Ali

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