jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
218 stars 64 forks source link

Full support for beamer from `myst build` command-line interface #97

Open kai-tub opened 1 year ago

kai-tub commented 1 year ago

Describe the bug

Hey, it is me again :sweat_smile:

I am not sure if you even currently support the Beamer template rendering, so please close this issue if this is still WIP. I am working on creating the template repository for my beamer theme at:

But the code from the documentation doesn't produce the expected output for beamer:

https://www.myst.tools/docs/jtex/create-a-beamer-template

You can find my example code here:

with the build artifact here:

that includes the following tex output:

% Created with jtex v.0.0.8
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copy in your template with your latex document!

\documentclass[aspectratio=169,]{beamer}

% https://tex.stackexchange.com/questions/123700/how-to-use-local-beamer-theme-in-project-source-folder
% \usetheme won't work if loading from nested directory!

\usepackage[utf8]{inputenc}
\usepackage[darkmode,noto,]{latex-beamer-pure-minimalistic/beamerthemepureminimalistic}

\title{My Beamer Template}
\author{%
  }
% \institute{[doc.institute]}
% \newdate{articleDate}{26}{11}{2022}
% \date{\displaydate{articleDate}}

\begin{document}
\maketitle

\begin{frame}{Outline}
  \tableofcontents
\end{frame}

\section*{Introduction}

\subsection*{Background}

\subsubsection*{My Background Slide Title}

This is some background on beamer templates, use a combination:

\begin{itemize}
\item of \texttt{myst-to-tex} for conversion; and
\item \texttt{jtex} for templating.
\end{itemize}

\end{document}

which doesn't include the begin{frame} environment.

Do I have to modify my template.yml file in any way to indicate that it is a beamer template? Or should the parsing 'understand' that it is a beamer environment as soon as it sees at least one block with a `+++ {outline: true}``` block?

Thanks!

PS: CI doesn't include latexmk yet in my build pipeline, so ignore the missing pdf file :sweat_smile:

Reproduce the bug

See https://github.com/kai-tub/latex_beamer_pure_minimalistic_mystjs/blob/main/.github/workflows/jtex.yml

List your environment

No response

kai-tub commented 1 year ago

PPS:

I've created a small wrapper around latex-docker

It is not minimized (yet) but creates a relatively small alpine docker image with an entire TeXLive environment (full for everything or small for minimal size) and includes the mystjs tools out-of-the-box. It should be automated to monthly check for updates and push it to the GitHub registry if there are any upstream changes (either to the TeXLive environment or the mystjs tools). Ideally, I would create a GitHub action wrapper to quickly execute the myst build CLI and detect the rendered output, but that is something for another day. :sweat_smile: Now, my build artifact includes the wrongly rendered PDF file:

This automation should help in getting reproducible builds from the templates/for the documentation. :)

But one must be patient because the full texlive environment is huge, and it takes quite some time on GitHub CI to download the image. The small environment helps to greatly reduce the load time but comes with many missing packages that make it very hard to debug, as some missing packages do not produce helpful error messages.

EDIT: currently configured to create docker images monthly and not daily