Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beamer overlays in notes #7848

Open
Eloitor opened this issue Jan 18, 2022 · 3 comments
Open

Beamer overlays in notes #7848

Eloitor opened this issue Jan 18, 2022 · 3 comments

Comments

@Eloitor
Copy link

Eloitor commented Jan 18, 2022

Describe your proposed improvement and the problem it solves.

When exporting to beamer, we can add speaker notes, which pandoc translates as \note{ my note }, like this:

::::: notes ::::::
my note
::::::::::::::::::

I would like to have support for something which translates to \note<1>{ my first note}. I know that this syntax is currently supported 8d7ecc2 , but I think it would be nice to have something like

::::: {.notes only=1} :::
my first note
:::::::::::::::::::::::::

Describe alternatives you've considered.

I did a pandoc filter to do this, but I need to change "notes" to "note", otherwise the div is beeing parsed twice.

function Div(el)
    if el.classes[1] == "note" then
      -- insert element in front
      if el.attr.attributes["only"] then
        table.insert(
            el.content, 1,
            pandoc.RawBlock("latex", "\\note<" .. el.attr.attributes["only"] .. ">{"))
      else
            table.insert(el.content, 1, pandoc.RawBlock("latex", "\\note{"))
      end
      -- insert element at the back
      table.insert(
        el.content,
        pandoc.RawBlock("latex", "}"))
    end
    return el
  end
  • Is it possible to fix this filter to work well with "notes" directly?
  • Does it make sense to include this feature in pandoc? Does it have any drawback?
@tarleb
Copy link
Collaborator

tarleb commented Jan 19, 2022

Here's my try to make the filter work with "notes":

function Div(el)
  -- Only handle note divs that should appear on specific slides.
  -- We rely on pandoc to handle other notes.
  if el.classes[1] ~= "notes" or not el.attr.attributes.only then
    return el
  end

  return
    {pandoc.RawBlock("tex", "\\note<" .. el.attr.attributes.only .. ">{")} ..
    el.content ..
    {pandoc.RawBlock("tex", "}")}
end

Does it work the way you had in mind?

@Eloitor
Copy link
Author

Eloitor commented Jan 19, 2022

Thanks! this is it.
By the way, why is this feature called "notes" and not "note" in pandoc?

@jgm
Copy link
Owner

jgm commented Jan 19, 2022

Seems like a good addition to the LaTeX writer.
I don't recall about the name, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants