emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: alan.schmitt@polytechnique.org
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [BUG] CUSTOM_id ignored on blocks by ox-beamer
Date: Thu, 05 Jan 2023 09:26:20 +0000	[thread overview]
Message-ID: <87lemhgwn7.fsf@localhost> (raw)
In-Reply-To: <m2r0wacy90.fsf@m4x.org>

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	other threads:[~2023-01-05  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 11:52 CUSTOM_id ignored on blocks by ox-beamer alan.schmitt
2023-01-05  9:26 ` Ihor Radchenko [this message]
2023-01-08 16:25   ` [BUG] " Alan Schmitt
2023-01-15 13:57     ` Alan Schmitt
2023-01-19 10:21     ` Ihor Radchenko
2023-02-09  9:14       ` Alan Schmitt
2023-02-10 10:57         ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lemhgwn7.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).