chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
30 stars 4 forks source link

Extra beamer code making it to screen in HTML output #209

Open prowlett opened 1 year ago

prowlett commented 1 year ago

Beamer doesn't display section titles as their own thing. Sometimes the section title appears in a side navigation list (depending on the style you're using) but sometimes it's useful to have a section header page. To do this, I have the following code:

\AtBeginSection[] {
    \begin{frame}
        \vfill
        \centering
        \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
            \usebeamerfont{title}\insertsectionhead\par%
        \end{beamercolorbox}
        \vfill
    \end{frame}
}

Previously this would do something like this:

Heading repeated

I've generally thought the repeated heading is fine and easily ignored, and the idea that chirun would display its own <h2> for a section iff this wasn't done in the LaTeX seemed like quite a thorny issue, so I've just ignored it.

But now it looks like this:

Between the repeated headings, the text '[sep=8pt,center,shadow=true,rounded=true]title'

The HTML is like this:

<section class="beamer-section" id="a0000000007">
<h2 aria-hidden="true" class="beamer-section-heading" id="early_renaissance_eu">Early Renaissance Europe</h2>
<section class="beamer-frame">
<div class="centered"><p>
[sep=8pt,center,shadow=true,rounded=true]title 
</p>
<h2 class="beamer-section-title" id="early_renaissance_1">Early Renaissance Europe</h2>
</div>
</section>
...
</section>

Questions:

I suppose I could adapt my LaTeX section header code to only run if \ifplastex is false, like the below. Is this my best option at this point?

\AtBeginSection[] {
    \ifplastex\else
    \begin{frame}
        \vfill
        \centering
        \begin{beamercolorbox}[sep=8pt,center,shadow=true,rounded=true]{title}
            \usebeamerfont{title}\insertsectionhead\par%
        \end{beamercolorbox}
        \vfill
    \end{frame}
    \fi
}