It does? I'm away from my work computer ATM so I can't test. Have you tried to just return elem without wrapping it in a table? (Not that it should make any difference.) Also try to explicitly return nil as a fallback at the bottom of the function, although I'm not sure that should make any difference either. -- Better --help|less than helpless Den lör 16 jan. 2021 10:24Stephan Boltzmann skrev: > Thanks again for your answer. > I'm not sure whether I understood everything correctly. > > if FORMAT:match 'latex' then > function Table (elem) > elem.caption = {} > return {elem} > end > end > > Gives me an error message. > > BPJ schrieb am Donnerstag, 14. Januar 2021 um 23:00:07 UTC+1: > >> You can just return the original table having replaced the caption with >> an empty list in place. >> >> >> -- >> Better --help|less than helpless >> Den tors 14 jan. 2021 13:29Stephan Boltzmann >> skrev: >> >>> Thanks a lot for your hint. >>> >>> Then I would still have to fix the return statement. >>> >>> BP schrieb am Donnerstag, 14. Januar 2021 um 11:43:32 UTC+1: >>> >>>> I think you should use `elem.caption = {}` >>>> >>>> -- >>>> Better --help|less than helpless >>>> >>>> Den tors 14 jan. 2021 10:41Stephan Boltzmann >>>> skrev: >>>> >>>>> Hello everybody out there using Pandoc, >>>>> >>>>> I would like to remove the caption from tables in PDF output and tried >>>>> a couple of things without success: >>>>> >>>>> if FORMAT:match 'latex' then >>>>> function Table (elem) >>>>> --caption = elem.caption >>>>> caption = elem.c[2] -- caption seems to be second element >>>>> print(pandoc.utils.stringify(caption)) >>>>> --elem.c[2] = nil >>>>> --elem.c[2] = pandoc.Str('Test') >>>>> --elem.caption = nil >>>>> --elem = nil >>>>> --return {pandoc.Table(elem.c)} >>>>> --return {elem} >>>>> --elem:remove(2) >>>>> --table.remove(elem.c,2) >>>>> --[[ >>>>> return { >>>>> pandoc.Para(pandoc.Str('test')) >>>>> } >>>>> --]] >>>>> return { >>>>> --pandoc.Table(elem.caption, elem.aligns, elem.widths, >>>>> elem.headers, elem.rows) >>>>> } >>>>> end >>>>> end >>>>> >>>>> The main problem could actually rather be the construction of the >>>>> table using the function pandoc.Table in the return statement: >>>>> Could not read list: Could not get Block value: expected table, got >>>>> 'nil' (nil) >>>>> >>>>> -- >>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/pandoc-discuss/82e61683-5190-45c6-8420-60243cf1bee3n%40googlegroups.com >>>>> >>>>> . >>>>> >>>> -- >>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/pandoc-discuss/7e2c1a91-6cb1-4344-aab5-8577f1b82905n%40googlegroups.com >>> >>> . >>> >> -- > 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/35c35036-590d-48d9-bddb-09e6e71b4982n%40googlegroups.com > > . > -- 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/CADAJKhBTKO4irrpCpy-1NfwQLMWzrV-i3b%3DMYPrwsLjgROOaHg%40mail.gmail.com.