From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30653 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Schroeder Newsgroups: gmane.text.pandoc Subject: How to make my latex environment accessible from markdown via short-code? Date: Thu, 2 Jun 2022 01:17:44 -0700 (PDT) Message-ID: <4de0a599-a196-438a-928c-b0895b35afb6n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_400_2091998353.1654157864280" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36485"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCMMVPMN5MPRBKPE4GKAMGQELPRZQGQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 02 10:17:48 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f59.google.com ([209.85.210.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nwg1c-0009ME-3x for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 02 Jun 2022 10:17:48 +0200 Original-Received: by mail-ot1-f59.google.com with SMTP id c8-20020a9d2788000000b0060b37b39dbasf1195351otb.13 for ; Thu, 02 Jun 2022 01:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=KFLAjsVl0qTJmVmCPtEYXShGnil5T7ZyBfXmst0THFk=; b=jgy10O/nHVl+tDg89qJGipUdGNjo7ZlOV2sNci1xRsSNFlHGDKSjuqlwQ2VF2JXiRA d86URwlVvpEgZT99uXMpvfGiDRLEeZK6uBHEuz7FeyE/jZ1YNh5Z+LHya/MyBH0meJ8D 8ErHnNbCo9JXtrRJWOPoSno1qmiGWTE4oG+PTBC2YDmyh1kPImCWkxglfxaEDUw26QxO l0rS9q3WZ9CHiGIWHsazi3w+68mX0lIU3o6f6T7kQXbBYjI/3Nmuz4g+gDNXQNECIHn7 akBnE2eGOf/g78H2WYATSZ+kDgfAhyFCGw65pfdfrHOtyQHSfXH0eGx88MJMrQ1xf4O9 TF0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=KFLAjsVl0qTJmVmCPtEYXShGnil5T7ZyBfXmst0THFk=; b=GiJy9Tfl4cFuDlD2EeR1V7Z1wWbb5V5w2psDdj6vnuGOUUcoZ4y9OGwU/gmwmIZchg xLa/jOWVAjv+yZzqb10egSDssqHtX5Pv3MiwUfhFGJOoW1rhlrT+NWV8EqSvslRvKHMN ueqnWuo/7WkjEhxFOUk/IBiVwQsxhjab0nh6Nj9JyiU60e2nHXOgljQnfrxJab/EVKSe rz/wGTr4cBZ9Z5Nsj31Kl23SwHEoPp/guN0M1UpB8MofBhcLSGWfWhHRj6MbKlBzHWI2 I9CS3FcRKJTmrBRJYA4Vv9mQ9NX+M8pNVvO8D0htuLwIsHEFnCUEtcSVhyjcBvjW3NKd Xn3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=KFLAjsVl0qTJmVmCPtEYXShGnil5T7ZyBfXmst0THFk=; b=esDZNIA/4THtPJ3d5U2OjXn2EIqhj3Mux/HeiYcS7Hdkxl9OL5Hdp9ahg+HmIdLaiD u3yyx5DfbwVfXoRphusEJuR5ZzmcW4vNuIe4bvBg+hKJ0PkGGNzleZoxRR9X+EhuvrvA rK1/gBL/fqtBnYD5oWL02ujtG1kOaUG/UAYF5S6uLd5fo+cgbdgaGg87mIF8K7lh3c2w ntfHbhKuit6QXMvS4TKQCh92McDUbMwzjTM/qZv212kg9XdYlCR5zhTmRzKi2yO3j1Jq vBkH+Ef5XTfU+fTUPJFRSduqFQSqzs7Q2udNx2xRcez5Tykeq1bucJqfHmG8cktRBKZ+ T/Iw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530U2d8exowZDOLyZA1057LGi0Wj8Tww7dfMoYAoKKYUrBfU0qds +La85t48LpQ/jLZ20sv5NRs= X-Google-Smtp-Source: ABdhPJyo2vR+QDg3EwSHQK2yOOzWhkTCaNc3BcczeXqoVCWEsR9wXNAI4hzfOLP61IaMfyt8VMszhQ== X-Received: by 2002:a05:6870:40d0:b0:f2:ccde:d79b with SMTP id l16-20020a05687040d000b000f2ccded79bmr19848135oal.77.1654157867121; Thu, 02 Jun 2022 01:17:47 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:4604:0:b0:60b:8d36:6a1d with SMTP id y4-20020a9d4604000000b0060b8d366a1dls1223643ote.8.gmail; Thu, 02 Jun 2022 01:17:44 -0700 (PDT) X-Received: by 2002:a9d:27a8:0:b0:60b:789e:8a47 with SMTP id c37-20020a9d27a8000000b0060b789e8a47mr1570467otb.54.1654157864833; Thu, 02 Jun 2022 01:17:44 -0700 (PDT) X-Original-Sender: ondekoza-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:30653 Archived-At: ------=_Part_400_2091998353.1654157864280 Content-Type: multipart/alternative; boundary="----=_Part_401_1463088201.1654157864280" ------=_Part_401_1463088201.1654157864280 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I am converting markdown to pdf via latex using my own template. In the template I have defined a new environment called 'hint' that is like= =20 a call-out. This works: --- ```{=3Dlatex} \begin{hint} ``` Lorem ipsum dolor sit amet,=20 ```{=3Dlatex} \end{hint} ``` --- The Lorem text appears in the callout-environment. I want to make the environment accessible more conveniently via a=20 short-code. I have created a new lua-filter, 'hint.lua' that I successfully include: return { { Str =3D function (elem) if elem.text =3D=3D "{{hint_end}}" then return pandoc.Str("```{=3Dlatex}\n\\end{guidehint}\n```\n") elseif elem.text =3D=3D "{{hint_begin}}" then return pandoc.Str "```{=3Dlatex}\\begin{guidehint}```" else return elem end end, } } But when I use it, the macro-text will be included literally: {{hint_begin}} Neque porro quisquam est,=20 {{hint_end}} The code is not interpreted to end up being proper Latex, but it's escaped= =20 somehow to become a string literal.=20 Thus my output looks like this: =E2=80=9C=E2=80=98{=3Dlatex}\begin{hint}=E2=80=9C=E2=80=98 Neque porro quis= quam est, qui dolorem ipsum, quia=20 dolor sit, amet, consectetur, adipisci velit =E2=80=9C=E2=80=98{=3Dlatex} \end{hint} =E2=80=9C=E2=80=98 How do I make the short-code to get access to my own environments? PS. If there are different apporaches, that'll be nice as well. Thanks Stefan --=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/4de0a599-a196-438a-928c-b0895b35afb6n%40googlegroups.com. ------=_Part_401_1463088201.1654157864280 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am converting markdown to pdf via latex using my own template.
=
In the template I have defined a new environment called 'hint' that is= like a call-out.

This works:
---
```{=3Dlatex}
\begin{hint}
```
Lorem ipsum dolor sit amet,
= ```{=3Dlatex}
\end{hint}
```
---
The Lorem text app= ears in the callout-environment.

I want to make th= e environment accessible more conveniently via a short-code.

=
I have created a new lua-filter, 'hint.lua' that I successfully = include:
return {
  {
    Str =3D function (= elem)
      if elem.text =3D=3D "{{hint_end}}" then
&n= bsp;       return pandoc.Str("```{=3Dlatex}\n\\end{guidehint= }\n```\n")
      elseif elem.text =3D=3D "{{hint_begin}}"= then
        return pandoc.Str "```{=3Dlatex}\\begi= n{guidehint}```"
      else
       = ; return elem
      end
    end,
  }=
}

But when I use it, the macro-text will be in= cluded literally:

{{hint_begin}}
Neque porr= o quisquam est,
{{hint_end}}

The code is n= ot interpreted to end up being proper Latex, but it's escaped somehow to be= come a string literal.
Thus my output looks like this:
=

=E2=80=9C=E2=80=98{=3Dlatex}\begin{hint}=E2=80=9C=E2=80= =98 Neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, cons= ectetur,
adipisci velit =E2=80=9C=E2=80=98{=3Dlatex} \end{hint} =E2=80= =9C=E2=80=98

How do I make the short-code to get a= ccess to my own environments?

PS. If there are dif= ferent apporaches, that'll be nice as well.

Thanks=
Stefan

--
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/4de0a599-a196-438a-928c-b0895b35afb6n%40googlegroups.= com.
------=_Part_401_1463088201.1654157864280-- ------=_Part_400_2091998353.1654157864280--