Skip to content

Commit

Permalink
lisp/ox-beamer: Enable use of overlays for images
Browse files Browse the repository at this point in the history
* ox-beamer.el (org-beamer-link): If an overlay beamer attributed has
been provided, use it for images.
  • Loading branch information
ericsfraga authored and yantar92 committed Aug 14, 2022
1 parent 6cd7c6f commit 3303a54
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions lisp/ox-beamer.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3303a54

Please sign in to comment.