From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27567 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Chris Diaz Newsgroups: gmane.text.pandoc Subject: Re: Markdown Fenced Div to LaTeX Environment Date: Sun, 24 Jan 2021 13:50:44 -0600 Message-ID: References: <8ba84992-d792-4333-aae0-560147ef79d4n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000988af205b9aabdd8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pandoc-discuss To: John MacFarlane Original-X-From: pandoc-discuss+bncBD2Y77EIQ4PBBJE7W6AAMGQENNJWK4I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jan 24 20:51:02 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f61.google.com ([209.85.210.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l3lPa-0001qM-QP for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 24 Jan 2021 20:51:02 +0100 Original-Received: by mail-ot1-f61.google.com with SMTP id l51sf487280otc.7 for ; Sun, 24 Jan 2021 11:51:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1611517862; cv=pass; d=google.com; s=arc-20160816; b=gs8jZ9REss+X4qCJjcvsT1i2IUtWoA85aVdJKZlp5+ocFAebiF9RVd0szuQip35MIO 8tjr5pSQtFn4xCdM4OrydXr0S8U0NQgqu/nxElUax6f26Crp7AdGZ35Vx1Pta+zOovIG wxl9oxcYAaCDqOr3jrChRvSGob3nennoHXXdjxOTl1zKOlR836Ra+3NKpjBFIx0fzYQr r0R45AY4TwubP667ufDxJbpZsMK+CevEXRf30W3AUJlC1ZCj6I4wQP1DXFLWSfgefWSO Gz4XoUNUEDpnI3Hgqef+Q67s90ETEpbf7qbFju0nzMKCahj9pa/ZNT8aeQmEvgyqcJUt mY2g== 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:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=SZIbx57IMtEW+VSouGx7mDKfceA3VcE9Hva9Gh99WqI=; b=BfSzCfTHOcHXRmjUTzC1bCWA+2J1XTh4kI5Hueb7MnKzHh2eg+NGaVnltjRiEv+RQX UlP4BwQdB0mwnETYax39XegNrDp6MifrtwPY20v7dj6Uw6amOvpcQM1f+05TXzCb0Osr ZKcekuiC9bhzmxthqOnRHr1hbbunaARrBFCGzTn9NxPa10dOpakS8Ljqm8kaoYn4zFIJ 82NGyQFbf56xbUfGvAGUv0fRN2CLA7xJwK+KeGowjeA3hFX6rGM8pRuAzo6QX44klSv0 ao5Q5JAwbveZpTG6nNCCGBeesq+53zulQ9tDWXSHLPrgWYlJP9R5INfQO1qkjGiF7Utd m4+A== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i8E1JN2Y; spf=pass (google.com: domain of chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::92b as permitted sender) smtp.mailfrom=chris.diaz26-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=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:cc:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=SZIbx57IMtEW+VSouGx7mDKfceA3VcE9Hva9Gh99WqI=; b=s6mC2th+2OUMWeBjUFQrPyFPe4cFpxSKBhJppOQlRqN6ie5zXZI40F/ldDw4pU608T f9/UJRPwvPl0CE5VzkdZxqO69pFW955B4J/Eq0dVw08wGlDnpQujwwxDp6x23bOSVbi7 dnlzSHHQ7K3rmCl+dKO9Ap6kA0pjcY9XO99zg0q9aSckd/5OT/4GNQ1A8QMtFS78BYOM F03kg3RB3bKUTZmP0CKbZJ6c+pYopoKilJq29sFm0mLRHUUnI/f3oXqqauB5tJJ2NDwx 3cbjMcHDaQDRfOc4hIKazmMX1q3mW4+B2cz/giUCse7bjtI+Q7pG1sZmxzQ7mmKqnY42 vu3w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=SZIbx57IMtEW+VSouGx7mDKfceA3VcE9Hva9Gh99WqI=; b=D1vLurWwhymV9LVcJfkWHeSp695ZdRXUjtWQct9F5+vdvEwoWLe+aRZEsD97MfI34f cwdUyng9NJAFuOptw0sYsD07vVw+0kKz43qZF2KJGErcrwEfc5UjGQaukvPijir7LrPp ANpUnbJqkaKfRwZnvL4bE4KgGzYnqhJKKTRL8ihZk5wWP0oyCy02+74WRL5fzhSoHuO8 Aqa3o7zGy0tp/4R/POL/KHTLBtdgv+3rb8hFWal4s2r3JYyxOSis87MhUZPPQQLlZa6G NYv/yLM4KzF6dBK1HFApzXrqQtrBWmEd44ThgB6EtpJ+Ein5H2FpP5PRGvnbggGin4gI t1tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:cc:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=SZIbx57IMtEW+VSouGx7mDKfceA3VcE9Hva9Gh99WqI=; b=T/pQFZAy1Ct5UVBwa+iAkepBSPqsKHdEBPk/zn5CoRGcamGWyIrMm4gJ0ua0DrTnMz gbV8vwLRjSiNGlwzZdkfVq+kPL/yGevqRi2CXho1gDJ8Db0Wn1QCmup3I/5jEx25AQfH fskDqwXcR6PG2ZWtGioQCA6Ryv7h0lKKswhcmNwmVF2KlCQKY0OgbcLNQAWWzoIInX/j Q4fre/I/7hEfFqg+87I1PN79nR340y/3aQtiXf74l3SOrcmiSGmv3ORIVrVOd5ZWckZu w9jrMaqTuBII0V2urYdZHSBWOKd/BVIvOcg77X/rWKz1vJe7pALt+10D/LyMDxOkkRRb V+6g== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532vLzeKWqjvZEmIOQT4UWpbUO8m70U/G46s9YkfMxzb4ChszkMh i3ewYZR2izSlSfwk1MJI2dw= X-Google-Smtp-Source: ABdhPJyx7g7109P5Iz+Ve8qWX7BxplFk6SO8ByBK/mNCMmTAWKMROzBwYeW4OGaiYaOgQYojPIWdgQ== X-Received: by 2002:a9d:862:: with SMTP id 89mr2798264oty.294.1611517861902; Sun, 24 Jan 2021 11:51:01 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:1204:: with SMTP id 4ls2738329ois.6.gmail; Sun, 24 Jan 2021 11:51:00 -0800 (PST) X-Received: by 2002:aca:e187:: with SMTP id y129mr9328446oig.0.1611517860514; Sun, 24 Jan 2021 11:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611517860; cv=none; d=google.com; s=arc-20160816; b=zUabpTKGbau3VKLy9iPon+TkL9Vc4ZRHW6b/ElDBDh5iJRxJS4077B0XZAFXHoeniE MCgeLljWGeRVKeeoNu+ji9MNSzg9sEEx0Ctsu92eaUT/CCMHmKxPIVk5ma7D15NtU2xD anq3I73qhhDb2KMPlgbN2OmrMVuqNTzkQbKvcJnzF0LST51vV4KiBlUt4Y1WYTBIaJ7h eilR4EccuR96RHpYMof5hUMqlq4rFvnZooyRxDHh1tT5+qBtO3h/jMr4ceDUnxwGLveC WCw7Gufr5VqgPdjpX4dYMiWx1e06fzbsyXPVqFkKpYzia3BxZi84E5Bn3UWHRvBvgCog o3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=V1MizR+kBo/zrmibXa/aCTuPsLWii2Pe9XsVcJNB8mI=; b=ltlZAiFRRB3g83dQYgMOuMXruwxMAldrhjq83/YaCAMNBqGS6eE9HjSReCuc3xr5Mn pOOfu7KZ0T0xpFr8g7CZRpZgwdl54Kq7uSYuR0PWClAyeTogmd1F47rgtC5T71316S34 oQ6XInqDyalQkDYR9mKmxdfs6JBrtbGvQ9w+drAnxYgs1lywoIvH0ONBU1rmkIzi1kkJ Fej1SDz4ju/daSflwIkdTre3T/fvumwI8mLfP8gbGDiKVbPmmSZ7iz3fatNzSsMB8KgY EhMjUm8ch0ms2SLZWiMVog3DRrUV5r81nqkwC1rJ8mpWETMsmesgyJkgQwbc3xzbhpo8 3AZw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i8E1JN2Y; spf=pass (google.com: domain of chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::92b as permitted sender) smtp.mailfrom=chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com. [2607:f8b0:4864:20::92b]) by gmr-mx.google.com with ESMTPS id m7si807446otq.5.2021.01.24.11.51.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Jan 2021 11:51:00 -0800 (PST) Received-SPF: pass (google.com: domain of chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::92b as permitted sender) client-ip=2607:f8b0:4864:20::92b; Original-Received: by mail-ua1-x92b.google.com with SMTP id v23so3731631uam.8 for ; Sun, 24 Jan 2021 11:51:00 -0800 (PST) X-Received: by 2002:ab0:1d13:: with SMTP id j19mr578345uak.139.1611517860021; Sun, 24 Jan 2021 11:51:00 -0800 (PST) In-Reply-To: X-Original-Sender: chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i8E1JN2Y; spf=pass (google.com: domain of chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::92b as permitted sender) smtp.mailfrom=chris.diaz26-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:27567 Archived-At: --000000000000988af205b9aabdd8 Content-Type: text/plain; charset="UTF-8" Thanks! Exactly what i needed to know. -Chris On Sun, Jan 24, 2021, 11:58 AM John MacFarlane wrote: > > You need a filter, but it would be a simple one. > > Something like > > function latex(s) > return pandoc.RawBlock('latex', s) > end > > function Div(el) > if el.classes[1] == 'solution' then > return { latex('\begin{solution}'), el.content, > latex('\end{solution}') } > end > end > > Chris Diaz writes: > > > Hello, > > > > I'm looking for advice on how to produce HTML and LaTeX from Markdown > using > > fenced divs (or something else) to apply custom styles to specific > portions > > of the document. > > > > For example, I'm hoping to write something like this: > > > > ::: solution > > Solution text here. > > ::: > > > > in order to produce this when HTML is the output (already works): > > > >
> > Solution text here. > >
> > > > and this when LaTeX/PDF is the output: > > > > \begin{solution} > > Solution text here. > > \end{solution} > > > > This idea comes from Bookdown's > > Custom Blocks > > feature, but I'm wondering if there's a way to do this with Pandoc, or > if > > this would require a Lua filter. > > > > Thanks, > > Chris > > > > -- > > 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/8ba84992-d792-4333-aae0-560147ef79d4n%40googlegroups.com > . > -- 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/CAMkDs%3DNHev6VHpGEq6qiYGbOMgMr6RqKzu0E9dcsr1kZFXO-Ow%40mail.gmail.com. --000000000000988af205b9aabdd8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks! Exactly what i needed to know.=C2=A0

-Chris

On Sun, Jan 24, 2021, 11:58 AM= John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:

You need a filter, but it would be a simple one.

Something like

function latex(s)
=C2=A0 return pandoc.RawBlock('latex', s)
end

function Div(el)
=C2=A0 if el.classes[1] =3D=3D 'solution' then
=C2=A0 =C2=A0 return { latex('\begin{solution}'), el.content, latex= ('\end{solution}') }
=C2=A0 end
end

Chris Diaz <
chris.diaz26-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello,
>
> I'm looking for advice on how to produce HTML and LaTeX from Markd= own using
> fenced divs (or something else) to apply custom styles to specific por= tions
> of the document.
>
> For example, I'm hoping to write something like this:
>
> ::: solution
> Solution text here.
> :::
>
> in order to produce this when HTML is the output (already works):
>
> <div class=3D"solution">
> Solution text here.
> </div>
>
> and this when LaTeX/PDF is the output:
>
> \begin{solution}
> Solution text here.
> \end{solution}
>
> This idea comes from Bookdown's
> <https://bookdown.org/yihui= /bookdown/custom-blocks.html> Custom Blocks
> feature, but I'm wondering if there's a way to do this with Pa= ndoc, or if
> this would require a Lua filter.
>
> Thanks,
> Chris
>
> --
> 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 pandoc-discuss+unsubscribe@googlegr= oups.com.
> To view this discussion on the web visit https://group= s.google.com/d/msgid/pandoc-discuss/8ba84992-d792-4333-aae0-560147ef79d4n%4= 0googlegroups.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://group= s.google.com/d/msgid/pandoc-discuss/CAMkDs%3DNHev6VHpGEq6qiYGbOMgMr6RqKzu0E= 9dcsr1kZFXO-Ow%40mail.gmail.com.
--000000000000988af205b9aabdd8--