From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32002 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Claudio Di Vita Newsgroups: gmane.text.pandoc Subject: Re: Inaccurate parsing with tex_math_dollars Date: Tue, 17 Jan 2023 06:31:31 -0800 (PST) Message-ID: <747eddbe-d05c-4be4-a622-4db217c2d194n@googlegroups.com> References: <87fsc9xs68.fsf@zeitkraut.de> <87bkmxxn5r.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_17868_951515752.1673965891664" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18309"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDOYFIOXRYHRBRPCTKPAMGQEZ7A2IBA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jan 17 15:31:37 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f60.google.com ([209.85.160.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHmzw-0004ZR-OQ for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 17 Jan 2023 15:31:36 +0100 Original-Received: by mail-oa1-f60.google.com with SMTP id 586e51a60fabf-15ed2fd118esf4355171fac.20 for ; Tue, 17 Jan 2023 06:31:36 -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=iqqfJ3ZHI3ov5rLZpqApt7lAWw6zuJtT3wkOyC5d9U8=; b=n1nezyrCH5dWp8uD57XxkUoNecRE2bI3EZckIQjzVRzYK4B8hLmJszP85whnK5F/aF 4xw+BEa29tAjLgVdUlukadrHlwervDPSz4S5c/grELJYTQ4HTFv35cBAQxdClDeYmfqF FbwHWyv+IDV9+UeMGz2DahN6ozf2+HdBVcQdEUUSsfivdvumBplSVEjYojZsMbHg8UrA YCEqpVXZJv/Zv30uA+l8A7EP0a7J9u9Xijicp/9qGmrFS5TPocW1Ch1EMAygtBnkeFZP 8fVLlfqu93L3nMzhkcCSDovZfvNv5g+xoEGq4qu7L02MkkssAJTirYFh8g7oXNrq9Ok2 hMAQ== 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=iqqfJ3ZHI3ov5rLZpqApt7lAWw6zuJtT3wkOyC5d9U8=; b=natLXu52kRhPg/RT0/t8iEZqfE9Kkn35uQ3NHs7ZhkbebE8rfk4uxfsPI86aGSUehg 26AEIADulnLDRB1IqpdUsiC2FYY0XaXEXhwbU/g/KU5mPqpkW5A8J5TQtg81jxquAqHt pTeycQiJF3CWygf3PiCgD+hUuc/pthfBTvsBFhqa/yAk/cYepH9iwP8WR3u9f1kRWJbe OjtoLrvhjScC2Y4TVzlfh0PgLFjQRYPEIpe5VLk//EeAGZMduUaONI0mTm8Hj50Aun9U Poqj25qM7XiAq1tn/FcHLhnR94JD42DtqfFArtuwkFZkfXPZ38BnFzbNvAEuMmlKpCnF JoSA== 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=iqqfJ3ZHI3ov5rLZpqApt7lAWw6zuJtT3wkOyC5d9U8=; b=3neaIuIfARuzyxZQs7nJMYkoM7uB0tRcFW5QmJhn9EO2qndUcdvcUGh78oWBifMUNQ NBYZIInte2A1JVz1Daqc+SC+qZWe/LNrXVglNksneUZpQPFRQq1Fk5qC/Yp7cgjJ3Bah /6W91CZq4lqEWZ+WhO3TrY1/IbQ+ov0zEKpCqxjVbUVzJztaXj1zceAs0KaX8Wc6Tz43 EOhGPH6LYPbzhaASAhYbdnwKGVa/RoyyczfF+1J8/JtSz6tVj8RXC2TUKDoj9RhQPjpk DFy6TZ50QpjbinO55nsllS56IOSceZ8NrWkM3XZTC28KaZPk1Dod0FVosvPqpT67xYrC M42g== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2kpXlIpomnv34aZKxkUfo89mWraYjIIyVg/e+YeoMHtoyTX5v2KX FqkxhsNIauMcZrq5NYZcbmU= X-Google-Smtp-Source: AMrXdXuAZtJhnBPFxzD3el1uQmTR05qg7f5GlAZT7A5d3NiybxwQMGJGQKel8bgppBajJFwpmpRcnQ== X-Received: by 2002:a05:6870:5788:b0:144:9878:46be with SMTP id i8-20020a056870578800b00144987846bemr294878oap.245.1673965895529; Tue, 17 Jan 2023 06:31:35 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:300d:b0:363:e0a0:2a06 with SMTP id ay13-20020a056808300d00b00363e0a02a06ls5015089oib.8.-pod-prod-gmail; Tue, 17 Jan 2023 06:31:32 -0800 (PST) X-Received: by 2002:a54:4493:0:b0:354:7326:8b07 with SMTP id v19-20020a544493000000b0035473268b07mr160030oiv.43.1673965892450; Tue, 17 Jan 2023 06:31:32 -0800 (PST) In-Reply-To: <87bkmxxn5r.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: claudio.divita-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:32002 Archived-At: ------=_Part_17868_951515752.1673965891664 Content-Type: multipart/alternative; boundary="----=_Part_17869_880237742.1673965891664" ------=_Part_17869_880237742.1673965891664 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable While I can guess that the parsing code is=20 within https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Parsing/Math= .hs,=20 I should learn Haskell to propose an alternative solution. Lua was definitely simpler to learn (or at least to know enough for=20 implementing filters). Cheers, Claudio Il giorno marted=C3=AC 17 gennaio 2023 alle 15:15:39 UTC+1 Albert Krewinkel= ha=20 scritto: > > Claudio Di Vita writes: > > > However I was wondering if the parsing can be fixed/improved. > > My personal opinion is that the current rules for math parsing strike a > nice balance between simplicity and usability. > > But I guess nothing is ever set in stone, and if you have a suggestion > for new set of rules to govern parsing, I for one would be curious to > hear about it. =F0=9F=91=8D > > > Il Mar 17 Gen 2023, 13:27 Albert Krewinkel < > > albert...-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> ha scritto: > > > >=20 > > Claudio Di Vita writes: > >=20 > > > reading the documentation, with the extension tex_math_dollars > > > enabled (that's the default) anything between two $ (or two $$) > > > characters will be treated as TeX math. > > > > > > However, I think that when such extension is enabled, the > > document > > > parsing, including the metadata, is a bit inaccurate, because > > also > > > strings like ${value1}/${value2} are treated like TeX math. > >=20 > > One solution is to backslash escape the dollar characters, as in > >=20 > > \${value1}/\${value2} > >=20 > >=20 > >=20 > > -- > > Albert Krewinkel > > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > >=20 > > -- > > You received this message because you are subscribed to a topic > > in the Google Groups "pandoc-discuss" group. > > To unsubscribe from this topic, visit https://groups.google.com/d > > /topic/pandoc-discuss/V5fTt9aN_AI/unsubscribe. > > To unsubscribe from this group and all its topics, 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/ > > 87fsc9xs68.fsf%40zeitkraut.de. > > > --=20 > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > --=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/747eddbe-d05c-4be4-a622-4db217c2d194n%40googlegroups.com. ------=_Part_17869_880237742.1673965891664 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable While I can guess that the parsing code is within=C2=A0https://github.com/j= gm/pandoc/blob/main/src/Text/Pandoc/Parsing/Math.hs, I should learn Haskell= to propose an alternative solution.

Lua was definitel= y simpler to learn (or at least to know enough for implementing filters).

Cheers,

Claudio
<= br />
Il giorno marted=C3=AC 17 gennaio 2023 alle 15:15:39 UTC+1 Albert Krewink= el ha scritto:
claudio.= ..@gmail.com> writes:

> However I was wondering if the parsing can be fixed/improved.

My personal opinion is that the current rules for math parsing strike a
nice balance between simplicity and usability.

But I guess nothing is ever set in stone, and if you have a suggestion
for new set of rules to govern parsing, I for one would be curious to
hear about it. =F0=9F=91=8D

> Il Mar 17 Gen 2023, 13:27 Albert Krewinkel <
> albert...-9EawChwDxG8hFhg+JK9F0w@public.gmane.org<= /a>> ha scritto:
>
> =20
> Claudio Di Vita <
claudio...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> =20
> > reading the documentation, with the extension tex_math_do= llars
> > enabled (that's the default) anything between two $ (= or two $$)
> > characters will be treated as TeX math.
> >
> > However, I think that when such extension is enabled, the
> document
> > parsing, including the metadata, is a bit inaccurate, bec= ause
> also
> > strings like ${value1}/${value2} are treated like TeX mat= h.
> =20
> One solution is to backslash escape the dollar characters, as = in
> =20
> =C2=A0 =C2=A0 \${value1}/\${value2}
> =20
> =20
> =20
> --
> Albert Krewinkel
> GPG: 8eed e3e2 e8c5 6f18 81fe=C2=A0 e836 388d c0b2 1f63 1124
> =20
> --
> You received this message because you are subscribed to a topi= c
> in the Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d
> /topic/pandoc-discuss/V5fTt9aN_AI/unsubscribe.
> To unsubscribe from this group and all its topics, send an ema= il
> to pandoc-discus...= @googlegroups.com.
> To view this discussion on the web visit https://
> groups.google.com/d/msgid/pandoc-discuss/
> 87fsc9xs68.fsf%40zeitkraut.de.


--=20
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
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/747eddbe-d05c-4be4-a622-4db217c2d194n%40googlegroups.= com.
------=_Part_17869_880237742.1673965891664-- ------=_Part_17868_951515752.1673965891664--