@@ -87,6 +87,7 @@ data WriterEnv = WriterEnv { envMetadata :: Meta
8787 , envInList :: Bool
8888 , envInNoteSlide :: Bool
8989 , envCurSlideId :: SlideId
90+ , envInSpeakerNotes :: Bool
9091 }
9192 deriving (Show)
9293
@@ -100,6 +101,7 @@ instance Default WriterEnv where
100101 , envInList = False
101102 , envInNoteSlide = False
102103 , envCurSlideId = SlideId "Default"
104+ , envInSpeakerNotes = False
103105 }
104106
105107
@@ -354,15 +356,24 @@ inlineToParElems (Code _ str) =
354356 inlineToParElems $ Str str
355357inlineToParElems (Math mathtype str) =
356358 return [MathElem mathtype (TeXString str)]
359+-- We ignore notes if we're in a speaker notes div. Otherwise this
360+-- would add an entry to the endnotes slide, which would put speaker
361+-- notes in the public presentation. In the future, we can entertain a
362+-- way of adding a speakernotes-specific note that would just add
363+-- paragraphs to the bottom of the notes page.
357364inlineToParElems (Note blks) = do
358− notes <- gets stNoteIds
359− let maxNoteId = case M.keys notes of
360− [] -> 0
361− lst -> maximum lst
362− curNoteId = maxNoteId + 1
363− modify $ \st -> st { stNoteIds = M.insert curNoteId blks notes }
364− local (\env -> env{envRunProps = (envRunProps env){rLink = Just $ InternalTarget endNotesSlideId}}) $
365− inlineToParElems $ Superscript [Str $ show curNoteId]
365+ inSpNotes <- asks envInSpeakerNotes
366+ if inSpNotes
367+ then return []
368+ else do
369+ notes <- gets stNoteIds
370+ let maxNoteId = case M.keys notes of
371+ [] -> 0
372+ lst -> maximum lst
373+ curNoteId = maxNoteId + 1
374+ modify $ \st -> st { stNoteIds = M.insert curNoteId blks notes }
375+ local (\env -> env{envRunProps = (envRunProps env){rLink = Just $ InternalTarget endNotesSlideId}}) $
376+ inlineToParElems $ Superscript [Str $ show curNoteId]
366377inlineToParElems (Span _ ils) = concatMapM inlineToParElems ils
367378inlineToParElems (RawInline _ _) = return []
368379inlineToParElems _ = return []
@@ -464,7 +475,8 @@ blockToParagraphs (DefinitionList entries) = do
464475 definition <- concatMapM (blockToParagraphs . BlockQuote) blksLst
465476 return $ term ++ definition
466477 concatMapM go entries
467−blockToParagraphs (Div (_, "notes" : [], _) blks) = do
478+blockToParagraphs (Div (_, "notes" : [], _) blks) =
479+ local (\env -> env{envInSpeakerNotes=True}) $ do
468480 sldId <- asks envCurSlideId
469481 spkNotesMap <- gets stSpeakerNotesMap
470482 paras <- concatMapM blockToParagraphs blks