From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26068 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gwern Branwen Newsgroups: gmane.text.pandoc Subject: Re: Colored equations? (particularly compiling to HTML) Date: Sat, 5 Sep 2020 23:16:57 -0400 Message-ID: References: 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: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31887"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDFJXQMSYMIRBTVJ2H5AKGQEOHHH32I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Sep 06 05:17:38 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f190.google.com ([209.85.210.190]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kElBS-00087X-LE for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 06 Sep 2020 05:17:38 +0200 Original-Received: by mail-pf1-f190.google.com with SMTP id o21sf6208383pfd.14 for ; Sat, 05 Sep 2020 20:17:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1599362257; cv=pass; d=google.com; s=arc-20160816; b=XoT07gtDNZ2SzOJtj5bHT9dDwbkgB6LOqhhxS03vbX/7Y8xvlxCwfWzlVP19Z/aQ39 lJFD03xcRt4Oe840vN1O+SJt1beW6oR9dCsm6OazAOFboo/BfUHwwhrcqxBCRROONnTP JQ4/0pfhApE5Ai1esWzv8QgbMdUSdfNaC0p/Noo0iPwsjE/BXpXNAUlcSK8eS/JKi4ca 4fXF4/YjBWH703/1q/u9UzBkHtTOMzcFHx3v2mCndPXH069mHYvSIfF3OhvEAPWg24B4 asmayD16fidBE7M5tjE9byYlQ6AA57tHXf8pARZ+utTDjpECUmzEXmMu4bJ47Yrz7UoI J33Q== 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:content-transfer-encoding :to:subject:message-id:date:from:in-reply-to:references:mime-version :sender:dkim-signature; bh=y1PRihpHhh+uB+U4QNeu2de5lKbe/z5J6mCDOImXKew=; b=GHRYZRMxPpKgJj8PTKtJwS2otfqhzfc28FFVmATJA5bwnzkQKYbaxAR1g8uWzOdfh1 4Xq3M08H76is6Ac6qHN9K6hZjjtEcMupp0lb0Zt+vHxG7Z4uowAbSpbhqnjwvXfy+15R AsUikrynMiYosMO7z5lVXewyyfUI29gmoRbd87XVxPfB1OjvTtqEe1i6pUhUjYq3nspm nWC2zqcravqelQxm1iG4RUv60srxiNdDfPGAhA/PT+Z2pJE90OBdupi0p+aIL+2dxT2M B64Ca9f+UURhWZD11iFWFGwccib4H8zO7AIC+e0A+R7Ktr/nFwDBc6VpjGhIerUoA3TP xSHA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.166.175 as permitted sender) smtp.mailfrom=gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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:content-transfer-encoding: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=y1PRihpHhh+uB+U4QNeu2de5lKbe/z5J6mCDOImXKew=; b=Ne/clzwvEVt2MBE7crjSM+lSCnpAL8inh3BoidWaUo8Kgxmm/z8VTJwikZZ+hSB6Z9 Vow8wQCM5Jnrvba/fr0WOAOt79n3F4YnjV4nZ2JCyh2NNWukqLzIpOTNTDa56J6/j4zK Sw3IMAPRwoLmXTvbrhvjt89HwzB4Qy5j+pB6eU+aDn+ZkHNgmDwiFFiS0HZ1sE7avOHT +lEvyZ2bALQoEeP8Dlrb+gWQPS6bCXKo3tqSGzXD4SbvRfxPouH1NLVy+rPTMoLQj69U bJtjrrsk+85y56Xh3NZRseOJMWy48LTWJxYCBmhh0oI7QYZxp0iwLevEeiLVTqtfGjL4 X5vQ== 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:content-transfer-encoding :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=y1PRihpHhh+uB+U4QNeu2de5lKbe/z5J6mCDOImXKew=; b=b1GUcXZHMctE9f43w+rrKJ3I7KcsmWIE8yM8jyt1QdhT6LF/DQEGN13gr4aKKa/7t7 hKqkKjTqtvtv3etE53nZsstRPN0OoPK2u66udjPfPFiA7pON84KlqVuqBPO63zInuor6 fql9BaqlJBdDK0L8etU1PjGDQ2fKo9MVahUvk4ZfihZy+DNqzdD0IBjdPMxq4OwgeYrK 4aV5dQxnJIpA+3Lj7h3VZLMnbBMpWnIdfqnt1FEWI4KQKswUzqj/qBceKfyzlsXZ8RN0 xkq/UF0yjCBQ4uceo2RC5qSNiZ5UgAdb6E3uglOeO1+5GndQF9+u1R1cHTl96RHToULm Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531slO0/IM4S6IsfqdVf+nLltV4v3LoLQfDYazF+l0OOdw01pPYK RMvviWATzbsrg02t9vC3ktQ= X-Google-Smtp-Source: ABdhPJz/d4cxOR+/burjgC62jjNFVGMD8d+4xL9qllkrZOrIb0V9k/pDTwSBs3FtIo1I1C2/6L3WUQ== X-Received: by 2002:a17:90a:ea0c:: with SMTP id w12mr14698933pjy.65.1599362257214; Sat, 05 Sep 2020 20:17:37 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:902:7596:: with SMTP id j22ls6378941pll.8.gmail; Sat, 05 Sep 2020 20:17:33 -0700 (PDT) X-Received: by 2002:a17:90a:d246:: with SMTP id o6mr7354062pjw.211.1599362253647; Sat, 05 Sep 2020 20:17:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599362253; cv=none; d=google.com; s=arc-20160816; b=oQtuUyrvtAfxSvp3b68CklojbDarwnzA8TA36sN0kaY08KQ7R+lkJnFhdz7B4sJ74p XBg+o1MPDSRVDE0VKYYxS8huHosX2AIMKFdOXG1zVESvQJLf4mEnTbdeHDMYPpYXC70b ifrLxFW9BNnkgf2fJaJqbkak5eb0GGQAuWPLgCYmHfXWGC1WRYz2SQzZu8qKQ/Snegkb vNwWVLifDpI6wv4yU9wJUBnWWeqvwzwBmqJVTs+cu67I6FIeYtsHZHkG4vSwPl/DSVae zwSYmsGpc8ZvA5AkR9ihaqXaMVmI6UgRcP+V1Sd2R3n45wJpflK5yBurLB1t6Y0fB3gF GfXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=HrJJcu89dmkcgNSS9C2resjekKl7SWDFSTOyrrYQKdQ=; b=U9x2KSIq9hccQmVMdB/OX1Z6pzA5N6pfLZyGnL7cs5LJmyzJfOO55SX3N8R47pnOE6 7FNXMwet+MCp3gcGm5NStz0R6ydUmQb1gxu+Hm+NhizFHdVKsIynHTSd0673ISRz5xwf cZKWJoEPgROASIiwOZGV/8smp9kx77+gG6zbA30reieodbSlaSMsxxJdb9e8oXlrwxtZ S/XSae6fAu+yA+b3kTurabqPtdHsisZHqb4SWLjQW3TCX9q2GVQqMH63grDuamtwIgyy CO3rjAznqiNNA+y9dHsWk2oVmRIxMSFSypfE2rinFsb0YBZUA0ZFvWAlJXBKhU0dQzKI uhvw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.166.175 as permitted sender) smtp.mailfrom=gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-il1-f175.google.com (mail-il1-f175.google.com. [209.85.166.175]) by gmr-mx.google.com with ESMTPS id v17si674997pjy.3.2020.09.05.20.17.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Sep 2020 20:17:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.166.175 as permitted sender) client-ip=209.85.166.175; Original-Received: by mail-il1-f175.google.com with SMTP id w5so1760414ilo.5 for ; Sat, 05 Sep 2020 20:17:33 -0700 (PDT) X-Received: by 2002:a92:35da:: with SMTP id c87mr12843585ilf.61.1599362252818; Sat, 05 Sep 2020 20:17:32 -0700 (PDT) In-Reply-To: X-Original-Sender: gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of gwern0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.166.175 as permitted sender) smtp.mailfrom=gwern0-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:26068 Archived-At: On Wed, Mar 18, 2020 at 11:27 PM Gwern Branwen wrote: > In an earlier discussion of Pandoc->Docx ( > https://groups.google.com/d/msgid/pandoc-discuss/aa5ab201-d3a6-44e2-807d-= 3f92a97f7a8b%40googlegroups.com > ), John says that the texmath package doesn't support the necessary > TeX color library, so you can't simply write out color annotations in > native TeX expressions with $/$$. > People writing Latex->PDF presumably can just use that color library dire= ctly. So to follow this up more, the weakest link seems to be Texmath. On the server-side end, the Latex 'xcolor' package is imported by default by Pandoc, so anyone writing Markdown->PDF can just use colors directly without even modifying the imports or anything: https://bookdown.org/yihui/rmarkdown-cookbook/font-color.html > For PDF, we can use the LaTeX command \textcolor{}{}. This requires the L= aTeX package xcolor, which is included in Pandoc=E2=80=99s default LaTeX te= mplate. Which is also confirmed by https://pandoc.org/MANUAL.html#creating-a-pdf And on the other hand, on the client-side end, Mathjax also supports color in equations: https://docs.mathjax.org/en/latest/input/tex/extensions/color.html > This extension is loaded automatically when the autoload extension is use= d. ...The color extension defines the \color macro as in the LaTeX color pa= ckage, along with \colorbox, \fcolorbox, and \definecolor. It declares the = standard set of colors (Apricot, Aquamarine, Bittersweet, and so on), and p= rovides the RGB, rgb, and grey-scale color spaces in addition to named colo= rs...in version 3 (and in LaTeX itself), you would do > > `{\color{red} x} + {\color{blue} y}` So we have the situation that if you write Latex directly for Mathjax in your final HTML, it works fine (example: https://adereth.github.io/blog/2013/11/29/colorful-equations/ ), and if you write Latex directly in your Markdown, it works fine by default (for PDFs), but then it doesn't work at all* if you write Markdown for HTML? * I thought initially https://github.com/chdemko/pandoc-latex-color might work but the README is confusing and it seems to be for the special-case of colorizing body text, not equations, and for Markdown->PDF only. There don't seem to be any other relevant filters for color. So I suppose you would have to go the full-blown 'render arbitrary LaTeX as SVG/PNG and inline' filter route in order to do Markdown->HTML colorized equations? --=20 gwern https://www.gwern.net --=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/CAMwO0gzotcqk5J0uHvp3YZqmfhmistbkbv7Mv-QLq5vqdbD7LQ%40mail.g= mail.com.