emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] CUSTOM_id ignored on blocks by ox-beamer


From: Ihor Radchenko
Subject: [BUG] CUSTOM_id ignored on blocks by ox-beamer
Date: Thu, 05 Jan 2023 09:26:20 +0000

Confirmed.

alan.schmitt@polytechnique.org writes:

> I’m writing course slides in org-mode (exported currently to beamer, but
> I want to also have html export in the long run), and I have trouble
> linking blocks (for theorems or definitions), as the CUSTOM_ID property
> is ignored by ox-beamer on blocks.
>
> I see this issue has already been raised on the list
> (https://list.orgmode.org/87lflg9ts2.fsf@nicolasgoaziou.fr/T/), and
> looking at the code it seems that it still needs to be modified.
> Unfortunately the code for org-beamer--format-block is quite complex and
> I do not see how to change it to add a label. Could someone on the list
> please give me a hand?

If you look inside `org-beamer--format-block', it uses
`org-beamer-environments-default' and `org-beamer-environments-extra' to
format the blocks. See docstring for the latter for details.

The code responsible for LaTeX block generation is

     (when (nth 2 env-format) ; when we non-column block
      (concat
       (org-fill-template ...) ; opening \begin lines
       contents ; block body
       ... ; block closing \end lines
       )

org-fill-template is using the template from the
`org-beamer-environments-*' replacing %-chars as described in the
docstring.

In order to handle CUSTOM_ID property, you can
(1) Introduce a new %-substitude to be handled in org-fill-template
    call. It will insert block ID. (for example, using
    `org-beamer--get-label')
(2) modify `org-beamer-environments-default' to insert label
    appropriately.

Patches welcome!

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]