git.iko.soy/typeable/pandoc
on master help sign in
Improve handout example.
commit5c71e5afbfb127f4a7fc225610a486d33e21cdb4 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 12 Nov 2017, 15:51 (9 years ago) parenteacf1a2
1 file changed+5−2
doc/lua-filters.md+5−2
doc/lua-filters.md+5−2
@@ -365,8 +365,10 @@ end
365365## Creating a handout from a paper
366366
367367This filter extracts all the numbered examples, section
368−headers, block quotes from a document, in addition to any
369−divs with class `handout`:
368+headers, block quotes, and figures from a document, in addition
369+to any divs with class `handout`. (Note that only blocks
370+at the "outer level" are included; this ignores blocks inside
371+nested constructs, like list items.)
370372
371373``` lua
372374function Pandoc(doc)
@@ -375,6 +377,7 @@ function Pandoc(doc)
375377 if (el.t == "Div" and el.classes[1] == "handout") or
376378 (el.t == "BlockQuote") or
377379 (el.t == "OrderedList" and el.style == "Example") or
380+ (el.t == "Para" and #el.c == 1 and el.c[1].t == "Image") or
378381 (el.t == "Header") then
379382 table.insert(hblocks, el)
380383 end