From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27457 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephan Boltzmann Newsgroups: gmane.text.pandoc Subject: Lua filter to remove captions from tables Date: Thu, 14 Jan 2021 01:40:41 -0800 (PST) Message-ID: <82e61683-5190-45c6-8420-60243cf1bee3n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_506_1826344350.1610617241374" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15564"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCZ25UWY24ERBGVDQCAAMGQEWDCW7YQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 14 10:40:45 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f190.google.com ([209.85.167.190]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kzz7U-0003vR-TQ for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 14 Jan 2021 10:40:44 +0100 Original-Received: by mail-oi1-f190.google.com with SMTP id n9sf2175631oic.15 for ; Thu, 14 Jan 2021 01:40:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=ox/aQZNph+P+O1p6gOC+aVX4TCz0T/WtRXwoxI3Z+x0=; b=JfIhfLDXAdxi01ACf+axunaW8bUW+D8XrtO9GfadRPSjbYKeXBslvcQ1PkKT+SAsgH c9wd0LRufd2of6ccfvhk2iBrwnGquHH/2hdtHKfXjj6zW/0z7uc5TKKXxfyd+yG4pyCm FnTK3ksB6Gvk2pgQqy5gq8cRI5a1qGyNfQ1CwH1+8rNepVDuOr2M/WrQ0KcA0IR6QfqH BLcFZVF6JgaRTjVNl0nWX1fNvo28btP1geCoUMHEQPSTMNRCDhBgcLYVm6F0sRC5bWph FNYHhP+NdUM0Ntw4Bfjza9vL4FZhZYEEmrLIiwNUzW02B7QVe0BDHJftvX6F9Z1LhLxL 5x0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=ox/aQZNph+P+O1p6gOC+aVX4TCz0T/WtRXwoxI3Z+x0=; b=M6bC4A/GstDwt1bNipOan+/6zcsN5fLkxc5UZVSIG6nTK68spabXqA9CTOa1Ow/+H6 dX9idpY4MmtIjyH1sdsnnuoNg7FYfN51RJTElgbo0YJO6JJSB+GEt7MnN6gwcCqRV51k UBSopA/YiFL8Xzi5YjIKtOpeWGP07vsL22mJ5WhJAi0HtPSUdt6dCUy+yUeAnJIyx6av SkIVtJhhBxBOzPMnICJv0acXskFDXmhbyV8ay7AfjCPkQmjnLbKRPVgG+yVOJN3DWZ96 3OXn/onzpzw+uVqUNmjFPZTnR0YI3IaLEZ8aIkXMav+haenBs5U2YmEKH8cLIqgS7P75 z+tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=ox/aQZNph+P+O1p6gOC+aVX4TCz0T/WtRXwoxI3Z+x0=; b=jqRH4cmorcitfYZClFLfHXwsq+xtDsufoGapavkNN+AJ6Ls3GkVMQ+x9v1KK/wQeYS L5wQLasUsVrDydNnT0+hhS/gBX6v5U+kAJldJVseCIRWdTnsK2J1xh08JHWysSLghCrZ 1VwW1888ZobsDcdUaPwsLiz8Qa4DHFaRxh9+sp/YM4NNXHq2ftHwY8DL57zOsEPnBZ+o +3DuT/X84Hr6+mu4fzgQJtGnb+7oqhjAZNQE0F/s/lz0MPgS+hs2zG1Sz96rHeeH2tih WIGkFPBdNSyy04pskQNp0Pvi6ORscb7DKhZyoeoNUKqAO19tBXU35SzYODsbJgQOPjnO 0OMQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530rgOu3y8S6tMIKUSl0X6jvr5si7cjGM4R3FfjIBdlK+wvAC+2G 2RpQlcFCWjX1CTTUFlPkNCg= X-Google-Smtp-Source: ABdhPJxkRJKysjOjYJyv/UyphtR8mOAX8Eqhaay8o1bcUmKGt6IAsfY9Jo7VlTbgW5FP6q3K4KKEAw== X-Received: by 2002:a9d:8b6:: with SMTP id 51mr4296161otf.5.1610617243956; Thu, 14 Jan 2021 01:40:43 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:60cc:: with SMTP id b12ls1249058otk.0.gmail; Thu, 14 Jan 2021 01:40:42 -0800 (PST) X-Received: by 2002:a05:6830:1d8e:: with SMTP id y14mr3983106oti.356.1610617242324; Thu, 14 Jan 2021 01:40:42 -0800 (PST) X-Original-Sender: stephan2boltzmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:27457 Archived-At: ------=_Part_506_1826344350.1610617241374 Content-Type: multipart/alternative; boundary="----=_Part_507_2114937387.1610617241374" ------=_Part_507_2114937387.1610617241374 Content-Type: text/plain; charset="UTF-8" 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-discuss+unsubscribe-/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. ------=_Part_507_2114937387.1610617241374 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello everybody out there using Pandoc,

I wou= ld 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 (e= lem)
    --caption =3D elem.caption
   = caption =3D elem.c[2] -- caption seems to be second element
  = ;  print(pandoc.utils.stringify(caption))
    --elem= .c[2] =3D  nil
    --elem.c[2] =3D  pandoc.Str(= 'Test')
    --elem.caption =3D  nil
  &= nbsp; --elem =3D nil
    --return {pandoc.Table(elem.c)}<= br>    --return {elem}
    --elem:remove(2= )
    --table.remove(elem.c,2)
--[[
  &nb= sp; return {
      pandoc.Para(pandoc.Str('test= '))
    }
--]]
    return {
 = ;     --pandoc.Table(elem.caption, elem.aligns, elem.wi= dths, elem.headers, elem.rows)
    }
  end
end=

The main problem could actually rather be the construction of the ta= ble using the function pandoc.Tab= le in the return st= atement:
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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
------=_Part_507_2114937387.1610617241374-- ------=_Part_506_1826344350.1610617241374--