From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31813 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Filter help: apply LaTeX command to words matching pattern Date: Mon, 28 Nov 2022 20:07:44 +0000 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36241"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBE5KSSOAMGQEIRMFGHY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Nov 28 21:07:53 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f59.google.com ([209.85.167.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ozkPx-0009JA-Jw for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 28 Nov 2022 21:07:53 +0100 Original-Received: by mail-lf1-f59.google.com with SMTP id l7-20020a19c207000000b004a471b5cbabsf4322599lfc.18 for ; Mon, 28 Nov 2022 12:07:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669666073; cv=pass; d=google.com; s=arc-20160816; b=R1+6M8vEOL4VuWFWO4mqzjH/BUkCdw30ePQAsq24EZma7qnaeKdqWDGBGF/p5nSBS3 Dk1WTRaDVDBwQHMheKooZVeW64VAWkF/+k45O4+n+xm+GOgTDBXSmIVzk5ITh0+y/v9S DtKK3eUvH9rJIwS5qBQfFpVW/MF9E8EuYlxRWqP2RpnWFdo84CDHzakFMq6RWIbqZCIt GyHL1a10iJgtFzycegt6wlcAPOCsWbHMNey/5QIm5wgIH+4XRad7cPI7S4FhCSQGIV// PF6+2ABsEhyjW7gSZjYpv0lwVigiSudb+bvV+9lw4AM91dF6fGAGRTDhjSjYO1jKlLt5 /5/A== 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:reply-to:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=2RCs5oK6qDAil3HryWtoNfL0KprDai+SjNsw37ZdeuI=; b=TjQZXMfz+3olMwwwiGe6jyWtvaYrHxHmQPwckbCtxCfZa9XP35d5uvQDTGdvHEQA1z im6wpgVFm6dm6Aoe8P3ifdcSLq7gD+onm/lLz62/XMgYjosjPkUs8eOP60+qOCTRjec1 z7LbByaigTtBDgEaNCekBD7t4DWdRCHZwWia2g0pD72wt+eb1zMXGTBPsi81x/lUutZN y36cDRCSPyHeFUcOkhAZmV7nPfe1xu1fbvMpT/9+FE8bP88vjmDfCulkgaPMOD4kXb8/ N7gjYcuNmYn4Es9kXtPZQkXcK3OyLglduJV1RoF8FTV30qMP1JKIjJqPD23ufrGfwqVw U5kQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=rwLklcpu; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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-authentication-results:x-original-sender:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=2RCs5oK6qDAil3HryWtoNfL0KprDai+SjNsw37ZdeuI=; b=WF5+O3vjqBFjtNgARKSccVPKnzUPX9ASu5hlqHQONB42kUWNebgEnvStUxFZvr2nlh iPr9BmmfMoEiW+V1T9GghVkiEOrU/BizIdzAE8BaDASbL1xnMm97PbUUILAT/OLaixtU 3jPaUYfPasbBTQpzv3PJLUTj70F0CAOW7PmOuOKkg6CLxMBSJe0d+3zrCHX/o+/GCKkz lnXeaosnfQycE0qQ8UEqoTx+wVeECMJ/Sm9RFWHD3fpbTQFKz4Y+E6rmR0/PRxbe3+/T GWzGuuMiJ4bzpe5xhZQ7VUJC0WHuZMhobqBKdTS0hUFR0 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-authentication-results:x-original-sender:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=2RCs5oK6qDAil3HryWtoNfL0KprDai+SjNsw37ZdeuI=; b=3o+uLc4tCewvodeSDD2i9Fp1GaLCuJUBpKOq7t22yv27wbnktN75a5s3fIBLRFU8o9 ETZo9vNa4Zonee3bOwiPtQa3pPdlPAT4PUCaH6zphhgqZPV5dU+yPmaeJKFIe48uIepG 728iOmYy5p97vmqEHVIOS210V7suS23ByDvKCqxZoRNLPOc34PUKEGLW2RMY3ZJFK62x h8UOCirGOsN3UxEBdky2NpCehsujPV1Vg/Lq3qZkDfogyYRySkBIQIzRASS4tBay6crY Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pnlZ++k6lNoyPxOl3g2cEpSYDQc9iIt24AEXY06lzgHvBJtzbd+ nFbjYwJsA0wqcIPVjA3/Xfg= X-Google-Smtp-Source: AA0mqf4psoNSxL6w2oaNcq9qCsZbJ5tVrU0szSw8PieIj4cy8BO6sGCBiQiKxezVJcH0n7ATyxPe8Q== X-Received: by 2002:a19:c506:0:b0:4b1:c15c:126c with SMTP id w6-20020a19c506000000b004b1c15c126cmr12428276lfe.8.1669666072100; Mon, 28 Nov 2022 12:07:52 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:741:b0:49a:b814:856d with SMTP id c1-20020a056512074100b0049ab814856dls1917025lfs.1.-pod-prod-gmail; Mon, 28 Nov 2022 12:07:46 -0800 (PST) X-Received: by 2002:a05:6512:2989:b0:4b1:753b:e677 with SMTP id du9-20020a056512298900b004b1753be677mr16989709lfb.407.1669666066839; Mon, 28 Nov 2022 12:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669666066; cv=none; d=google.com; s=arc-20160816; b=YGe0xO6gAcoMtw380LKJwpbHWcN3NN4gK+onAig9aTd6kSpfCKq+vVEKHAh8zBjtZS ojtafLHrS3EoRkIBQrv8T3eSkVrY8818p48A7gnB3ioaiwO70D6JC7xWi4hPNWl2/KWJ VBwwrFMiFi0genafaPUh8jxNFXzl/1H7wixz5R8UxePNCZA82vlUbvYKWStKFG9Zw0xJ iPbnIy9cLuXoGSE+KD9wkCsNZDuiLZVAcc+QlsrngGJx9dHQ2+CP400FMFQozd3RjfIQ gijK8nZS1V1V91G15HQa92S8fKXbeUrR2A1boPGtIXV/rL9vw3HRSyzpkNObyx6NkRdB C/HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=I9BlM2plDtPVzjjHmDlQI6xNfureK0DpLSWbrUu/B8M=; b=tW4mIptt7cfg1oPEBm4YHmpSlNr0EJeptWSg4rzpk4bcoXzHMb4AygpW01yrSHtfYy xkwXVTG4W2Uhv3woeZWWd6uQN6TPbSG05Fi5S+gdkJpPvJC9JP+37L7BP+AC+ojbm8cD XPdrijMqtPUKAJve1aFXWyIe0Ja+szKdOYcpczVVaJz0pAFG+iLkrsoRWHZaEjcZVfK5 O3u8auRK0gKU5D70DOUbQ4K+ei+kLq5oDlxqngAPUfW7HtycLWWihuLju6TmB/vni3xi FZITiEnwbe5QdUtJISEQioXv9ik2adbqLOrKwNMnwUpQJ9k9hzs7MBLitXi5/HVazdue r0MA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=rwLklcpu; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id u15-20020a05651c130f00b0027976ad74c9si601528lja.5.2022.11.28.12.07.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 12:07:46 -0800 (PST) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 39D3A240028 for ; Mon, 28 Nov 2022 21:07:46 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NLc2n5JW9z6tpY for ; Mon, 28 Nov 2022 21:07:45 +0100 (CET) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=rwLklcpu; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:31813 Archived-At: You have to insert the LaTeX code as RawInlines and to return a table of In= lines containing them. For instance: ``` local should_be_lining(str) -- returns true if str.text matches one of the patterns end function Str(str) if should_be_lining(str) then return { pandoc.RawInline('latex', '\\liningnums{'), str, pandoc.RawInl= ine('latex', '}') } end end ``` Le Monday 28 November 2022 =C3=A0 02:53:48PM, Adin Klotz a =C3=A9crit : > Background: I like the look of old-style numerals in text, but they look = bad in > acronyms or other all-caps blocks, so I=E2=80=99d like to switch to linin= g numerals > there. I couldn=E2=80=99t find an all-LaTeX way to do this so simplest wa= y seemed to be > a filter. I want to match words containing and only containing capital le= tters > and numbers and surround them with \liningnums{} >=20 > For example: > NUMBER1 -> \liningnums{NUMBER1} > 2022 -> 2022 > A1B2C3 -> \liningnums{A1B2C3} > A1b2c3 -> A1b2c3 >=20 > I=E2=80=99ve played around a bit but don=E2=80=99t know enough Lua or Pan= doc internals to get > there. I have patterns to check the words but haven=E2=80=99t managed to = successfully > add the latex macro. Can someone point me in the right direction? >=20 > Thanks! >=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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [2]https://groups.google.com/d/m= sgid/ > pandoc-discuss/ > CAFy2Trs7g%2B84uDfLAYOa%2BFZm7YmXfwCUiFiTbcCwyN56KEv8nQ%40mail.gmail.com. >=20 > References: >=20 > [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [2] https://groups.google.com/d/msgid/pandoc-discuss/CAFy2Trs7g%2B84uDfLA= YOa%2BFZm7YmXfwCUiFiTbcCwyN56KEv8nQ%40mail.gmail.com?utm_medium=3Demail&utm= _source=3Dfooter --=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/Y4UVEL2T%2BNlv53bi%40localhost.