From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23195 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Preserve math environment for mathjax? Date: Sun, 04 Aug 2019 21:28:19 -0700 Message-ID: References: <097b8e79-fbf1-4a7c-b626-a50995b0752c@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="246372"; mail-complaints-to="usenet@blaine.gmane.org" To: David Roundy , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB4HAT3VAKGQE4HCSFWQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Aug 05 06:28:36 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f55.google.com ([209.85.210.55]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1huUbq-0011wJ-Es for gtp-pandoc-discuss@m.gmane.org; Mon, 05 Aug 2019 06:28:34 +0200 Original-Received: by mail-ot1-f55.google.com with SMTP id d13sf45492686oth.20 for ; Sun, 04 Aug 2019 21:28:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1564979313; cv=pass; d=google.com; s=arc-20160816; b=mCfSrch5RdpsgrMc4t5EI4wYIJFSbFGLyCfT1qSt+XqgADrUBPWXOMAoCP6GNqAe8u ouwjXA2Ic9K59OSDW2TP/TwgJ5pjZDmwoUyZBan931EHHoLivk9IhDKphXP23Y/0CiFo Bwb3ZxjExpVPSkr2LotYGfikoCvmm9WXD7ROgvcDZgCax4OOMnf3xkXp2AoWLGai/Ojs q5lATfo8Ec/kvwPAzD8Zg48ZXrxnfqgVHMEePFv2k/hZHfIuYDK6tFVBUuZwsiWY7pwT +/Kkx22pA9A5TN2FhnD+7w8uzbDNutvgUgBxx+npas2blTforNU7fPBdz+oZDGF60/vR 8dCg== 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:content-transfer-encoding:reply-to :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=OvSu+h4dULKxF5Fdqt6oULEOGsZQOuNZqxhw8E4NS+k=; b=V7tmpQ2h1YnxD5U8+DKt3rCFiTIQVbleEfepogq0wv/Yj0XkvglErWAVCwImiahLVD 6S9rwIEHuqxbDdcLwNbsp/i3UgDVcs2gcw/PpOlz5Mds2+Z8wSaB+AyeByblauSKcHBs n/tHFOLp+Btyp6VimuqNfVNjXKy8Ltcqf+/jlxAE8W0bUTK0fPWNtnbVEieciX1Pc381 +0yp7HZowA0TBPVawz+JjMPIvxxnnK5FWY4KB0g4qnrt78sZ0Pm2HioAAILuOz6L+2JI FN5toWG7E3K983hErXWw5l5nVvisM/0lRmHeRbxdSs3SGWOZGvCk/UDjw6WfKLaUmwLD VMsQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=vJHDRkJ8; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::635 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:content-transfer-encoding:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=OvSu+h4dULKxF5Fdqt6oULEOGsZQOuNZqxhw8E4NS+k=; b=AX5g8kWTJS0TgMpGdS2GqVwBTHhkahMISf4MWifjjYBchmafeEZyGGfjFHA/xYI+0o b/aI9VKRCrJc1SZwNbnNJmQf9TqOnv9xJX4PwuGk5BKmO59NZ0Jb0fHnJXlsGGJvjq5v lyPwuLZf1SAh7j8tvDf9I+intrkwg7pjA+0PPEanivYZ2lVkkKekDWpfq/8vWhEgZBPq B+lnRcYyosiQsKS9v9znmIMBBu9qDMPpWFrrqY64IbcJ4W2PydLKB4e7mm5ypIeXxQi3 2Sj6HK3b6ZGy29BPKWHgC5XjYAmq4BtDPTOCR6wNTUvasGCdd3gDLSy5rSVEpJmuxhHI BjXA== 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 :content-transfer-encoding:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=OvSu+h4dULKxF5Fdqt6oULEOGsZQOuNZqxhw8E4NS+k=; b=lxbrZvY+fD9r+hAIZ2qXxtSk1obpjGKfSx1Qb0H1rVArE1KE1e+4wPM9yAL73Wqy/F Yavhu2hS1XOLedqf9NclyOCBPcetIursnmo5c0XfczCgY2Dsdt6DGfY9NLjLzFpqgbtD ABw+9hwG+qthv4qn0WCoyxSKUr7jeLCEqwfJTwGT/i3YCgqVChQsIUgQjKvsqWBO8gll FW/i+Ot9iDh+G3Agov5CvN0w6zQ4O2uSrDi7pYcA/k1zlHPZQ1IKpvmiSLSScy+oR45l 29mZK2lZgSCwK1hy2Nc8w/jo9dDq3+2qr8J0M+DVBZA9FzmuFpQAxMje/HNqwrsL Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAUZ2G39fnFsL/uQUwTvvbt2tklKbuRK5t4SOZkvAmgLVB4ONazY gHzmIrTa6Ux+g6VAmKKV/2I= X-Google-Smtp-Source: APXvYqz+yxDmeRps9mH/1RioJzUlOPD3M7pSiNedBFQgzh90IrblgAQPKO5pfs8ytxSqqE3TBBUL1g== X-Received: by 2002:a9d:404b:: with SMTP id o11mr53104707oti.155.1564979312933; Sun, 04 Aug 2019 21:28:32 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:71d0:: with SMTP id z16ls93186otj.2.gmail; Sun, 04 Aug 2019 21:28:31 -0700 (PDT) X-Received: by 2002:a05:6830:1206:: with SMTP id r6mr32941486otp.37.1564979311959; Sun, 04 Aug 2019 21:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564979311; cv=none; d=google.com; s=arc-20160816; b=B+MREw/t/QD3JKfvGeHhuDFU5p34spdiKsfR2h8Y3UcHAQUkxgWjjYFTZbYjJHLwt3 4pPVMPVCNU60oE1FouLYPqtFioBdS57rZE/hYht1ONlJst242/enImPjwJ378ujmRA9e oK7oQU1tRRgErEeXcLtk6X+GiAjgvLQzpseY5ZS5t39+mJKy6RGSiudhZAlqIDJi4tp6 yVqE+xpJ2L6wcEoslW2i/bhXBIaEYe9qyiP9XA6THJc8kJFTZ6g1ogknf6Igk8P/wQ15 PXX9I64LjYVhsppa+etqTqcGTjYJLULZR7/Z8G7xcSdtwvxZOCci6uAaE0D6jFcUO/jZ h7Ag== 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=0ltFmrRyFYCE/uykHGbLcxj3ocRqOZaUHUH9v2DdLMs=; b=ryf4zPszwg7WaQt059ItoMPaOxs/eRCFeRmjSFWe8z4z7sHRGvj+8K6oVxoctxrciJ 0wOmwAAJboJ/vnu4/VpDdcREFEC6BD/zqqz1eLWGHHFn8RF1Ari1+ZQQE2CQ2aBEsjGS TAnOt8YOYUDKGbWUUQHpweiaVcxy7U28Sjsooltn7fQ73g0GwhV8DtvFiAmFa0/kq32m LpjANqI9RZIPFBFpphWmrhhRM9X94Lmkc5nVZoRFHtbrr9Ymx98vzY18c16/FtEmecmA SxGQCHz3zpnp07qUui4ZODdyT35sWq1O6ToB/Dh8AufIgFz2Rd/h9BOReGEDOx4SiPLe oM6Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=vJHDRkJ8; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::635 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com. [2607:f8b0:4864:20::635]) by gmr-mx.google.com with ESMTPS id p6si4608720otk.5.2019.08.04.21.28.31 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 04 Aug 2019 21:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::635 as permitted sender) client-ip=2607:f8b0:4864:20::635; Original-Received: by mail-pl1-x635.google.com with SMTP id az7so35913591plb.5 for ; Sun, 04 Aug 2019 21:28:31 -0700 (PDT) X-Received: by 2002:a17:902:724a:: with SMTP id c10mr133052361pll.298.1564979311285; Sun, 04 Aug 2019 21:28:31 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id e188sm39274122pfa.76.2019.08.04.21.28.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 21:28:30 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id AF762A255; Mon, 5 Aug 2019 00:28:19 -0400 (EDT) In-Reply-To: <097b8e79-fbf1-4a7c-b626-a50995b0752c-/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=vJHDRkJ8; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::635 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.org gmane.text.pandoc:23195 Archived-At: Actually, pandoc does differentiate between \begin{equation} and \begin{aligned}. % pandoc -f latex -t native \begin{align} 2+2 \end{align} [Para [Math DisplayMath "\\begin{aligned}\n2+2\\end{aligned}"]] % pandoc -f latex -t native \begin{equation} 2+2 \end{equation} [Para [Math DisplayMath "2+2"]] It parses both as display math, but when 'align' is used it adds an 'aligned' environment. So, effectively pandoc treats \begin{align} ... \end{align} like \[\begin{aligned} ... \end{aligned}\] I realize that these are not the same in LaTeX, since the former creates a numbered equation but the latter does not. Eventually we'd like to have a more sophisticated system for labels and cross-references, which would allow us to properly represent equation numbers, but currently we do not. As you note, when we're targeting html+mathjax we could just pass through the 'align' environment verbatim and let mathjax deal with it. But the latex -> html translation is the composition of two independent translations, latex -> native and native -> html, and the first of these tries to produce something that will render properly in any output format. When looking into this, though, I noticed that the markdown reader actually behaves differently. When you're going markdown -> mathjax, the markdown (with embedded latex) \begin{align} x \end{align} is transformed into \[\begin{align} x \end{align}\] which is essentially what you want. This is perhaps an odd inconsistency. We could of course have the LaTeX reader behave the same way, but this would give worse results when converting to formats other than HTML+MathJax. So I'm not sure. David Roundy writes: > I'm wondering if there is any way to make pandoc preserve the math enviro= nment when compiling from latex to HTML? It seems to always forgot whether = I used \begin{align} or \begin{equation}. They aren't the same, and I know= the difference and mathjax knows the difference. > > --=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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/097b8e79-fbf1-4a7c-b626-a50995b0752c%40googlegroups.com. --=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/m2sgqggrrw.fsf%40johnmacfarlane.net.