From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32081 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, 24 Jan 2023 09:11:40 -0800 (PST) Message-ID: References: <6599e581-5fc3-4a77-8be1-d6d962d54600n@googlegroups.com> <87y1psj8ie.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2012_1440937407.1674580300064" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31045"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDOYFIOXRYHRBTNCYCPAMGQEX4EJ6YA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jan 24 18:11:45 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f56.google.com ([209.85.160.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pKMpk-0007rW-OH for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 24 Jan 2023 18:11:44 +0100 Original-Received: by mail-oa1-f56.google.com with SMTP id 586e51a60fabf-15f8ddf4db1sf6510623fac.10 for ; Tue, 24 Jan 2023 09:11:44 -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=2Fn3eDMezPyh5TtNE2beY1sfdZyXNn+XQGNyvKVsnqE=; b=JfmtliAyez5mwReC0+W3OiSTYNXci2oCFERseU9/gi+0chOkcqRjE/gt64VCSzGgkl GV77+DPNzjzTufzZIFwHLyf3o7Lse+6c04EAtDrsk6r7G8SFgmsiNtTM/Sg0C5zA5Qsz Hx03ZDhY5hpu4Z9Wzk9SYeRp0AkkfYVbtYRji+QWJvqTks828WZ6cXDrITCOUJT7cpIm QIK6ZZra8FU5AlB/3WEP6kdMF3z0hsvdHgA+e5YPEYBVTgqDS4sX4Ya2NanKgnvmGIPU tP2n1SBxN0PrZ4JCRxZglFW/qJ6AoeecO5Z2SQI/Jr08k7j4J+BKdSZLiFOOsctgkgVL q55w== 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=2Fn3eDMezPyh5TtNE2beY1sfdZyXNn+XQGNyvKVsnqE=; b=QREUjqXLFuGGGFCF4RhPGZ7go2HdUpdCem/xh8/csO7yOjQ0VgjjJuCnwQf+mIvehz 3Wt4dZM27LM6B9qII/ceF3rRhKzY7m7PeE5ZeYCVY1kbtkj5xI8F5r8UC0pSelvu2ZnS z4CR5zd7M8M3pi4QfuLTNcDdY0EknLOFflWJCvh3k4IfIcfUOSoHC6gAs1Ip3Enbc3dT Ofrij4nF6Ye2i3xw4QLABkVEA2/N3yXj4eg1Z9CS6fwhWfCfFWjxBcaSczjCIjtiwFgf rBlInzXbWMVC03u+MjVksK1r+HpBeNoHRhRkZ90OBFCFiva9s3xnvFm+ZjeLnPU5kXh6 QdOQ== 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=2Fn3eDMezPyh5TtNE2beY1sfdZyXNn+XQGNyvKVsnqE=; b=i1h6E6tVpsW6wnEACqs2W5cS2o0PPDXFvagDHm8YI8hG4/xaZHNzxBvSQIgHp3fckj 9DPyydOx15wkPhcQO9IDisKU8ki3+u3yfS+UJHEpQs80sJ8hKWJ6cV5IQ9Zo5cQwv5Ra BJ3ehoIn/0kxpp6YwXvjkyF8Rwd/bMRPXKVLQ7X9o1BhudGQaPW5cdPf0iysO3v0MHwH UWEj4ajs6pXObzDxsxPClWPgmOlgOp3RssknWAEVQdWaf/Vo9LR0WJFnpwHihiz1JBPS F9RKXwEgsqk3Hwr9/m9OpFoXpDlnP912sF9yrYE5cY/eJrCsj9uZlIyKdxh3rwwPI6zT DveQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2kqfA3/zJ9JpAZOFNDsfQrE7OGav2hFVoMzEEZ9YzFuy/hVe6o8B iuvBMg1xwuADgPTxRwGTS8c= X-Google-Smtp-Source: AMrXdXv/Cyx0dFLbjI8K+5Ca/lAcpq9bVT/EiMY+tdvZY7569GX4MFtmcWigfOdJ2+SmUMoQyhFpkA== X-Received: by 2002:a9d:700f:0:b0:686:b3ef:59aa with SMTP id k15-20020a9d700f000000b00686b3ef59aamr1128245otj.368.1674580303523; Tue, 24 Jan 2023 09:11:43 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:13d3:b0:66c:e766:8d07 with SMTP id e19-20020a05683013d300b0066ce7668d07ls3104571otq.10.-pod-prod-gmail; Tue, 24 Jan 2023 09:11:41 -0800 (PST) X-Received: by 2002:a05:6830:1f48:b0:686:4f03:2bc with SMTP id u8-20020a0568301f4800b006864f0302bcmr1432233oth.207.1674580300889; Tue, 24 Jan 2023 09:11:40 -0800 (PST) In-Reply-To: <87y1psj8ie.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:32081 Archived-At: ------=_Part_2012_1440937407.1674580300064 Content-Type: multipart/alternative; boundary="----=_Part_2013_1977196110.1674580300064" ------=_Part_2013_1977196110.1674580300064 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Albert, it works, thanks for the support. The documentation is clear now, I guess that it was more concise for pandoc= =20 2.x. Moreover, I started my filter implementation looking at the=20 include-files filter, that doesn't seem to care about the current=20 extensions configuration. Cheers, Claudio Il giorno marted=C3=AC 24 gennaio 2023 alle 15:46:12 UTC+1 Albert Krewinkel= ha=20 scritto: > > Claudio Di Vita writes: > > > Confirmed: when tex_math_dollars is disabled pandoc doesn't create > > Math elements, while under the same conditions (inheriting > > PANDOC_READER_OPTIONS) pandoc.read create Math elements for the same > > document. > > That's a problem in the docs: it should be noted more clearly that the > format extensions are taken from the format, not from the ReaderOptions. > Try with > > pandoc.read('$2^a$', 'markdown-tex_math_dollars') > > or (with pandoc 3) > > md =3D { > format =3D 'markdown', > extensions =3D {tex_math_dollars =3D 'disable'} > } > pandoc.read('$a$', md) > > > Il giorno marted=C3=AC 17 gennaio 2023 alle 09:58:14 UTC+1 Claudio Di V= ita > > ha scritto: > > > > Hi folks, > >=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. > >=20 > > 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 > > Of course disabling the extension or escaping the $ characters > > there are no issues, but it would be nice to avoid that, if > > possible. > >=20 > > Any idea of what can be the wrong parsing cause ? > >=20 > > Cheers, > >=20 > > Claudio > > > --=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/a05750c3-a66c-44ff-a4c5-1434378aea0dn%40googlegroups.com. ------=_Part_2013_1977196110.1674580300064 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Albert,

it works, thanks for the support.

The documentation is clear now, I guess that it was more = concise for pandoc 2.x. Moreover, I started my filter implementation lookin= g at the include-files filter, that doesn't seem to care about the current = extensions configuration.

Cheers,

Claudio

Il giorno marted=C3=AC 24 gennaio 2023 alle = 15:46:12 UTC+1 Albert Krewinkel ha scritto:

Claudio Di Vita <claudio.= ..@gmail.com> writes:

> Confirmed: when tex_math_dollars is disabled pandoc doesn't cr= eate
> Math elements, while under the same conditions (inheriting
> PANDOC_READER_OPTIONS) pandoc.read create Math elements for the sa= me
> document.

That's a problem in the docs: it should be noted more clearly that = the
format extensions are taken from the format, not from the ReaderOptions= .
Try with

pandoc.read('$2^a$', 'markdown-tex_math_dollars')

or (with pandoc 3)

md =3D {
format =3D 'markdown',
extensions =3D {tex_math_dollars =3D 'disable'}
}
pandoc.read('$a$', md)

> Il giorno marted=C3=AC 17 gennaio 2023 alle 09:58:14 UTC+1 Claudio= Di Vita
> ha scritto:
>
> Hi folks,
> =20
> reading the documentation, with the extension tex_math_dollars
> enabled (that's the default) anything between two $ (or tw= o $$)
> characters will be treated as TeX math.
> =20
> 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
> Of course disabling the extension or escaping the $ characters
> there are no issues, but it would be nice to avoid that, if
> possible.
> =20
> Any idea of what can be the wrong parsing cause ?
> =20
> Cheers,
> =20
> Claudio


--=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/a05750c3-a66c-44ff-a4c5-1434378aea0dn%40googlegroups.= com.
------=_Part_2013_1977196110.1674580300064-- ------=_Part_2012_1440937407.1674580300064--