pandoc / dockerfiles

Dockerfiles for various pandoc images
GNU General Public License v2.0
364 stars 98 forks source link

pandoc/extra: Add support for beamertheme-metropolis? #199

Closed cagix closed 1 year ago

cagix commented 1 year ago

This is a polite request to include beamertheme-metropolis (https://github.com/matze/mtheme, http://ctan.org/pkg/beamertheme-metropolis) into the pandoc/extra Docker image.

The beamertheme-metropolis style is quite popular for creating slides with the Beamer class. It would be helpful if you could include this in the pandoc/extra image. This would allow me to use your fine image directly in a GitHub action, and would eliminate the need to define a derived Docker image.

Thank you very much!

cagix commented 1 year ago

Actually, it could be done quite easily with that:

## Install extra packages for Beamer/Metropolis
tlmgr install beamertheme-metropolis                \
              pgfopts                               \
              tcolorbox                             \
              environ                               \
              tikzfill
daamien commented 1 year ago

Hi @cagix !

I agree it would be nice to have a beamer theme.

Looking at the github project activity, the project seems very quiet and the maintener is absent

https://github.com/matze/mtheme/issues/363

Do you have experience using pandoc with this theme ? Can you provide a simple working example for CI tests ?

cagix commented 1 year ago

Indeed, the repository of the beamertheme-metropolis theme seems not to have been updated for a long time, which might be good reason not to include it in the pandoc/extra image.

On the other hand, it is a really nice theme for Beamer slides, which is also frequently used[^1] and works quite well with Pandoc and which is unfortunately not included in the default installation of Beamer, i.e. as a user you'd still have to install a few additional TeX packages.

As for the mwe you'd asked for:

---
title: "Wuppie"
author: "My Cat"
---

## First Slide

> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
> incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
> nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
> Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
> eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
> in culpa qui officia deserunt mollit anim id est laborum.
>
> \hfill -- Lorem ipsum

## Summary

So long and ...

You can compile it using Pandoc via[^2][^3] pandoc -t beamer --variable=theme:metropolis --variable=themeoptions:numbering=none mwe.md -o mwe.pdf

[^1]: Well, at least I happen to come around Metropolis slide sets quite often, and have enjoyed using this theme myself for many years :)

[^2]: It just needs pandoc -t beamer --variable=theme:metropolis mwe.md -o mwe.pdf to engage the Metropolis theme.

[^3]: Not sure about CI, since the effect of this theme would be visible in the emitted PDF only? Perhaps use the LaTeX intermediate code? pandoc -t beamer --variable=theme:metropolis -s mwe.md -o mwe.tex?

mwe.md mwe.pdf mwe.txt (Github won't allow a .tex file, so I changed the extension from "tex" to "txt" for upload.)

cagix commented 1 year ago

thanks!

cagix commented 1 year ago

@daamien @alerque just tested with pandoc/extra:edge and can confirm: beamer+metropolis seems to be functional :) thanks again! 🙏


to be complete:

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/extra:edge  -t beamer --variable=theme:metropolis --variable=themeoptions:numbering=none mwe.md -o mwe.pdf`