The following lua code does the trick - it captures Jupyter's html tables and converts them to latex tables for rendering in PDF. function RawBlock (raw) if raw.format:match 'html' then return pandoc.read(raw.text, 'html').blocks end end New problem exposed, though. Nested tables are not converted properly. I'll treat this conversation re: adjusting for html code as resolved, and I'll open a new conversation re: converting nested tables. On Monday, July 18, 2022 at 6:40:36 PM UTC-7 Richard Huntsinger wrote: > Thank you much, fiddlosopher, for your quick reply. Clearly, I need make > use of lua filters to adjust for the HTML code in my Jupyter notebooks. > I've now read the lua documentation and tried some of the examples on the > pandoc doc site and pandoc/lua-filters repository - but I don't see an > example of how to search for and transform HTML-format tables to native > pandoc-format tables, or similar such thing. Can you provide me some > additional guidance? > > On Monday, July 18, 2022 at 12:54:17 AM UTC-7 fiddlosopher wrote: > >> Raw HTML in a Markdown document (which is apparently what the R >> display_html function produces) will not be passed through to PDF. >> Similarly, raw LaTeX will not be passed through to HTML. >> >> One approach might be to generate *both* formats in your notebook. You >> could try that. >> >> Another approach would be to use a Lua filter that matches raw HTML >> blocks and uses pandoc.read to convert them to native pandoc tables, which >> could then be rendered in PDF. I believe there are examples of such filters >> either in the Lua filters documentation, or in the pandoc/lua-filters >> repository, or on this list. If you can't see how to do it, just ask. >> >> >> -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ebb070e8-7bcc-4584-b142-5a4a150def08n%40googlegroups.com.