From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31763 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: bapt a Newsgroups: gmane.text.pandoc Subject: Re: custom LaTeX writer example Date: Wed, 16 Nov 2022 11:13:25 -0800 (PST) Message-ID: References: <34e5e93b-8832-40d3-8803-8e5a12b5290an@googlegroups.com> <493DA04D-5B8D-4D3A-8A26-35A8A34E64AB@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3230_1645369136.1668626005098" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13157"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDG3FYUYQUCBBVXM2SNQMGQEDMCS66Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Nov 16 20:13:30 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f64.google.com ([209.85.210.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ovNqj-0003GF-TC for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 16 Nov 2022 20:13:29 +0100 Original-Received: by mail-ot1-f64.google.com with SMTP id s5-20020a9d7585000000b0066c7a3ddf59sf9346988otk.13 for ; Wed, 16 Nov 2022 11:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=0vMqutpHi8+sUtERgd8M5o4Bj5sMApzq8HnIyCkufL8=; b=VzIap5hHDe5wulizuGAYWVQMyox0jDXlt2WV8IfND0+PgDFoFTJgFcxoTaUlfeuL+E c4Y4Gik4YUe6iiVkmqHaAsYeVq+zV+Zrxh6m+6Rf3uk164kAG214cF+H1Rm4UfaaNveV U6jg2gaP9fQFTVbTRlQ0IiWZWCvlTL5L4C4g8Fg8+mB0l68tU9NBvSwh/fOcYZAfwGEX DVubHl2QDb5gCiK0V/9TP/s8GqwkV+b224aRCnbX/nt6LBSe/Z4JLfLV1UmP/Gdw6UI0 vNxQU9Gng7xer8MkrIgVMSL6T692JHnADHqlIhZ2IqwKfO4FEjPaGDU6PhEKVaFLkgQv P3rg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=0vMqutpHi8+sUtERgd8M5o4Bj5sMApzq8HnIyCkufL8=; b=WX7sdoAeA6zg+V60eoj2A91ZbZxtIqVgIk9jIMwvWq4dr+wdhD+fiYzBoOT9XcsE/D c3burPTHZhVxPKm+fT43iJL8aT5jYKnMv0oyE6KS27BdcQ+BK/UZSnPrcscg3Igd+Gju YF42KK/y4Zjc6W5nv7Mpm5c7nZ9wdLpXlcdlEQH4Zd28iCYsMGYxXg+iJCfSfOgVc+on lwXRU1X+KPQ7nx+9n6lf0Y4j+QllfI4snzMXW5Q0amOe0aqylIQFHiI7s+iZeeB5fobR G+pRyYJMvL2IbpeJHliXgqCICw+bHx5Z+SQ3l1B2ep/uSvZnrhah3emtp/coFcBjZck0 +43Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=0vMqutpHi8+sUtERgd8M5o4Bj5sMApzq8HnIyCkufL8=; b=beGt9yAJx+6L8fcTCiMQfXMfYBFvQn1OHG3lSs0tiK6RO4MQv0iBszN8DK9JjgCND3 LoVozOwnUbfFPgDMW9hRV9HmVlPQ4N/eqLofpArGhYzonyC09vyomzLGmBb32dzoH3q/ DqNUit1C4HoDLJhTgc0ac4qqu3GqJljTFr7CnyfKHK/a44/0vIt4rGpBZckrqTOHBIvP EPUekZmeX2jDKFOAp3szyLig5w7mWfcFWlYaJDHwu1fD+FhjPvdcuwkZSUA+yD/oEK59 AijU7uuIMPJ1WuRdkJLlGwUiAg9cexacp8gjw8YTrX/ya3u/fwD0PNR8DYpWYWoO18M7 SGQg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pkawhviNeXYhMSCbzH9WjGZp1JEWleBbXJSgnH3np5OBBbhUBO4 H3hjZVTshJLGzduDjLcuskQ= X-Google-Smtp-Source: AA0mqf62PX1wZ9dedUwUr9/l1Va1SwSeR/hMuz0+OW7K2cRYtEeSX/jZAtf/P9Stplq2YHxh9APrjw== X-Received: by 2002:a9d:66c7:0:b0:66c:5613:e633 with SMTP id t7-20020a9d66c7000000b0066c5613e633mr11855508otm.113.1668626008832; Wed, 16 Nov 2022 11:13:28 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:5b01:b0:132:4cb:dd6 with SMTP id ds1-20020a0568705b0100b0013204cb0dd6ls6454533oab.2.-pod-prod-gmail; Wed, 16 Nov 2022 11:13:26 -0800 (PST) X-Received: by 2002:a05:6870:788d:b0:13d:611e:cde9 with SMTP id hc13-20020a056870788d00b0013d611ecde9mr2637648oab.25.1668626005846; Wed, 16 Nov 2022 11:13:25 -0800 (PST) In-Reply-To: <493DA04D-5B8D-4D3A-8A26-35A8A34E64AB-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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:31763 Archived-At: ------=_Part_3230_1645369136.1668626005098 Content-Type: multipart/alternative; boundary="----=_Part_3231_1457910592.1668626005098" ------=_Part_3231_1457910592.1668626005098 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks =E2=80=93 it does seem ideal; I wasn't sure from the description if = one=20 could only include the targets to be replaced from an existing format, or= =20 if everything had to be included to be a valid writer. I think I'll start with a simpler case, because Tables seem too advanced=20 for my level of understanding. Best, baptiste On Wednesday, 16 November 2022 at 08:48:07 UTC+13 fiddlosopher wrote: > I'd recommend using a "new style" writer and just replacing the code that= =20 > formats tables. > > https://pandoc.org/custom-writers.html#new-style > > > > > On Nov 14, 2022, at 7:30 PM, bapt a wrote: > >=20 > > Hi, > >=20 > > I'm hoping to play around with custom writers, to understand a bit=20 > better how to turn pandoc's AST into a specific output format (for exampl= e,=20 > I'd like to use tabularray syntax for tables in LaTeX, and it seems=20 > "cleaner" to use a writer than to inject raw inline LaTeX via a filter in= to=20 > the AST). The html writer example is quite useful, but since I'm aiming f= or=20 > LaTeX output, it would be helpful to have something a little closer in=20 > syntax as a starting point. > >=20 > > I searched a bit and the closest thing I could find was a plain TeX=20 > writer at https://github.com/drehak/pandoc-to-markdown > > but this is perhaps not as helpful for learning because most of the=20 > magic seems to be delegated to custom TeX macros. (A good strategy, but I= =20 > wouldn't know (La)TeX well enough to perform some of the more complex=20 > processing) > >=20 > > I wonder if someone here has a minimal (or complete!) example of a=20 > custom Lua writer for LaTeX they could share? > >=20 > > Many thanks, > >=20 > > baptiste > >=20 > > --=20 > > You received this message because you are subscribed to the Google=20 > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/34e5e93b-8832-40d3-8803-= 8e5a12b5290an%40googlegroups.com > . > > --=20 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 e= mail 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/a327ba5a-21fe-4cae-85e5-4ce1c323154an%40googlegroups.com. ------=_Part_3231_1457910592.1668626005098 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks =E2=80=93 it does seem ideal; I wasn't sure from the descriptio= n if one could only include the targets to be replaced from an existing for= mat, or if everything had to be included to be a valid writer.
I think I'll start with a simpler case, because Tables seem to= o advanced for my level of understanding.

Best= ,

baptiste

On Wednesday, 16 November 2022 at 0= 8:48:07 UTC+13 fiddlosopher wrote:
I'd recommend using a "new style" write= r and just replacing the code that formats tables.

https://pandoc.org/custom-writers.html#new-style



> On Nov 14, 2022, at 7:30 PM, bapt a <augu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>=20
> Hi,
>=20
> I'm hoping to play around with custom writers, to understand a= bit better how to turn pandoc's AST into a specific output format (for= example, I'd like to use tabularray syntax for tables in LaTeX, and it= seems "cleaner" to use a writer than to inject raw inline LaTeX = via a filter into the AST). The html writer example is quite useful, but si= nce I'm aiming for LaTeX output, it would be helpful to have something = a little closer in syntax as a starting point.
>=20
> I searched a bit and the closest thing I could find was a plain Te= X writer at https://github.com/drehak/pandoc-to-markdown
> but this is perhaps not as helpful for learning because most of th= e magic seems to be delegated to custom TeX macros. (A good strategy, but I= wouldn't know (La)TeX well enough to perform some of the more complex = processing)
>=20
> I wonder if someone here has a minimal (or complete!) example of a= custom Lua writer for LaTeX they could share?
>=20
> Many thanks,
>=20
> baptiste
>=20
> --=20
> 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..= .@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/34e5e93= b-8832-40d3-8803-8e5a12b5290an%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/a327ba5a-21fe-4cae-85e5-4ce1c323154an%40googlegroups.= com.
------=_Part_3231_1457910592.1668626005098-- ------=_Part_3230_1645369136.1668626005098--