alhassy / org-special-block-extras

A number of new custom blocks and link types for Emacs' Org-mode ^_^
GNU General Public License v3.0
196 stars 15 forks source link

Add beamer support #35

Open opensource-philosophy opened 2 years ago

opensource-philosophy commented 2 years ago

Exporting to LaTeX using org-beamer does not work. This is because beamer as a backend is not provided for. This could easily be solved by changing lines like (equal backend 'latex) to (or (equal backend 'beamer) (equal backend 'latex)); it accounts for both LaTeX and beamer. Any chance you could make these changes? Your blocks are too great not to be used in org-beamer!

alhassy commented 2 years ago

I am fully aware of this and already have a proposal to address it: To make org-defblock rely on defmethod instead of defun so that backend support is not baked-in, as the current implementations do.

I have numerous other, private, proposals. Perhaps I should place them publicly and ask for help to make them come true.

Unfortunately, with 2 kids and a full time job, and not being an active user of org-special-block-extras, this is not something I can direct immediate energy towards.

However, I'm happy to accept PRs and to help guide on making the changes, if you or someone else wants to champion this change.

opensource-philosophy commented 2 years ago

First of all: Please don't stress yourself out with this - family is more important than some strings of letters!

I am afraid I do not know anything about defmethod and have not dived into your code too much. Anyway, I think there is an easy way to account for derived backends, namely using the predicate org-export-derived-backend-p. Luckily, it returns non-nil both if BACKEND is derived from one of BACKENDS and if BACKEND is one of BACKENDS. That is, specifically, both

(org-export-derived-backend-p 'beamer 'latex)

and

(org-export-derived-backend-p 'latex 'latex)

return non-nil. It should also solve issue #35. Unfortunately, I do not have much time either. But if I found some, would you accept a PR with these changes?

As to the private proposols: Please, do make them public! I can very well imagine that a Reddit post would suffice to make some of them true.

alhassy commented 1 year ago

Hey @opensource-philosophy,

Your blocks are too great not to be used in org-beamer!

That's kind to hear; thanks!

First of all: Please don't stress yourself out with this - family is more important than some strings of letters!

That was really nice to read; thank-you ❤️

[Musa] this is not something I can direct immediate energy towards.

It's been about a year since the issue was opened, and I think it's close to being resolved.

Please see http://alhassy.com/org-special-block-extras/#Dispatch-on-backend-open-for-extensibility

In particular, if there is a specific block you'd like to use with beamer then we can produce a MVP to make that happen ---on your machine using the latest "open for extensibility" defblock method.