From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27461 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephan Boltzmann Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to remove captions from tables Date: Thu, 14 Jan 2021 04:28:20 -0800 (PST) Message-ID: <7e2c1a91-6cb1-4344-aab5-8577f1b82905n@googlegroups.com> References: <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_504_931053229.1610627300892" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8126"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCZ25UWY24ERBZXRQCAAMGQE4K65DVY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 14 13:28:25 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 1l01jk-0001x9-Gn for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 14 Jan 2021 13:28:24 +0100 Original-Received: by mail-oi1-f190.google.com with SMTP id l23sf2359323oii.3 for ; Thu, 14 Jan 2021 04:28:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=bUZFgFCGj19JcS3QwCS/MfjAXLd/Mcvty7axEBmWDSI=; b=Pe45Xm7NsZV9vaYv4lKHZ9EVV0nxQ2a/t1NfqeM/oQVCFnlD7MmtvPeRmnWZLl6yb6 DSmPS0aWJ68VpNtCUjx5tADs59XxRprilXc2Ly9s6D3cJC40hScOzzTrHj+ZHqVneHFH YPHQ1w6qK3Wb56776FVDSwGjAZCLAFI+zGWS0YmKUARbKjgQRl02p1798/62uVe33nuo PKTP8ZAuQbDfH0XGpkkWimMRTsBcqFDAGCSO5hfh6VGM578p3ZCTULythOPmA6+dwBQf zTsy6MNxYymdORyfH2Yuk5qW0fJzzhUKrGv9Za4RqAZV7xkMQB/z60aACJyLj08KnLsE dkAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=bUZFgFCGj19JcS3QwCS/MfjAXLd/Mcvty7axEBmWDSI=; b=DIJHnGOFaxQVEh2JMWKUzkyXe0A69EIiVYcsxsyXHSZlbs71nTsL5V8ZdXtmoX41BL W3luariAHxwO28TA5oDS/IN8/OJ6brGDQ0jE6Q9iJrYnAZuULiZRr33Ndhy2dbqTw5+h i1u2+13Kq3x2icjRgNs83yC6lp7fz4bkQAPCfrWqJnrsiMEYJKhEPbznyg/P+RjkJDt/ QzU8OKwp4wh5D8aq171fyiqI1Oh1zGT4xbH6hxXALZF2hFi7WBcsTIZxrqSevFmSzIfV o05WTvc9BxazXX9UZmB+9Q+dfx/8pScnF/pn2g3I7i1v11LVrbL7YNBK28bLcgYaByQ3 IAGw== 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:in-reply-to :references: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=bUZFgFCGj19JcS3QwCS/MfjAXLd/Mcvty7axEBmWDSI=; b=Nh9QaRP+FJ5BtCvZKQC2TrhbO3Zdq8qxyeQ9ur90KBN9G70lJEivMdl3kFejfDXFQo 89oF25/J7Uh62d16fW7qckhT0hDNc6Unm4oFvDa89wRdn0iDWn/8AFXMTQssMZA9SMkW hj/U9yMSch1Zer4e9R+gE9XOpyPrEQE7+28xy/6aw54uh7ABAIUWwawWxd5poixDZLXc LLAIuyuVwu++FFi7CIJXbcrj7K2HnadgxErLypXomy6/I/XnBSgYZ/IyC4NmqymBj9yk xJZX6//IlEzwPty/wavR9uCQr1vFaezuYUGRKFYWaFQatO6C9x8NUY2hxGSF8n0xGRTt 9FCQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532xIa/OqMNJBjPneRw3Di7R/7xH3c0gXISil5j4STF4GR4fu+N8 Bbn5pJfGvNKmK5vla1y3Jfw= X-Google-Smtp-Source: ABdhPJziFfSpLIAJnzmey+mUEb/HT/6nL3FtztUwpKdY7ECWLzbaSGfgz6RXRlDr0s0Q5YYWK/KPzA== X-Received: by 2002:a54:4881:: with SMTP id r1mr2321235oic.9.1610627303524; Thu, 14 Jan 2021 04:28:23 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:7ce:: with SMTP id f14ls1334926oij.5.gmail; Thu, 14 Jan 2021 04:28:22 -0800 (PST) X-Received: by 2002:aca:f5d3:: with SMTP id t202mr2412865oih.25.1610627301840; Thu, 14 Jan 2021 04:28:21 -0800 (PST) In-Reply-To: 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:27461 Archived-At: ------=_Part_504_931053229.1610627300892 Content-Type: multipart/alternative; boundary="----=_Part_505_283782888.1610627300892" ------=_Part_505_283782888.1610627300892 Content-Type: text/plain; charset="UTF-8" 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. ------=_Part_505_283782888.1610627300892 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks a lot for your hint.

Then I would stil= l have to fix the return s= tatement.

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> s= krev:
Hello everybody out there using Pandoc,

I= would like to remove the caption from tables in PDF output and tried a cou= ple of things without success:

if FORMAT:match 'latex' then
=C2=A0 functio= n Table (elem)
=C2=A0=C2=A0=C2=A0 --caption =3D elem.caption
=C2=A0= =C2=A0=C2=A0 caption =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:remove(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 pan= doc.Para(pandoc.Str('test'))
=C2=A0=C2=A0=C2=A0 }
--]]
=C2= =A0=C2=A0=C2=A0 return {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --pandoc.Table(e= lem.caption, elem.aligns, elem.widths, elem.headers, elem.rows)
=C2=A0= =C2=A0=C2=A0 }
=C2=A0 end
end

The main problem could actually rat= her 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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus= ...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-dis= cuss/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 pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
------=_Part_505_283782888.1610627300892-- ------=_Part_504_931053229.1610627300892--