::: notes div on section slide shows up in beamer article
Explain the problem. This is a continuation of #7857.
Thanks for the fix there, adding a ::: note to a section slide adds a note on that slide. This note does not show up on the main slide or the handout, which is expected and desired.
However, it does show up when compiling into the beamerarticle option. All other notes do not show up in the beamerarticle that I can see, just this one. This one should also not show up.
It looks like the \note{ is missing write before the content of the note when in beamerarticle.
Pandoc version? 2.19.2 on Ubuntu 22.04 LTS.
Could you add a short example that allows us to reproduce the issue?
Sure/
# First Section 1
## First Subsection in First Section
::: notes
This should also not appear in handout or article
:::
### First slide (I think)
Here is what shows up in article:
I haver exactly the same issue with Pandoc 3.2.
Please give detailed instructions for reproducing the issue (I could not).
No problem.
Take the following file content:
---
title: Test for articleBeamer
author: Me
date: 1/1/1
documentclass: beamer
beameroption: "show notes on second screen=right"
---
# First slide
Some slide content.
::: notes
Make some note!
:::
# Second slide
Another slide
It makes a valid Beamer presentation using, let’s say:
pandoc -t beamer beamerarticle.md -o beamerarticle.pdf
Now, if you change the YAML header to:
---
title: Test for articleBeamer
author: Me
date: 1/1/1
documentclass: article
header-includes:
- \usepackage{beamerarticle}
---
And use:
pandoc beamerarticle.md -o beamerarticle.pdf
You expect the notes not to show up, but they do…
Try with
pandoc beamerarticle.md -o beamerarticle.pdf --to=beamer
@tarleb Thanks for the idea. It fails:
Error producing PDF.
! Undefined control sequence.
<recently read> \setbeamertemplate
l.9 \setbeamertemplate
I think you don’t get what beamerarticle is made for : it’s a package for the class article that produces an article from a beamer presentation. I think this is why your solution fails.
Ah yes, that was indeed my mistake.
You could filter the notes out with a Lua filter:
function Div (div)
if div.classes:includes 'notes' then
return {}
end
end
I'm wondering, if the note div will be translated into a \note{...} command. If this is true, couldn't you just add an emtpy definition to the headers-include section?
@cagix No, the notes div is not translated: it would be recognized by beamerarticle. To be completely sure, I exported to a .tex file : it becomes a simple paragraph.
@tarleb Thanks a lot, the filter does the job. Actually, that was the first solution I was heading to but I stumbled upon an apparently similar problem and thought (by misinterpreting what the writer was actually meaning) it was not a good idea. As far as I’m concerned, the issue is solved, since the only reason I wanted to use the beamerarticle package was to drop the notes div.
I'm wondering, if the
notediv will be translated into a\note{...}command. If this is true, couldn't you just add an emtpy definition to theheaders-includesection?
This is actually what I was hoping for in my original request above. All the other note div in slides are translated into \note{...} for beamerarticle, but not when it is part of a section. If the \note{...} would be added by pandoc even in the beamerarticle class, just like it does for beamer then everything would work as expected.
@folofjc @pagiraud Ah, so in the case of -t beamer a \note{<text>} is output, but with -t latex it is only the text within the div without the enclosing \note{}.
However, this only seems to affect the note div, I just tested it with other divs, there is no tex command emitted in any case, just the text. I find this quite ... inconsistent (even though note has a special meaning in the case of Beamer).
@folofjc @pagiraud Ah, so in the case of
-t beamera\note{<text>}is output, but with-t latexit is only the text within the div without the enclosing\note{}.However, this only seems to affect the
notediv, I just tested it with other divs, there is no tex command emitted in any case, just the text. I find this quite ... inconsistent (even thoughnotehas a special meaning in the case of Beamer).
Correct. And it is only in the section. When there is a note div in a slide, it is correctly output as \note{...} in beamerarticle.
@jgm Is this something that should be handled the same way across all writers? With -t html, a div with the corresponding class is always produced, and the user must provide the appropriate definition. If this were handled in the same way for -t latex and -t beamer, it would be much more consistent and logical from a user's point of view. This would also solve the original question. However, it might also break some workflows where people use divs and translate to LaTeX.
I note the following code in the LaTeX writer:
[Div (_,"notes":_,_) _] -> -- see #7857, don't create frame
-- just for speaker notes after section heading
Div (ident,"section":dclasses,dkvs) xs
This refers to #7857 which might shed some light on why it behaves the way it does...
I think this might have been fixed by the recent template-restructuring. At least I now see the notes when running pandoc -Vbeamerarticle test.md --output=out.pdf.