From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aJIbHKjuumOFZgAAbAwnHQ (envelope-from ) for ; Sun, 08 Jan 2023 17:26:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oMUQG6juumNXQQAAG6o9tA (envelope-from ) for ; Sun, 08 Jan 2023 17:26:16 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 229043F292 for ; Sun, 8 Jan 2023 17:26:15 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEYUK-0004he-OP; Sun, 08 Jan 2023 11:25:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEYUJ-0004hT-Vi for emacs-orgmode@gnu.org; Sun, 08 Jan 2023 11:25:35 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEYUH-0003qV-62 for emacs-orgmode@gnu.org; Sun, 08 Jan 2023 11:25:35 -0500 Received: from TM.local (cbg35-2-78-242-14-140.fbx.proxad.net [78.242.14.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 014D0561286; Sun, 8 Jan 2023 17:25:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=polytechnique.org; s=svoboda; t=1673195128; bh=vd3I9+AtRFLaW/JFJMP8aVSsdrKQ+2Ojn4mEkDeoxlQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID; b=MYFdE0cRcTxlIVvL7VL1EmOxuz496Uyo17mz4iouPK82JHwtyrEa2ys0XI8UJkcXS 1qKA00ZG6FY5RnIUcBzKOtxKYko3Oe6d7lyke1bgan3M/Ffzyz16z5i3igaTLxb2jv sFH8CkM87uDW3X/URQKaoEnMr0M5x9MgEIqD3DNk= From: Alan Schmitt To: Ihor Radchenko Cc: emacs-orgmode Subject: Re: [BUG] CUSTOM_id ignored on blocks by ox-beamer In-Reply-To: <87lemhgwn7.fsf@localhost> References: <87lemhgwn7.fsf@localhost> Date: Sun, 08 Jan 2023 17:25:25 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sun Jan 8 17:25:28 2023 +0100 (CET)) X-Org-Mail: alan.schmitt.1995@polytechnique.org Received-SPF: pass client-ip=129.104.30.34; envelope-from=SRS0=yAY0=5F=polytechnique.org=alan.schmitt@bounces.m4x.org; helo=mx1.polytechnique.org X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673195176; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cvmHkJjKPGKP4EZF/fK3RoJaUjRnKJ3M+1iLMXFrx5E=; b=nNMvyBUHQgfSh98igfyz+ksAiV2xi18sYK61auzfPbRRBU4nta4N4GC0aPK/S5w5f6Gc7e sK1HbXat0jFaL0drbUELESvrttDo5sLdhBrJTZnMTToyyiXI1qJHDqM8B9MWHi/6FVl2ap AG1IB1Su7p/gvxpL0FNAZNujwD5czyJZnxfCeXLJJtmKK47TNlwrSUIW9Z/4B+sEUM99co zzM2VPJmBfBT00VhyxsHJ5XArhJEZk9UZwh3zsu9FG4qzEWnQo2Gw8D6hp4M/QSlZhdLXu oY+DIwLXsJodDIOw0bQN8hIcNdl5IWg7qEQ5qDjBMmMmvUZDRSxsU6aU97yLVQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=polytechnique.org header.s=svoboda header.b=MYFdE0cR; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673195176; a=rsa-sha256; cv=none; b=GT6zLvEQ9vkQx4OhEBCRJuuAaemJvI0gO8wOZPGp3fgkLqfoPhHapmKdwyccxP/kad0KXr a/S8nDku6v2n0D67kzBtvgxNKVm714UTpAwzzvxVNsml9L77kuMFwNcLWIQ1JoVo2SKE0z 0lLvsukATO7GGuwyOLRFFiSqOoT2KVy4emB9eX562tC0YjdNvri2o29BWzJfkHrxjYSwpU VaG6RkLNntWPlczb4vYsJ5bk3FuWc+JvVxqU0dFRDviXu8NKsIoYeCNHldSe/Pn6eZqGWh v/cgBAI5dpuAc2MabUB5GLoNadYxAXDqDyCKJiVk2yG9YbFWwelVlphmHUan/Q== X-Spam-Score: 0.33 X-Migadu-Queue-Id: 229043F292 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=polytechnique.org header.s=svoboda header.b=MYFdE0cR; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 0.33 X-TUID: 7rXQfoOUKY0e --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, On 2023-01-05 09:26, Ihor Radchenko writes: > 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! Thank you for the detailed instructions. Here is my attempt at this. I=E2=80=99ve tested it and it works. --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFTBAEBCAA9FiEE6lXof/BsSVW56ZmGBA0KO07S5ccFAmO67nUfHGFsYW4uc2No bWl0dEBwb2x5dGVjaG5pcXVlLm9yZwAKCRAEDQo7TtLlx0jIB/4kPFgDs1WRInrw yRBTaT6NqAtPZeqCFcyIQSaUYImmVQTtIOa/a5pkraIUIwBJTd56eySaHYHAQLOH Avfbr+PEY1/N33x+X3fJIzCR3VGJVyT2+PJp8sm3v2czHHYXGVfbqGAONmjueUJq cmq/GuJNbDYHbhPbA5NFCpHGzRtR0OutvMvLpatYjo6/MM0JKKcZPDVtVhLxhaE4 mXSrwVZl/QdDKwqgTRJTXz1n6YCFUjo2GhbHl/J7fwU20+IjfXZiXJ2AMWtSvID2 SPVy2cffnukio0YxwK5K6HsjpDyS7yTcwgsI3dOEgV3BCGv66CyVlHtR3L752jXK Jyiu4ucR =A1ap -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-labels-to-latex-export-of-beamer-blocks.patch >>From 1747786c7106d0d90d9e8752e361552afacb2d4d Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Sun, 8 Jan 2023 17:20:31 +0100 Subject: [PATCH] Add labels to latex export of beamer blocks A new option %l is available to be used in `org-beamer-environments-*' to insert the label of the current block, obtained using `org-babel--get-label' --- lisp/ox-beamer.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 689bf1559..3518a0f50 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -178,10 +178,10 @@ through `org-beamer-environments-extra' variable.") ("quotation" "q" "\\begin{quotation}%a %% %h" "\\end{quotation}") ("quote" "Q" "\\begin{quote}%a %% %h" "\\end{quote}") ("structureenv" "s" "\\begin{structureenv}%a %% %h" "\\end{structureenv}") - ("theorem" "t" "\\begin{theorem}%a[%h]" "\\end{theorem}") - ("definition" "d" "\\begin{definition}%a[%h]" "\\end{definition}") - ("example" "e" "\\begin{example}%a[%h]" "\\end{example}") - ("exampleblock" "E" "\\begin{exampleblock}%a{%h}" "\\end{exampleblock}") + ("theorem" "t" "\\begin{theorem}%a[%h]%l" "\\end{theorem}") + ("definition" "d" "\\begin{definition}%a[%h]%l" "\\end{definition}") + ("example" "e" "\\begin{example}%a[%h]%l" "\\end{example}") + ("exampleblock" "E" "\\begin{exampleblock}%a{%h}%l" "\\end{exampleblock}") ("proof" "p" "\\begin{proof}%a[%h]" "\\end{proof}") ("beamercolorbox" "o" "\\begin{beamercolorbox}%o{%h}" "\\end{beamercolorbox}")) "Environments triggered by properties in Beamer export. @@ -578,6 +578,7 @@ used as a communication channel." (cons "O" (or raw-options "")) (cons "h" title) (cons "r" raw-title) + (cons "l" (format "\\label{%s}" (org-beamer--get-label headline info))) (cons "H" (if (equal raw-title "") "" (format "{%s}" raw-title))) (cons "U" (if (equal raw-title "") "" -- 2.39.0 --=-=-= Content-Type: text/plain Best, Alan --=-=-=--