mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-21 13:51:29 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
```
|
||||
Reference in New Issue
Block a user