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.
This commit is contained in:
Eric S Fraga 2022-08-12 15:50:17 +01:00 committed by Ihor Radchenko
parent 6cd7c6fb1c
commit 3303a54d74
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 17 additions and 7 deletions

View File

@ -734,13 +734,23 @@ 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