Avoid putting a frame around speaker notes in beamer.

If speaker notes (a Div with class 'notes') occur right
after a section heading, but above slide level, the
resulting `\note{..}` caommand should not be wrapped in
a frame, as that will cause a spurious blank slide.

Closes #7857.
This commit is contained in:
John MacFarlane 2022-01-20 19:09:44 -08:00
parent 6361d43e53
commit 52b78b10c8
2 changed files with 29 additions and 4 deletions

View file

@ -235,10 +235,13 @@ elementToBeamer slideLevel (Div (ident,"section":dclasses,dkvs)
isSlide _ = False
let (titleBs, slideBs) = break isSlide ys
return $
if null titleBs
then Div (ident,"section":dclasses,dkvs) xs
else Div (ident,"section":dclasses,dkvs)
(h : Div ("","slide":dclasses,dkvs) (h:titleBs) : slideBs)
case titleBs of
[] -> Div (ident,"section":dclasses,dkvs) xs
[Div (_,"notes":_,_) _] -> -- see #7857, don't create frame
-- just for speaker notes after section heading
Div (ident,"section":dclasses,dkvs) xs
_ -> Div (ident,"section":dclasses,dkvs)
(h : Div ("","slide":dclasses,dkvs) (h:titleBs) : slideBs)
| otherwise
= return $ Div (ident,"slide":dclasses,dkvs) xs
elementToBeamer _ x = return x

22
test/command/7857.md Normal file
View file

@ -0,0 +1,22 @@
```
% pandoc --slide-level=2 -t beamer
# section
::: notes
my note
:::
## slide
ok
^D
\hypertarget{section}{%
\section{section}\label{section}}
\note{my note}
\begin{frame}{slide}
\protect\hypertarget{slide}{}
ok
\end{frame}
```