Thanks. Using your script, what I can't do is to include a heading inside the fenced div, can't I? The reason is that I need solution to be presented in a different slide. I had just found a kind of solution, using heading identifiers (although when compiling to beamer it spits a warning (as several sections share the same identifier):

local looking_at_section = false
local lvl = 0
local remove = {}  -- delete line if 'remove' array not needed

function Block (elem)
  if elem.t == "Header" then
    -- if elem.classes:includes('remove',1) then

    if elem.identifier == 'answer' then
      looking_at_section = true
      lvl = elem.
level
    else

      looking_at_section = looking_at_section and elem.level >
lvl
    end
  end
  if looking_at_section then
    remove[#remove + 1] = elem  -- delete line if 'remove' array not needed
    return {}
  end
end





El sábado, 6 de abril de 2019, 20:17:02 (UTC+2), BP escribió:
I use a div with a class and a filter which removes divs with that class like this:

````markdown
:::answer
**Answer:** 42.
:::
````

````lua
function Div (elem)
  if elem.classes:includes('answer') then
    return {} -- delete it
  else
    return elem
  end
end
````

HTH,

/bpj

Den lör 6 apr. 2019 18:44pbeltran <pab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
My purpose is to generate two versions from the same markdown file. Think in a worksheet or a set of reveal slides with and without solutions.

If I use gpp, like suggested here, the math expressions in my .md (mathjax) get messed, since \ are escaped.

Is there a way out of the box? For instance, by using custom fenced_divs and them telling pandoc to remove that specific div? I've taken a look at custom filters but I don't know haskell...

Thanks

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-...@googlegroups.com.
To post to this group, send email to pandoc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/61bdaf46-d88a-4ef1-b145-71ad5900fed8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/44645f9a-1670-4f4e-93cc-e24394fa10f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.