Your filter looks good, except that any subsection of the "marked" section will remain present... but perhaps that's what you want. If not, or if anyone else would like to remove all subsections of that section, the following seems to work: local looking_at_section = false local remove = {} local lvl = 0 function Block (elem) if looking_at_section then remove[#remove + 1] = elem return {} end end function Header (elem) if elem.identifier == 'remove' then looking_at_section = true lvl = elem.level return {} else looking_at_section = looking_at_section and elem.level > lvl if looking_at_section then remove[#remove + 1] = elem return {} end end end The original filter has the same problem... but an abstract usually doesn't have subsections/sublevels (I think). Note also that usually an identifier should identify only one element, and pandoc will (rightly) be annoyed when there's more than one header with the same ID. A class would be ideal for this situation, and one might then use `if elem.classes:includes('remove',1)` rather than `if elem.identifier == 'remove'` -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/b4c57563-7c47-4b1d-accd-2bdaf2e39e75%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.