From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33177 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: iandol Newsgroups: gmane.text.pandoc Subject: Re: Defaults Files and header-includes Date: Tue, 10 Oct 2023 08:58:18 -0700 (PDT) Message-ID: <2e8f4aa6-79e4-4bf0-808a-764da284133dn@googlegroups.com> References: <8f5ccade-4695-4bc4-a61d-e7c9cf24db50n@googlegroups.com> <69a8684d-d7db-421f-9a8c-3454ca012511n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_274_798927527.1696953498068" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4736"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC2PTEMIZYERBG7JSWUQMGQEMOHFIXY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Oct 10 17:58:22 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f59.google.com ([209.85.160.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qqF7m-00010P-ER for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 10 Oct 2023 17:58:22 +0200 Original-Received: by mail-oa1-f59.google.com with SMTP id 586e51a60fabf-1e96efd9ae0sf1146487fac.3 for ; Tue, 10 Oct 2023 08:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1696953501; x=1697558301; darn=m.gmane-mx.org; 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=7F0O+/v1TR0IPCJ3a1VEwG/2qL04ZgsixpoKI5aNpKo=; b=NKlpHH4V3wUttDWweC90CyBKbdfOUGZKG9ZIo+q8dn8ryTYhsltrKpP0ggkMqZcnZW kzvpvY3KmjwbRQn1p3uwse92vkA/RAvKBstUD4Vgyr/ruj3RjCgiXeeFJzgAKph85xBL RJWiU2wImjlXyWJihG6HdH+Ou154Xd+a8hOk5MVYnaPiqdeEXufgYFZmyONTtZgOZbp3 LJoK4dVJMcP/sxhDg7B0lnESldgbS9R90Okf1kcsvQTVKQXXbOjzmCdzLTLH6GZ5v6NT A7EEXaaW3k+1UePwBS5J5EFvIVuJTugDw1uWRYiZooEb0sEmk51mplN6KowE/rF2lxqp PDRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696953501; x=1697558301; darn=m.gmane-mx.org; 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=7F0O+/v1TR0IPCJ3a1VEwG/2qL04ZgsixpoKI5aNpKo=; b=DtjRW6C0XsTxExtUNzK5Yp47ivAIdTY0V20Jz8E3BOzi6kqPq2uneTunVqduJcuiCb LNZLUbA8iJ2wLvP4a1Fdr2ujziw0HFLxWPOUfuWoY5FPLOgKFtYZPocVhjxxfvyHTi80 FV6wPNco0n5ItJsDW8Gtd8qOkoJYkxd5ElwKuL45gD7rZef3ftrnd8+qwjITxAmsBNcI YbbiNQkZPFqVC8CUaA3ZhUSwPqGD2aMKFyNF9D/b7JZOjbqY1Ue5bYCGzOs/YoVnZ6qJ Vu850PEkMXU+N3Hz0nT2sXQX05YiIMtjB+ocKHNp9fa0xsGc0/yP/mpjjByNgeO9DTpu lQFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696953501; x=1697558301; 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-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=7F0O+/v1TR0IPCJ3a1VEwG/2qL04ZgsixpoKI5aNpKo=; b=HnvRCCG7l9W2HvwOFOCTsYGleBszwLPSi/ipn5yk+6TUWB8TxTevUVRpnTsyfKImT0 HdpYIyKbAFr+T63XECx+zH6do/wmmw0CCoKpoSXq6D+7xxTqukK1a3nfaul1sFG/pWbY 4nzNPYZYVaNVvWSFmk3Kl8jiarVD7o+3+ZnWzNqOAYVBElpLM3tmDFU/CsU3yhwr0qvO ZSMHy8t6LKrdSAEwyPMCKjz8NgD1FGMjhMESAVJ1oFAK7+WSsDTbz7KqNu6Q2qSiyPkJ Q0yMH4xGfqwah+AQ9rCNBh4tzeFQsoN1t2SotvHxiiv2PIylck Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YwS/o4gyoYDCXZ/v2XvZWCLMMZQ3QdpKRkK3notDJzgi5HkwNJe 9I2Xgzb9oQs8zlrUX6sujgI= X-Google-Smtp-Source: AGHT+IGPr05nCrb78OP+TqQGEvj8GgRO5d4x26FPELx+XBL+eAo+b6qsNMsOHPGa94zG5jn7G0AAeg== X-Received: by 2002:a05:6870:9a1e:b0:1d6:5658:7989 with SMTP id fo30-20020a0568709a1e00b001d656587989mr23071080oab.19.1696953501378; Tue, 10 Oct 2023 08:58:21 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:88e:b0:1e1:371:c3f8 with SMTP id r14-20020a056871088e00b001e10371c3f8ls10862904oaq.2.-pod-prod-02-us; Tue, 10 Oct 2023 08:58:18 -0700 (PDT) X-Received: by 2002:a05:6870:b007:b0:1e9:65da:f064 with SMTP id y7-20020a056870b00700b001e965daf064mr882201oae.2.1696953498675; Tue, 10 Oct 2023 08:58:18 -0700 (PDT) In-Reply-To: <69a8684d-d7db-421f-9a8c-3454ca012511n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: iandol-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:33177 Archived-At: ------=_Part_274_798927527.1696953498068 Content-Type: multipart/alternative; boundary="----=_Part_275_644025513.1696953498068" ------=_Part_275_644025513.1696953498068 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable OK, I realised the YAML needs a trailing newline after the string scalar,= =20 this works fine: header-includes: | ```{=3Dtypst} #set heading(numbering: "I.") #set text(font: "Alegreya Sans", size: 14pt, discretionary-ligatures: true,= =20 number-type: "old-style") ``` ...note the trailing blank line... On Tuesday, 10 October 2023 at 23:50:47 UTC+8 iandol wrote: > So reading the docs on --metadata-file I assumed I could use this=20 > instead, so I make a new yaml file saved to the data dir metadata folder= =20 > and call it from the defaults file. In the metadata.yaml file I put: > > *header-includes: |* > * `#set heading(numbering: "(I)")`{=3Dtypst}* > =20 > and this gives me *#set heading(numbering: "(I)")* -- good, pandoc parsed= =20 > the markdown and didn't escape the # .However I then tried a block: > > *header-includes: |* > * ```{=3Dtypst}* > * #set heading(numbering: "(I)")* > * ```* > > > And the output is *`{=3Dtypst} #set heading(numbering: "(I)")` *=E2=80=94= hm not so=20 > clear why the block generates this unesscaped but transformed markdown? > > Ian > On Tuesday, 10 October 2023 at 20:44:41 UTC+8 iandol wrote: > >> Thanks John, so there is no way to stop the escaping as even if I remove= =20 >> the raw attribute, the # of the typst set command also gets escaped=20 >> stopping it from working...? >> >> Best, Ian >> >> On Tuesday, 10 October 2023 at 12:03:44 UTC+8 John MacFarlane wrote: >> >>> metadata in a defaults file is parsed as plain text not markdown=20 >>> (remember, default files are basically equivalent to specifying somethi= ng=20 >>> on the command line, and this is how --metadata behaves). So the raw=20 >>> attribute won't be recognized.=20 >>> >>> >>> > On Oct 9, 2023, at 6:06 PM, iandol wrote:=20 >>> >=20 >>> > I want to use header-includes: in a defaults file, so assuming it is= =20 >>> metadata (i.e. converted to variables for the template) do this in my= =20 >>> typst.yaml defaults file:=20 >>> >=20 >>> > metadata:=20 >>> > header-includes: |=20 >>> > ```{=3Dtypst}=20 >>> > #set heading(numbering: "(I)")=20 >>> > ```=20 >>> > mainfont: "Alegreya Sans"=20 >>> >=20 >>> > But the output is escaped. The same header-includes text works when= =20 >>> added to the document metadata header directly. I'm probably doing=20 >>> something stupid but didn't yet grok what that is... Any help appreciat= ed!=20 >>> >=20 >>> > Best, Ian=20 >>> >=20 >>> > --=20 >>> > You received this message because you are subscribed to the Google=20 >>> Groups "pandoc-discuss" group.=20 >>> > To unsubscribe from this group and stop receiving emails from it, sen= d=20 >>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >>> > To view this discussion on the web visit=20 >>> https://groups.google.com/d/msgid/pandoc-discuss/cd6c5731-19c7-4189-9b4= 5-ab783decfdb4n%40googlegroups.com.=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 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/2e8f4aa6-79e4-4bf0-808a-764da284133dn%40googlegroups.com. ------=_Part_275_644025513.1696953498068 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable OK, I realised the YAML needs a trailing newline after the string scalar, t= his works fine:

header-includes: |
```{=3Dtypst}
#set heading(numbering: "I.")
#set text(font: "Alegreya Sans", size: 14pt, disc= retionary-ligatures: true, number-type: "old-style")
```

...note th= e trailing blank line...

<= div dir=3D"auto" class=3D"gmail_attr">On Tuesday, 10 October 2023 at 23:50:= 47 UTC+8 iandol wrote:
So reading the docs on=C2=A0--metadata-file=C2= =A0I assumed I could use this instead, so I make a new yaml file sav= ed to the data dir metadata folder and call it from the defaults file. In t= he metadata.yaml file I put:

= header-= includes: |<= /div>
`#set heading(num= bering: "(I)")`{=3Dtypst}
=C2=A0 =C2= =A0=C2=A0
and this gives me=C2=A0#s= et heading(numbering: "(I)") -- good, pandoc parsed th= e markdown and didn't escape the # .However I then tried a block:
=

header-includes: |
```{=3Dtypst}
#set heading(numbering: "(I)")
```


<= /div>
And the output is=C2=A0`{=3Dtypst} = #set heading(numbering: "(I)")`=C2=A0=E2=80=94 hm not = so clear why the block generates this unesscaped but transformed markdown?<= /div>

Ian
On Tuesday, 10 October 2023 at 20:44:41 UTC+8 iand= ol wrote:
Thanks John,= so there is no way to stop the escaping as even if I remove the raw attrib= ute, the # of the typst set command also gets escaped stopping it from work= ing...?

Best, Ian

On Tuesday, 10 October 2023 at 12:= 03:44 UTC+8 John MacFarlane wrote:
metadata in a defaults file is parsed as plain text not markdo= wn (remember, default files are basically equivalent to specifying somethin= g on the command line, and this is how --metadata behaves). So the raw attr= ibute won't be recognized.


> On Oct 9, 2023, at 6:06 PM, iandol <ian...@= gmail.com> wrote:
>=20
> I want to use header-includes: in a defaults file, so assuming it = is metadata (i.e. converted to variables for the template) do this in my ty= pst.yaml defaults file:
>=20
> metadata:
> header-includes: |
> ```{=3Dtypst}
> #set heading(numbering: "(I)")
> ```
> mainfont: "Alegreya Sans"
>=20
> But the output is escaped. The same header-includes text works whe= n added to the document metadata header directly. I'm probably doing so= mething stupid but didn't yet grok what that is... Any help appreciated= !
>=20
> Best, Ian
>=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...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/cd6c573= 1-19c7-4189-9b45-ab783decfdb4n%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/2e8f4aa6-79e4-4bf0-808a-764da284133dn%40googlegroups.= com.
------=_Part_275_644025513.1696953498068-- ------=_Part_274_798927527.1696953498068--