From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27473 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to remove captions from tables Date: Thu, 14 Jan 2021 22:59:56 +0100 Message-ID: References: <82e61683-5190-45c6-8420-60243cf1bee3n@googlegroups.com> <7e2c1a91-6cb1-4344-aab5-8577f1b82905n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c0b8b105b8e36086" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33033"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBZP5QKAAMGQET64JWTQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 14 23:00:08 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wr1-f55.google.com ([209.85.221.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l0Af1-0008Rp-7M for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 14 Jan 2021 23:00:07 +0100 Original-Received: by mail-wr1-f55.google.com with SMTP id r8sf3184613wro.22 for ; Thu, 14 Jan 2021 14:00:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610661607; cv=pass; d=google.com; s=arc-20160816; b=NlflkIxwEmH5HtBvbPvjCzllNM4D9P8SGpkF+cb6cXk5W8fGVtsrW4hUyrjOhnenvo rPTndYG9eNQtP6yCJCK1O1+vWhudA96W07nT0htRB+62BHN9ayFNAZAotRiHvv8r+qe1 IrNAcPCh/uz5uWP5v07CLqS6TgNWM0K49704tM+cuN2EVqvghDNkbTF2zLH28FK5VSv/ +b1LEE5l8eHTCxTH9TVC0YihDBtQvfl8BbAYQhoBxf62Zr22EMdO2tqZCEJiVaBGZ/mB oa1jg8yPLmCyNs7hEoEOBxzgcW6P0QYOtV313RJCE/CvNWfMWpCoYfNK7S47nI1nqF4p IU0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:sender:dkim-signature; bh=eNWr9igk59ktDxDaluH5QR1xYkVvwk+NwJANa7yh9m4=; b=raYLycdGJIIVOfbCIDQJIH8+qTKBcyTRycT6FQSMzcYY5DU1Kf7bajBtQaJ+YFl5bE PyXN78XXr04GeklEcMwt1RU8KfxGbJ3Hp9jlrQhVG5rs9V8oYt6VCFu1VYX6+sGvSCwb oboAcFKaDzC2Kak00ZmtimWaiRIPBPrn6Vpv9JlyHW2jEzlOg58Zo45wKXfPktVjcPNf dnrd+KtP7CsPbPrSMLfxunQpmAgVWe2wY8qvPm7MS/ku2Ix0OfVpc0z6xy8vsQmoudOI scVBx4WBn3Rvo8rD9/Yhf5zgSWb3XZyosAP0hz9UgkqYFIlx/NE5lI68WW9tl5u2jlAQ mRhQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.180 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:reply-to:from:date :message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=eNWr9igk59ktDxDaluH5QR1xYkVvwk+NwJANa7yh9m4=; b=PXyEsPfglnPeCO54GWTNIkxAmAIZBSH2CQ5lxRNMjqw2wSsXb0skZnSWoZM9u0r5ee b2ZpBeJVD3jbtTGxY08kZA4JU92n1M0rBxPgNJbo3e7WwjfnflXg1cKMsmOuUkFbivQZ 4USOXGpDrzahtIJusx8/kLwBbVCwi+v09IsRtu+NxSYN8mY02K83RoY240qPOBwlhCoV V+PoUyykWjPNCKtRhjnj5qu6mkMzJM4t7mo4iFHbdOL1KAMQB3kHdqzAaYDiKOvu5kct vlCnaPNiZnn+hXLj9gQayergeRL40Pao9XdJq9zrqf4FsYpCy1+IbPHQnr016Fef33zw gukQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to :reply-to:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=eNWr9igk59ktDxDaluH5QR1xYkVvwk+NwJANa7yh9m4=; b=atZXsYCoKa8GkTImzM9YkIHOfFsaXOWfKFQGGA6V7z+mh11Sm8fCuV3s2kzgOnNNVb Z7NjBldnHc1zfbNJ1FlpO9Rzy0XYYbCLXPEPGNoE3On+Y3jveOSjjS1WzkPe8yoZarAh Z56GEuSLME0BIj/Eal9zbnJZCQozzm7I9x4r2l2Fdageug5op5GIWJFxvFjXEQoCzB6y WWbiK8bPI6jVr7ApzUGZtk0ANpVewZK1VwccISOAzjdECqOasvWB9JGHj486/aIy8Rbm SindTAqmgcRLZUETw/LePFgRteRRtkoCdHw4/lPz0/MksixGWe3Yt1HlpqvOrc5asZ6j oU9w== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530Qix31sy/OAj7V7jA6ebVhNDEN/EAfFd+AlOph6IJkBYgU5CqY AaIIhrsBDcb2c1VM+OVCzyg= X-Google-Smtp-Source: ABdhPJzeA5t/ewbH8+k20rvWWHTpNyj7QD+Zs7m844hDI/qVa7HBGm54k4HFL5p7RK4Nbw66EPrIDw== X-Received: by 2002:a05:600c:2042:: with SMTP id p2mr5917397wmg.152.1610661606850; Thu, 14 Jan 2021 14:00:06 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1c:bb0b:: with SMTP id l11ls868362wmf.0.gmail; Thu, 14 Jan 2021 14:00:04 -0800 (PST) X-Received: by 2002:a7b:c7d3:: with SMTP id z19mr5885376wmk.31.1610661604700; Thu, 14 Jan 2021 14:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610661604; cv=none; d=google.com; s=arc-20160816; b=zP4VRaTT6csGkysL+kTqBBg1fLldxWwH65vCEjPtJm5pNzmxoe05p7UJ2wbLskV7ny 7FGh0Ah8d5CEMPcJJ/ubhxV5X87mu6pdtcG9lagrt0AKvZ0qPfLGPEovQo2LwVOPvcbJ 5E2c3OIZw/PH9xPjkaeGiW4ZHwnUKdBHnPl2a82qEYPTEhI9NTf63ib/VS6KvB6XfMU9 DdZGyT1fDQba1opDbzksDSDfOipgY+vx+BBi3zjFFDa77+Mlb0bLS20/0GdAtvCK+Dkz wbtd5ZMzKrIjdrnLrpFYOF+Tx3Um6k/Ulgp4zNbcyPihFbK3CbUgTWC50hWgt0oXicd0 orlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version; bh=8cF+drfPIlTHYBVBeeszUaG/8NZ1EYg6G7DwlLaWV0g=; b=gcBAVLkaEwnmyivrRj9OmMWio+ynur6Nnd/fv6ZnQksSbG5k4R3zhf3T5Sl13dmt7S DonxjHHpBI0bpzLmn4Nd+6E+21C0o1QPNgVWvErLyuL7i/LHa5Ihf8nBCaIW78XvvdjA 0cAmH/seXMcm3/Z6G8fFN4rM6+ZCE98FVakiXHYGZn90fn9PqgkyvoPzedcIz/wepiNq nivSSAokeg5PohXs8wBMwWysIR/Mwh7hksRZ8p0QNYPPxaMdCGDp/J1cSSbzwJs094D4 CiPhxPzhpOgu2jVkah5Gm3syGrrASPjC+IJfwP2cODdq0brClY6gstK8UlscXm6vZvN7 9tEw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.180 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by gmr-mx.google.com with ESMTPS id s74si295155wme.0.2021.01.14.14.00.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Jan 2021 14:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.180 as permitted sender) client-ip=209.85.208.180; Original-Received: by mail-lj1-f180.google.com with SMTP id n8so8213533ljg.3 for ; Thu, 14 Jan 2021 14:00:04 -0800 (PST) X-Received: by 2002:a2e:501e:: with SMTP id e30mr3852833ljb.387.1610661603882; Thu, 14 Jan 2021 14:00:03 -0800 (PST) In-Reply-To: <7e2c1a91-6cb1-4344-aab5-8577f1b82905n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.180 as permitted sender) smtp.mailfrom=melroch-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:27473 Archived-At: --000000000000c0b8b105b8e36086 Content-Type: text/plain; charset="UTF-8" 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-discuss+unsubscribe-/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/CADAJKhBczM9Li%2BFG_6rWrPnSOCG0Bo6rrPdRFc5poZpNrx8jVw%40mail.gmail.com. --000000000000c0b8b105b8e36086 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You can just return the original table having replaced th= e caption with an empty list in place.

--
Better --help|less than helpless

Den tors 14 jan. 20= 21 13:29Stephan Boltzmann <stephan2boltzmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
Thanks a lot for your hint.

Then I = would still have to fix the return<= /span> statement.

BP schrieb am Donnerstag, 14. Januar 2021 um 11:43:32= UTC+1:
I think you should use `elem.caption =3D {}`

--
Better --help|less than helpless
Den tors 14 jan. 2021 10:41Stephan Boltzmann <stephan2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 w= ithout success:

if FORMAT:match 'latex' then
=C2=A0 function Table (elem)<= br>=C2=A0=C2=A0=C2=A0 --caption =3D elem.caption
=C2=A0=C2=A0=C2=A0 capt= ion =3D elem.c[2] -- caption seems to be second element
=C2=A0=C2=A0=C2= =A0 print(pandoc.utils.stringify(caption))
=C2=A0=C2=A0=C2=A0 --elem.c[2= ] =3D=C2=A0 nil
=C2=A0=C2=A0=C2=A0 --elem.c[2] =3D=C2=A0 pandoc.Str('= ;Test')
=C2=A0=C2=A0=C2=A0 --elem.caption =3D=C2=A0 nil
=C2=A0=C2= =A0=C2=A0 --elem =3D nil
=C2=A0=C2=A0=C2=A0 --return {pandoc.Table(elem.= c)}
=C2=A0=C2=A0=C2=A0 --return {elem}
=C2=A0=C2=A0=C2=A0 --elem:remo= ve(2)
=C2=A0=C2=A0=C2=A0 --table.remove(elem.c,2)
--[[
=C2=A0=C2= =A0=C2=A0 return {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pandoc.Para(pandoc.Str= ('test'))
=C2=A0=C2=A0=C2=A0 }
--]]
=C2=A0=C2=A0=C2=A0 ret= urn {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --pandoc.Table(elem.caption, elem.a= ligns, elem.widths, elem.headers, elem.rows)
=C2=A0=C2=A0=C2=A0 }
=C2= =A0 end
end

The main problem could actually rather be the constructi= on of the table using the function = pandoc.Table in the return statement:
Could no= t 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 pandoc-discus...@googlegr= oups.com.
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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7e2c1a91-6= cb1-4344-aab5-8577f1b82905n%40googlegroups.com.

--
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://group= s.google.com/d/msgid/pandoc-discuss/CADAJKhBczM9Li%2BFG_6rWrPnSOCG0Bo6rrPdR= Fc5poZpNrx8jVw%40mail.gmail.com.
--000000000000c0b8b105b8e36086--