From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30074 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: bapt a Newsgroups: gmane.text.pandoc Subject: Extracting all equations (dropping the rest) Date: Sat, 29 Jan 2022 14:36:27 -0800 (PST) Message-ID: <235047d3-c000-4adb-8d61-e5b905475cc4n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2090_1734254864.1643495787649" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2980"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDG3FYUYQUCBB3EC26HQMGQENN6M5IY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 29 23:36:31 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f57.google.com ([209.85.210.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nDwKd-0000Zw-CX for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 29 Jan 2022 23:36:31 +0100 Original-Received: by mail-ot1-f57.google.com with SMTP id p17-20020a0568301d5100b005a3cd7c1e0bsf1800067oth.7 for ; Sat, 29 Jan 2022 14:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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=yHTX4CTby4qcRUxs34dYTJAQXd6JgwOqUWeBD9DFOVg=; b=EhaCs6+jPeqvPYVh5GwIchmShHODlzg5QbTJK1SnVGWqwHn499ONpmUewA+Lgzae2x QHxntZsqsD789GDXobBKdsol+Ry5dWuJWn0rPkgji6w484reJMFK84EQTKR9Z4+MIxD7 pKR7J6P8GP8wVGAgZ52OolSP9uL38zBYx6kQDrVY2+EiakCBQX8iRFp7l7exUhYEH34f 2bH7Bdv4xvKgNER/wIz3sQ4+Qk/+UEoqLGzdb2hBv8VnmJn/CxbxMQ87hwFCpNyAF0/g 3GQ0VVtzPOfHgeafA6SLPlU4PIBl77vBkvMSHi7FxUrsomRw62GlzUPlEYrXfp1qDBwN kTCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=yHTX4CTby4qcRUxs34dYTJAQXd6JgwOqUWeBD9DFOVg=; b=pzkZfBhquHL3aE8tyed84ajfU88yKrh00qsoi1eGdRtP9QQQpw5rBm01IyghiDEH55 /YoQSX70ZXioWutp6LbkYXbimdt7//p7ZSjS3w4px+QMjeL0yw/NEskcwZtas5NkbnBO qo+qpv+TRAPv1PetX1IMreym6Np59z3/DxY+RS7oIbEwhkwXPDhG9dG8JvOUkNeioU+H w5rxiUxVf9U98N0Rd6zJIOZn77lrikla/I9ZqHeptjb2cp0ReEpMSUJrvzq6ITl/OriJ S1Kou8diviT9OhUsuckSu90gNbyLRuK3JL6UUWH/0vjwDpX+j/VF97m4EF88jQXMa0B1 fncg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yHTX4CTby4qcRUxs34dYTJAQXd6JgwOqUWeBD9DFOVg=; b=VypsYVJ6xQUNV2NWe5xAjLRYHle+KMNwclXSXyiy4FzsppfATUsT84v6fqw2nf6Ups jDlCxRkKbtyujvqQE1FZs09uxexeu36ikAXTtTb/nxSex89PX3d2JhbcYudLTy9kpFaH MX+Hfrc7+miZ7H8p2HsjGkVzxj1L1TYIefs9RM+UULvG/TObgl+YX4wIWmrF4KoyZRIR bvnAna+r0YldhQ/C7/UyYg3rfGQDAezR+QmpScII1UdJAyMmroy1nmxcu/ezgJsdqRBA q55ExGolL5kCHkHwRQdUrFFZkYkMjgHVCI1dVb+Ho/qD14laxppfOXdLwWJ8lnFhSmvv A2VA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532sxWCrA6GnHvn37o+zQbQzbQfxErUxsC3tCOIoE71B+JjHpMc4 eCUbbAx/XZP8B9pSQRqEj2c= X-Google-Smtp-Source: ABdhPJyvFJ2HqcUAsJqqGLX6H4BHrEy9ZqvDJvcmFBT+Ktf8Ke4PgrYeeYWYps6B0rupD8ab3zeP+w== X-Received: by 2002:a9d:4d08:: with SMTP id n8mr7998891otf.16.1643495790141; Sat, 29 Jan 2022 14:36:30 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:e84:: with SMTP id k4ls5123128oil.9.gmail; Sat, 29 Jan 2022 14:36:28 -0800 (PST) X-Received: by 2002:a05:6808:1881:: with SMTP id bi1mr13916179oib.56.1643495788236; Sat, 29 Jan 2022 14:36:28 -0800 (PST) X-Original-Sender: auguieba-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:30074 Archived-At: ------=_Part_2090_1734254864.1643495787649 Content-Type: multipart/alternative; boundary="----=_Part_2091_1196416984.1643495787649" ------=_Part_2091_1196416984.1643495787649 Content-Type: text/plain; charset="UTF-8" Hi, I'm hoping to extract all equations from a latex document with a Lua filter, but I'm not having any luck. Adapting an existing example I thought this might work, function Pandoc(doc) local hblocks = {} for i,el in pairs(doc.blocks) do if (el.t == "Math" ) then table.insert(hblocks, el) end end return pandoc.Pandoc(hblocks, doc.meta) end but nothing is returned, unfortunately. I also found this idea, https://stackoverflow.com/a/39963980 but it uses json (via Haskell) filters and I'd prefer something more portable with Lua. Many thanks for any pointers, baptiste -- 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/235047d3-c000-4adb-8d61-e5b905475cc4n%40googlegroups.com. ------=_Part_2091_1196416984.1643495787649 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'm hoping to extract all equations from = a latex document with a Lua filter, but I'm not having any luck.
=
Adapting an existing example I thought this might work,

=
function = Pandoc(doc)
= local hblo= cks =3D {}
if (el.t =3D=3D "Ma= th" ) then
table.insert(hblo= cks, el)
= end
end
return pandoc.Pandoc(hblocks, doc.meta)
end

but nothing is returned, unfortunately. = I also found this idea, https://stackoverflow.com/a/39963980

but it uses json (via Haskell) filters an= d I'd prefer something more portable with Lua.

Many thanks for any pointers,

baptiste





--
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/235047d3-c000-4adb-8d61-e5b905475cc4n%40googlegroups.= com.
------=_Part_2091_1196416984.1643495787649-- ------=_Part_2090_1734254864.1643495787649--