emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Fraga, Eric" <e.fraga@ucl.ac.uk>
To: "edgar@openmail.cc" <edgar@openmail.cc>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: [PATCH] Re: how to beamer export overlay figure?
Date: Fri, 12 Aug 2022 14:53:33 +0000	[thread overview]
Message-ID: <87sfm1zf6b.fsf_-_@ucl.ac.uk> (raw)
In-Reply-To: <ae9564f49d6fa34649a60e55b56de203@openmail.cc> (edgar@openmail.cc's message of "Fri, 12 Aug 2022 14:35:26 +0000")

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

On Friday, 12 Aug 2022 at 14:35, edgar@openmail.cc wrote:
> It worked! Thanks. I send a counter-patch :)  (for SVG).

Excellent.  I forgot about SVG.  So I throw one back at you! ;-) Just
deleted a spurious message line.

Maybe somebody with submit access can have a look and see if this is
suitable for applying to master?  Or if there is a better way of doing
this (I'm sure there is...)?

-- 
: 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-12 15:10 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         ` Fraga, Eric [this message]
2022-08-12 20:14           ` [PATCH] " edgar
2022-08-13  9:16       ` Ihor Radchenko
2022-08-13 11:39         ` Fraga, Eric
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=87sfm1zf6b.fsf_-_@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=edgar@openmail.cc \
    --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).