From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27564 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Markdown Fenced Div to LaTeX Environment Date: Sun, 24 Jan 2021 09:58:16 -0800 Message-ID: References: <8ba84992-d792-4333-aae0-560147ef79d4n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6822"; mail-complaints-to="usenet@ciao.gmane.io" To: Chris Diaz , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBRXKW2AAMGQEIW42UCQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jan 24 18:58:31 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qt1-f185.google.com ([209.85.160.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l3jeh-0001gF-So for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 24 Jan 2021 18:58:31 +0100 Original-Received: by mail-qt1-f185.google.com with SMTP id d10sf5850094qtx.8 for ; Sun, 24 Jan 2021 09:58:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1611511111; cv=pass; d=google.com; s=arc-20160816; b=xPYqzfJz65GcmMvaucCPTK2ewG2zKKm+72SjG1iGEnOjEqXzM3wybl8S4WSr7nDZcl WQ2JswIQtOLGYeKqap3fhmXIgdDQuAwOrLFqeeD91rwgp+D8zjVewmfL+41mRxUiHI+l skatMdgXuRemp2eV6PAM4Zf/CDVRzfSo+ZLgE4HqJ+ZcIqvcHblYlRCGipWnp2tyawIo U2xZBDBulFIT+gEZAND1OAagbnSjlo9JuhjGWGJLdssloIgfmS2s5B7ZsL0SkYXBdHdG QuXs2re7QJUg8j/xWilMNWKd1aJyyONwlphLfIOJ+2DwJjsEUiI43p3BJ1QvjJ+mIJjj Xe2w== 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:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=HRQGhCK7956vCUhNUX5a8jluMUFJv7ZN1+hv+px5ihg=; b=v89Pl3L9k3anDZoWxiWvNzcwU7Ml7jN/ddht45AhWhsewr36mO8SfjBWouShbdPCJM nqGk9fVEhHEHMVsrHutKPjLZbI/gzRtuK079zzrq29NFWp1z0zwJQAX3Zbb+Lf0D+JqD jtcas8bQ/QBw5d0kAVwzUXYuLrFTch6/V2UTyp4/QJcBNs7s9REojDDWRJ1Y+HOP+dmU avUyImR3q/n0E8LkyC0suY+3uG88zDfqrIth5RV4+J7/v2U15mKZhSGH5FVXJQecB/7Y nwuNf5LhYkIsH2TphOJDiWkJg1njYH4vHYGWbpkP9NJjbuv+j/THmT47qNJS4/xNtvlk JbOg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ztXGoNMj; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version: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=HRQGhCK7956vCUhNUX5a8jluMUFJv7ZN1+hv+px5ihg=; b=aFb/nh6gQtPzxY2ETg2MNQvsIfwgFBsUcKFwSo2qINQVjKOxq7/w9EYvP2bHxA66xc uhI2idfa/BiFLQ+sHEI4oVxE9OYPxodOIm5ThA8I11N+8e48e89GmpZf/XyqmC+FiX5t 3NQ9G20N803/2jWT6okdRKkGULgd2f0vnvRc52GX9w/PQf0Ka/YGWHRmH5tmqlGVWLer E59FZBZdsqqIlFg/wlQcdMY9xR9wAvbbbHheesQtzKKHPNFpGoA+IJBF/nlaLe1pdflv Df/JjsqxjmaQNpkcsFeUT1YN73jl1LS078kdELKqjqcbcFGMVKzVQNHiaZqZDf/Nm/I+ 4Y5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version: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=HRQGhCK7956vCUhNUX5a8jluMUFJv7ZN1+hv+px5ihg=; b=mavbhdmv/Emg+yN8MikkCZ65oMQUBBZGTpC5RkYzY8/D7qmgLtGMTOCTZT+zhjYK16 QJ5FpJQUNtaRMG3ueWO9T7YMLjAugaaC8Lngdmhawc4SKv60bird4CaTfhV/+NtVR3Su rgRCSj3Eik02v4/wzzrIxIYtseXMg/wOMzjLeCa91haljhxFxEw8jsucvYz66MZmagzM pfwqpUnB5DbilSfTMhXtSuPfkO9+7kQH70eVwDIDnZJfkBniVU+ErLWUBDQSnhsEBYYr XYZlOhOQYeJbVf7KOs8C1OrUqdBhh+9tnT/aDeRqfdIp+ieMoKbks4UI8poOhjQcEreV qj1g== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530Yb3wJcQUrEqp01MCyzEz13r98NKZWGlwAbfFCe6rOlOWxuskw BUQvYIjtPVGXnKwqlLg3Lok= X-Google-Smtp-Source: ABdhPJxzAZKul/EUx1YKOl5Bqctqx7pbyZhQYxMpdmEb1c8hA3lIjE/zoeynU2nVT7Vct6x9hWVe6A== X-Received: by 2002:a0c:c489:: with SMTP id u9mr1646108qvi.31.1611511111075; Sun, 24 Jan 2021 09:58:31 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ae9:f501:: with SMTP id o1ls5646002qkg.6.gmail; Sun, 24 Jan 2021 09:58:30 -0800 (PST) X-Received: by 2002:a37:4286:: with SMTP id p128mr1824708qka.337.1611511109951; Sun, 24 Jan 2021 09:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611511109; cv=none; d=google.com; s=arc-20160816; b=ZNPh+D7kR54KJ5rqp/u1MnwhOVPMpyvNlqZ2TvpQfGhpCAZCXK08ENFrGwq+MzU6MA eHa1OdYKFOAyqQlNjQ6/aTSNEG24NvJeQXBKhQ/IyFEOBlDDbdoBlOzAHLGfuXzP1ox2 lYj9E5siNTLp3gexBoOHCJRc+DzuUfOtYNJBJs6YhcBDp8QU68Yc+hXF6u5SMp2XB0n0 2Ckfo1AGLIaXn21+2pUapU0CS0bXm5cEr1CbNhoYcXRX4uD7JL7amnnf68NIe6X7pNO8 7q+q4iDLyJWMPrkqWDOrl3I3splztX4Kg52bJZgxBiLSy7RH9e4zSS41ikNFQC90VGcC Gwxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=cNNK6iLSS5GQc17Hyt6bQ8LEtfMib1OO5bRcvvqoy3g=; b=URn/Ms27t4hlhH5F6QcQEO3OWHCAme5IDnzoqfX+R9KzFexWAvbriQuF25tynKGmqj TPbbr4ulrX/i3oYfj0BVGDLLUIkhjluVf/lC07HXgAC5AFPB41M6Zc2P3KbgYhenezWG SsLVVHZd6vda+MhmkiF8TzgarDI1IcHGasfLn8q+dbygCZLU4KKRuM1FBtByVfWtykZ4 KboAHo7M9OYFBvoD9ESuFczEHgxh3uTB/jc6mhSfuZ2o3XWoYJmyuVTuMQvp++QBKacV RPMsa+tSewn6+SfEqsbNpJThodRjlxZUffFQxE+HgW0f/Y+ZPxxKDpCgVvSp4k6IMid/ be/g== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ztXGoNMj; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com. [2607:f8b0:4864:20::102c]) by gmr-mx.google.com with ESMTPS id a26si334967qkl.1.2021.01.24.09.58.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Jan 2021 09:58:29 -0800 (PST) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102c as permitted sender) client-ip=2607:f8b0:4864:20::102c; Original-Received: by mail-pj1-x102c.google.com with SMTP id md11so6930933pjb.0 for ; Sun, 24 Jan 2021 09:58:29 -0800 (PST) X-Received: by 2002:a17:902:eec4:b029:de:aa86:5269 with SMTP id h4-20020a170902eec4b02900deaa865269mr602160plb.66.1611511108952; Sun, 24 Jan 2021 09:58:28 -0800 (PST) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id c5sm14163369pfi.5.2021.01.24.09.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 09:58:28 -0800 (PST) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 432B0A268; Sun, 24 Jan 2021 12:58:17 -0500 (EST) In-Reply-To: <8ba84992-d792-4333-aae0-560147ef79d4n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=ztXGoNMj; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102c as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:27564 Archived-At: 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.