emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Fraga, Eric" <e.fraga@ucl.ac.uk>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "edgar@openmail.cc" <edgar@openmail.cc>,
	Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: how to beamer export overlay figure?
Date: Sat, 13 Aug 2022 11:39:23 +0000	[thread overview]
Message-ID: <87pmh42x05.fsf@ucl.ac.uk> (raw)
In-Reply-To: <8735e07bc3.fsf@localhost> (Ihor Radchenko's message of "Sat, 13 Aug 2022 17:16:12 +0800")

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

Hi Ihor,

On Saturday, 13 Aug 2022 at 17:16, Ihor Radchenko wrote:
> I guess the message is only for testing here.

Indeed.  I did send a subsequent patch without the message line.  Attached here again just in case.

> Otherwise, looks good.

Can you apply it please?

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-ox-beamer-Enable-use-of-overlays-for-images.patch --]
[-- Type: text/x-diff; name="0001-lisp-ox-beamer-Enable-use-of-overlays-for-images.patch", Size: 2098 bytes --]

From e11a09b2d69db6f7da55914276751daa8e34395b Mon Sep 17 00:00:00 2001
From: Eric S Fraga <e.fraga@ucl.ac.uk>
Date: Fri, 12 Aug 2022 15:50:17 +0100
Subject: [PATCH] lisp/ox-beamer: Enable use of overlays for images

* ox-beamer.el (org-beamer-link): If an overlay beamer attributed has
been provided, use it for images.
---
 lisp/ox-beamer.el | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index e6232d8d2..cb35850b9 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -734,13 +734,22 @@ used as a communication channel."
   (or (org-export-custom-protocol-maybe link contents 'beamer info)
       ;; Fall-back to LaTeX export.  However, prefer "\hyperlink" over
       ;; "\hyperref" since the former handles overlay specifications.
-      (let ((latex-link (org-export-with-backend 'latex link contents info)))
-	(if (string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
-	    (replace-match
-	     (format "\\\\hyperlink%s{\\1}"
-		     (or (org-beamer--element-has-overlay-p link) ""))
-	     nil nil latex-link)
-	  latex-link))))
+      (let* ((latex-link (org-export-with-backend 'latex link contents info))
+             (parent (org-export-get-parent-element link))
+             (attr (org-export-read-attribute :attr_beamer parent))
+             (overlay (plist-get attr :overlay)))
+        (cond ((string-match "\\`\\\\hyperref\\[\\(.*?\\)\\]" latex-link)
+               (replace-match
+                (format "\\\\hyperlink%s{\\1}"
+                        (or (org-beamer--element-has-overlay-p link) ""))
+                nil nil latex-link))
+              ((string-match "\\\\include\\(graphics\\|svg\\)\\([[{]?\\)" latex-link)
+               ;; check for overlay specification and insert if present
+               (replace-match
+                (format "\\\\include\\1%s\\2"
+                        (if overlay overlay ""))
+                nil nil latex-link))
+              (t latex-link)))))
 
 
 ;;;; Plain List
-- 
2.30.2


  reply	other threads:[~2022-08-13 11:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 16:39 how to beamer export overlay figure? edgar
2022-08-11  9:51 ` Fraga, Eric
2022-08-11 13:05   ` edgar
2022-08-11 14:06     ` Fraga, Eric
2022-08-11 16:14       ` edgar
2022-08-12 11:50     ` Fraga, Eric
2022-08-12 14:35       ` edgar
2022-08-12 14:53         ` [PATCH] " Fraga, Eric
2022-08-12 20:14           ` edgar
2022-08-13  9:16       ` Ihor Radchenko
2022-08-13 11:39         ` Fraga, Eric [this message]
2022-08-14  3:34           ` Ihor Radchenko
2022-08-14  9:30           ` Max Nikulin
2022-08-14 13:14             ` Fraga, Eric
2022-08-11 16:33 ` Max Nikulin
2022-08-12  8:18   ` Fraga, Eric

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=87pmh42x05.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=edgar@openmail.cc \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    /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).