From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32222 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: A A Newsgroups: gmane.text.pandoc Subject: Re: Can math elements have attributes Date: Thu, 23 Feb 2023 10:17:35 +0100 Message-ID: References: <0845b275-aa43-4fc3-86a5-17b20de652een@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006e57c705f55a7c48" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36726"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDJ77HUDRUCBBPG63SPQMGQEMKPMAYQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Feb 23 10:17:53 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f58.google.com ([209.85.216.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pV7jc-0009Js-Q7 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 23 Feb 2023 10:17:52 +0100 Original-Received: by mail-pj1-f58.google.com with SMTP id m10-20020a17090a668a00b002371fb8da57sf3115776pjj.0 for ; Thu, 23 Feb 2023 01:17:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677143871; cv=pass; d=google.com; s=arc-20160816; b=W0Rb5D5MkM2eb6crNCaW8MJixeqm8OcXYVRyprk5Py2zq3W3xHVWVKshsQy24De/D2 FlTPhxGaDt9/lEFG8odp7kTDFmCIfcpEVrqAs4l9xGwKNb34MDj706YFQIj+JR/qfMYf 3PwCn+77jX5lXtiRSOl2h47zRKYuTlGZW+YsRh+4UZnTqX1lia/v+kgI6fAIrI5inFDM 7uLBHSD5XnboWQbSEC5PZ44gJb7otRi2wS6ALpwELEu75ZpeA+2nVP7aSsU4leHQMwKU daP8Jvlt+8GyedoqXbK3pbbfyCgIxbUiSHKhTOjlGVsrfpCaC9RjY/vEZRaFnijUqaRy ZO8Q== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=M7+VwaKibDEeU5vZ4Jih5odsz6WFtaygFEawKaQfRIc=; b=Qa2TNLCiiUteM92dlF9NZq0k6EVvIPkusXObKDgM133CUMRhG6e94W5dMll6nRJN8v T7Al+9WL3Q1QDez9GgE2LLC+E9bBRshcpQTewk8Gco0cN+8l7gv6byEzkE2dhrxJ0ZbQ 5zofXL6FKoB+6+gI+yGUvsogl/jEaWl/ecDaahR607js15NYDA6sBkIMTRSsR6GeS+b7 o8V8gVZLS1X5Nnax3rB4oAth8u+FXAVaMrr2DMJDeZ/m2rhvTDuU4HI9Mr49zhcL3GdJ s0pKuiJY7v4xIF6n8LYmM+FGWoaS8ZFXLwm4OLSsQoB2IJs6GtOrRLKCIfSRDtfZkRsp h4rA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VB+ga3AQ; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=M7+VwaKibDEeU5vZ4Jih5odsz6WFtaygFEawKaQfRIc=; b=paXe/vyH2EsHu36fhDA67n12RwCwIsS9VdcuLM/WK89I2RLqHwd9sL9OvVl8I58IuL B/wOyjU8cleUFB/6hX7GNfYXC1CnunXhomlpASTW94DXP3It8fkLbFOsjbivUoNJaUfA NapoMETXT2MHo8JOf7U1hGX/GhwwpxgprrS+rtciNGZGmVLBLAEqtqUr93rLDQmLkK7W S2h7Kaiyg3JrAIouIj+/2g1UdDDBmUF+fw7JyYnReWCKgu0yRVfVRXiIf5M3p11CVKOC /jUHJ3Xh6AXJ3ExjOJC2jj0B+/d3STGSAMTRw8CTn3M3OMU9c676bBD9cM0HE9z8U3ty a94g== 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-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=M7+VwaKibDEeU5vZ4Jih5odsz6WFtaygFEawKaQfRIc=; b=GcZQHi99fT3k8ph6eimvV9NZzAb+dg/dnVruEVuCku/eL59gLTdDhdMbCLXKI4Og4Y /m98QQWJVv9HCjYxpuCl0o0aawdaPeTrgssFNRAPAmQ5hgdhyuktAqNcE796BDOJ1UST kb9euW+a+ISOmcBeNRtdw3BJV+vXNVH5E6JPRVI2N2of2/0TfHKXEaKhtVJFeHp1QaDf sho2WD5ibOWw148mOZORre2yn16YvEvQYKD7XAM5KMeUmWPUymuoruT+niz00feAuAx7 hTzsCCTfYJm09DW6fAkhEO8yHbG4/6nto77GPta6FdGRJnqjDVoZpdzzN9kzqOe8uxzd 760w== 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:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=M7+VwaKibDEeU5vZ4Jih5odsz6WFtaygFEawKaQfRIc=; b=qjerb7dPtalIeLwZp5O0aHrB03YPfhhUv26AH4meOCO7k5nfyCs6q3aexnydD+u77B /32dlWeqQUOJuMiuRAauV6v8D8FRWbHZoW10sjgOsTmjLjRJIMfXHwl3eITwfN8UGJIb DRqnmVlDmgp5whIvc5twXgI05DdoDvorrhMb1naWvmtKCfyywcnsakHI38IkmMNMYo7j jko334ZJy+MBl8q6AmUaNyr7VQurXpTukfZbfaFS1h6NwW4Uv+HokXRNEk1jU1l8Rmn6 FSaXOtpKQAOz5juegeNbkBg3cJFukm/7m3V9XdFccnb51o Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKVRQw7zrMTRHy52YB5oZXMGXUskoiJZnwXBh8tTxrmeNpJydBcC jUHl74QkE1MEfnN/RY/OM2Q= X-Google-Smtp-Source: AK7set+zqkfSxZ3Ozet2gCWfW6kysFPMKyfAU5KkHNwlF9cBhBfORJyH3vhhggcOAXipYXn22F5rgA== X-Received: by 2002:a17:90a:d318:b0:233:c4ab:2f66 with SMTP id p24-20020a17090ad31800b00233c4ab2f66mr332515pju.0.1677143871283; Thu, 23 Feb 2023 01:17:51 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:903:11d2:b0:199:182b:34bf with SMTP id q18-20020a17090311d200b00199182b34bfls11912037plh.3.-pod-prod-gmail; Thu, 23 Feb 2023 01:17:47 -0800 (PST) X-Received: by 2002:a05:6a20:8e06:b0:bc:8b91:69a3 with SMTP id y6-20020a056a208e0600b000bc8b9169a3mr4365386pzj.46.1677143867573; Thu, 23 Feb 2023 01:17:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677143867; cv=none; d=google.com; s=arc-20160816; b=d4+9gwJJOrSf5mY80+qemV/qDrjz9HIHSkWX2Ze6BUKmEoXUfTJKy7C79tKvro2eis 9EBMSleDYqZweOxTIgjmnk3iYOYukpt75KR5OxJFxAKKXgpa0CWecPb3Lai6m29dr/hL hXnZ5Fe59K9Jlfg7l8NTEdOjRfKXnI1GxUbHQhCoamfAkLzXvRicz8ygop9GmfyPd0Qa yv8YmWPZIWf7N58i9Qphf1uKBeeHdJ9xLThccXg2DawDpNZu9Qu6XS1BwkVJbas2Ammp Ol4D86fKP9bsLiXnIXtRJ2VERqRL3z8RLgrgavIxaURfKxoERfNt5Jydsi0rCo1Q1Yik xaVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qLRtIE1hgq+P+nk24zVypT71rASRffTxkHeNGocv31A=; b=00sx7HeBRSqUos5lg0tL6t8j+uH1HpbC/8Toyh9crtQxDY3iECnx5MCPdzGheehRZI O6v1EhPlQCc9kSj0sccqW15TcQH1t6SPCOPTYKRtCelDNU147ldT4yGOXH17B6p5C2XI ZFs7ywiun2vgIIiYviwSjCi7ebb5vdITYUb3uf/Jm4hQz7+BnMz94tsqLjz6uB34Pv2T oD1hI1dbKwerNo4Z1nkgtYva7nq6R+nSVud8ulfj69UbrFyEj4GKLE/WQNZSQPbzYFGL 8RlIixqczOuaT3XG/eoF2ibFoxCDSdANKD63IejDBUi2+u7l6F3SSnCOByUikhhPTWnW UuVg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VB+ga3AQ; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com. [2607:f8b0:4864:20::1029]) by gmr-mx.google.com with ESMTPS id u190-20020a6385c7000000b00502fe4dbcefsi7475pgd.0.2023.02.23.01.17.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Feb 2023 01:17:47 -0800 (PST) Received-SPF: pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) client-ip=2607:f8b0:4864:20::1029; Original-Received: by mail-pj1-x1029.google.com with SMTP id pt11so12776220pjb.1 for ; Thu, 23 Feb 2023 01:17:47 -0800 (PST) X-Received: by 2002:a17:90a:c78f:b0:236:736d:2581 with SMTP id gn15-20020a17090ac78f00b00236736d2581mr329653pjb.8.1677143867019; Thu, 23 Feb 2023 01:17:47 -0800 (PST) In-Reply-To: X-Original-Sender: amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VB+ga3AQ; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::1029 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:32222 Archived-At: --0000000000006e57c705f55a7c48 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I see, thank you both for your response. I guess I will have to go with enclosing things in a Span or Div element. If I=E2=80=99m designing my own writer though, I=E2=80=99m not sure why thi= s: [$x =3D 1+2$]{ .cs #math:equation caption=3Dtest} Is any better than this: [x =3D 1+2]{ .cs #math:equation caption=3Dtest} Because in both cases I have access to the LaTeX math inside of the span. What added advantage does including the mathematical expression between dollar signs $...$ provide? Regards, Amine On Wed, 22 Feb 2023 at 17:38, Bastien DUMONT wrote: > For spans, it would rather be: > > [$$x =3D 1+2$$]{ .cs #math:equation caption=3Dtest} > > [$x =3D 1+2$]{ .cs #math:equation caption=3Dtest} > > (Backticks are for code elements.) > > Le Wednesday 22 February 2023 =C3=A0 08:33:36AM, Julien Dutant a =C3=A9cr= it : > > I'd check out if there's an extension flag ( > https://pandoc.org/MANUAL.html# > > extensions) you can add to commonmark_x input for it to process multili= ne > > attributes. Or one that can be added to markdown to process math > attributes. > > > > As the Pandoc AST doesn't have attributes on Math elements ( > https://pandoc.org/ > > lua-filters.html#type-math) the common mark reader turns them into > attributes > > of a container Span element, as your output shows. So an alternative > would be > > to simply write the span in Pandoc's markdown by simply adding a backti= ck > > before and after: > > > > `$$x =3D 1+2$$`{ .cs #math:equation caption=3Dtest} > > > > `$x =3D 1+2$ `{ .cs #math:equation caption=3Dtest} > > > > ~~~{ > > .cs > > #lst:my-listing > > caption=3Dtest } > > def f(x): > > return x > > ~~~ > > > > Writing a Lua filter that picks up either is also an option. Picking up > > attributes list after equations is probably a bit complicated. But usin= g > > pattern matching to process the initial {...} in a code block is more > feasible. > > > > All the best, > > > > On Wednesday, February 22, 2023 at 8:15:53 AM UTC A A wrote: > > > > Anyone? I also opened an issue in Github but no response. > > > > On Fri, 17 Feb 2023 at 12:01, A A wrote: > > > > Dear all, > > > > > > Having not received a response to my query below, I ran a few o= f > my own > > tests to try to understand what is going on. > > > > It seems that commonmark_x does recognize attributes for both > inline > > and display math. If I have the following in my markdown file: > > > > $$x =3D 1+2$${ .cs #math:equation caption=3Dtest} > > > > $x =3D 1+2${ .cs #math:equation caption=3Dtest} > > > > ~~~{ > > .cs > > #lst:my-listing > > caption=3Dtest > > } > > def f(x): > > return x > > ~~~ > > > > And I run pandoc --from commonmark_x --to native test.md I will > get the > > following: > > > > [ Para > > [ Span > > ( "math:equation" , [ "cs" ] , [ ( "caption" , "test" ) > ] ) > > [ Math DisplayMath "x =3D 1+2" ] > > ] > > , Para > > [ Span > > ( "math:equation" , [ "cs" ] , [ ( "caption" , "test" ) > ] ) > > [ Math InlineMath "x =3D 1+2" ] > > ] > > , CodeBlock > > ( "" , [ "{" ] , [] ) > > " .cs \n #lst:my-listing \n caption=3Dtest\n }\ndef > f(x):\n return x" > > ] > > > > Notice that the multiline attributes for the CodeBlock element > are not > > picked up. If I instead try pandoc --from markdown --to native > test.md: > > > > [ Para > > [ Math DisplayMath "x =3D 1+2" > > , Str "{" > > , Space > > , Str ".cs" > > , Space > > , Str "#math:equation" > > , Space > > , Str "caption=3Dtest}" > > ] > > , Para > > [ Math InlineMath "x =3D 1+2" > > , Str "{" > > , Space > > , Str ".cs" > > , Space > > , Str "#math:equation" > > , Space > > , Str "caption=3Dtest}" > > ] > > , CodeBlock > > ( "lst:my-listing" , [ "cs" ] , [ ( "caption" , "test" ) ] = ) > > "def f(x):\n return x" > > ] > > > > > > The attributes in the CodeBlock element are picked up, but the > > attributes for display and inline math are not. > > > > Unfortunately, for my use case I would like to be able to assig= n > > multiline attributes to code block elements and assign > attributes to > > display and inline math elements. > > > > Is there a way to achieve both in the same markdown file? Thank= s > for > > your consideration. > > > > Regards, > > > > Amine > > > > > > ---------- Forwarded message --------- > > From: A A > > Date: Wed, 8 Feb 2023 at 13:52 > > Subject: Can math elements have attributes > > To: > > > > > > Dear all, > > > > I am writing my own pandoc to latex converter using panflute an= d > would > > like to attach attributes to Math elements. I have tried the > following > > syntax, but it seems that the attribute is not being picked up = by > > panflute: > > > > ``` > > $$x=3Dy$${ a=3Db } > > ``` > > > > I did some of my own research to figure out what I was doing > wrong. And > > a couple of things became apparent: > > > > - On the one hand, it looks like pandoc might not support this: > > - [1]https://github.com/jgm/pandoc/issues/684 > > - [2]https://github.com/jgm/pandoc/issues/5286 > > - On the other hand, `pandoc-crossref` seems to be able to > handle this > > syntax: > > - [3]https://github.com/lierdakil/pandoc-crossref > > - [4] > https://lierdakil.github.io/pandoc-crossref/#equation-labels > > > > Is this currently supported by pandoc? If not then how is > > `pandoc-crossref` able to handle it? Thanks for your > consideration. > > > > Regards, > > > > Amine > > > > > > > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email > > to [5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [6] > https://groups.google.com/d/msgid/ > > pandoc-discuss/0845b275-aa43-4fc3-86a5-17b20de652een%40googlegroups.com= . > > > > References: > > > > [1] https://github.com/jgm/pandoc/issues/684 > > [2] https://github.com/jgm/pandoc/issues/5286 > > [3] https://github.com/lierdakil/pandoc-crossref > > [4] https://lierdakil.github.io/pandoc-crossref/#equation-labels > > [5] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [6] > https://groups.google.com/d/msgid/pandoc-discuss/0845b275-aa43-4fc3-86a5-= 17b20de652een%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > > -- > 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/Y/ZFCMVKXpyaki12%40local= host > . > --=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/CAMwawgMca58Ae4Ag0mB0XP_PMPbYubUY2UxBjTvPxXiS4DvozA%40mail.g= mail.com. --0000000000006e57c705f55a7c48 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I see, thank you both for your response= . I guess I will have to go with enclosing things in a Spa= n or Div element.

If I=E2=80=99m designing my own= writer though, I=E2=80=99m not sure why this:

[$x =3D 1+2$]{ .cs #math:=
equation caption=3Dtest}

Is any better than= this:

[x =3D 1+2]{ .cs #math:eq=
uation caption=3Dtest}

Because in both ca= ses I have access to the LaTeX math inside of the span. What added advantag= e does including the mathematical expression between dollar signs $...$ provide?

Regards,

Amine


On Wed, 22 Feb= 2023 at 17:38, Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> wrote:
For spans, it would rather be:

[$$x =3D 1+2$$]{ .cs #math:equation caption=3Dtest}

[$x =3D 1+2$]{ .cs #math:equation caption=3Dtest}

(Backticks are for code elements.)

Le Wednesday 22 February 2023 =C3=A0 08:33:36AM, Julien Dutant a =C3=A9crit= :
> I'd check out if there's an extension flag (https://pand= oc.org/MANUAL.html#
> extensions) you can add to commonmark_x input for it to process multil= ine
> attributes. Or one that can be added to markdown to process math attri= butes.
>
> As the Pandoc AST doesn't have attributes on Math elements (https://pand= oc.org/
> lua-filters.html#type-math) the common mark reader turns them into att= ributes
> of a container Span element, as your output shows. So an alternative w= ould be
> to simply write the span in Pandoc's markdown by simply adding a b= acktick
> before and after:
>
> `$$x =3D 1+2$$`{ .cs #math:equation caption=3Dtest}
>
> `$x =3D 1+2$ `{ .cs #math:equation caption=3Dtest}
>
> ~~~{
> =C2=A0 .cs
> =C2=A0 #lst:my-listing
> =C2=A0 caption=3Dtest=C2=A0}
> def f(x):
> =C2=A0=C2=A0 return x
> ~~~
>
> Writing a Lua filter that picks up either is also an option. Picking u= p
> attributes list after equations is probably a bit complicated. But usi= ng
> pattern matching to process the initial {...} in a code block is more = feasible.
>
> All the best,
>
> On Wednesday, February 22, 2023 at 8:15:53 AM UTC A A wrote:
>
>=C2=A0 =C2=A0 =C2=A0Anyone? I also opened an issue in Github but no res= ponse.
>
>=C2=A0 =C2=A0 =C2=A0On Fri, 17 Feb 2023 at 12:01, A A <amine.ab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>= wrote:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Dear all,
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Having not received a response to my = query below, I ran a few of my own
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tests to try to understand what is go= ing on.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0It seems that commonmark_x does recog= nize attributes for both inline
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0and display math. If I have the follo= wing in my markdown file:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$$x =3D 1+2$${ .cs #math:equation cap= tion=3Dtest}
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$x =3D 1+2${ .cs #math:equation capti= on=3Dtest}
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~~~{
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.cs
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#lst:my-listing
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0caption=3Dtest
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0def f(x):
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return x
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0~~~
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0And I run pandoc --from commonmark_x = --to native test.md I will get the
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0following:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Para
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Span
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0( "m= ath:equation" , [ "cs" ] , [ ( "caption" , "t= est" ) ] )
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Math Di= splayMath "x =3D 1+2" ]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Para
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Span
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0( "m= ath:equation" , [ "cs" ] , [ ( "caption" , "t= est" ) ] )
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Math In= lineMath "x =3D 1+2" ]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, CodeBlock
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0( "" , [ &quo= t;{" ] , [] )
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"=C2=A0 .cs \n=C2= =A0 #lst:my-listing \n=C2=A0 caption=3Dtest\n=C2=A0 }\ndef f(x):\n=C2=A0 = =C2=A0 return x"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Notice that the multiline attributes = for the CodeBlock element are not
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0picked up. If I instead try pandoc --= from markdown --to native test.md:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Para
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Math DisplayMath &quo= t;x =3D 1+2"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str "{"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Space
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str ".cs" >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Space
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str "#math:equat= ion"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Space
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str "caption=3Dt= est}"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Para
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[ Math InlineMath "= ;x =3D 1+2"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str "{"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Space
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str ".cs" >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Space
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str "#math:equat= ion"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Space
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, Str "caption=3Dt= est}"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, CodeBlock
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0( "lst:my-listing&= quot; , [ "cs" ] , [ ( "caption" , "test" ) ]= )
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"def f(x):\n=C2=A0= =C2=A0 return x"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The attributes in the CodeBlock eleme= nt are picked up, but the
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0attributes for display and inline mat= h are not.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Unfortunately, for my use case I woul= d like to be able to assign
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0multiline attributes to code block el= ements and assign attributes to
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0display and inline math elements.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Is there a way to achieve both in the= same markdown file? Thanks for
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0your consideration.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Regards,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Amine
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0---------- Forwarded message --------= -
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0From: A A <amine.ab...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Date: Wed, 8 Feb 2023 at 13:52
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Subject: Can math elements have attri= butes
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0To: <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
>
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Dear all,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I am writing my own pandoc to latex c= onverter using panflute and would
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0like to attach attributes to Math ele= ments. I have tried the following
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0syntax, but it seems that the attribu= te is not being picked up by
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0panflute:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0```
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0$$x=3Dy$${ a=3Db }
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0```
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0I did some of my own research to figu= re out what I was doing wrong. And
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0a couple of things became apparent: >
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- On the one hand, it looks like pand= oc might not support this:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 - [1]htt= ps://github.com/jgm/pandoc/issues/684
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 - [2]ht= tps://github.com/jgm/pandoc/issues/5286
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- On the other hand, `pandoc-crossref= ` seems to be able to handle this
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0syntax:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 - [3]https://github.com/lierdakil/pandoc-crossref
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 - [4]https://lierdakil.github.io/pandoc-crossref/#equation-labe= ls
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Is this currently supported by pandoc= ? If not then how is
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`pandoc-crossref` able to handle it? = Thanks for your consideration.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Regards,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Amine
>
>
>
> --
> You received this message because you are subscribed to the Google Gro= ups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email
> to [5]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [6]https://groups.go= ogle.com/d/msgid/
> pandoc-discuss/0845b275-aa43-4fc3-86a5-17b20de652een%40googlegroups.co= m.
>
> References:
>
> [1] https://github.com/jgm/pandoc/issues/684
> [2] https://github.com/jgm/pandoc/issues/5286
> [3] https://github.com/lierdakil/pandoc-crossref
> [4]
https://lierdakil.github.io/pan= doc-crossref/#equation-labels
> [5] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [6] https://groups.goo= gle.com/d/msgid/pandoc-discuss/0845b275-aa43-4fc3-86a5-17b20de652een%40goog= legroups.com?utm_medium=3Demail&utm_source=3Dfooter

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/Y/ZFCMVK= Xpyaki12%40localhost.

--
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/CAMwawgMca58Ae4Ag0mB0XP_PMPbYubUY2UxBjTvP= xXiS4DvozA%40mail.gmail.com.
--0000000000006e57c705f55a7c48--