From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26077 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Colored equations? (particularly compiling to HTML) Date: Mon, 07 Sep 2020 11:04:11 -0700 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="4394"; mail-complaints-to="usenet@ciao.gmane.io" To: Gwern Branwen , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBKPM3H5AKGQERQZBU7Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Sep 07 20:04:30 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f184.google.com ([209.85.210.184]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kFLVG-0000sj-37 for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 07 Sep 2020 20:04:30 +0200 Original-Received: by mail-pf1-f184.google.com with SMTP id h15sf8744308pfr.3 for ; Mon, 07 Sep 2020 11:04:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1599501869; cv=pass; d=google.com; s=arc-20160816; b=q+kbwz7e4JaCDPK83VUuo4OBls85qBoc0s0g+BdmiAMsRCVPvoDTMauzOT3bkRsGsD L/X2HkVLcomeaOYedVo19pKgVXZNuFUFpnuCYDDH6MqT+7OOB6OexG9zVg+b/0S7dqYy zBSLIz9oWE5SahkWXVxQiVwe+/NAeiJYZM2MQ1YmD+CXUB09GnxR0yFJydIqtMJ3WVHs rL8sMVwLdBM5EcNrX8LQYmKg2QWO87zIwoJRak7Ek2lm9TDpVgAjzfk7jG0SBnBBFda4 rF6piAv2OLWy/o/xyelXj4dwfTHVFJn37LPfLo3vniSNZg/bIfM/nYtW7wTvAVDsKDLJ dVOQ== 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 :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=Q1j5lKI+rOlAx2h1uUaRboT299FlAwTvalpHqyfzg0I=; b=aZ6RG8rUw4SOLoPCBxMkT40z/lfU6cJQ/3IVlxhmm/x3JsTSOOF6OvKv/muIscEZTV C3qkvB110y1RahEKNqmT4zFLMLzBi1xQnwjDd0GqSuETmgmOyjNECjOk/kl4Yae1WMQP 7MkUjNKvQ2je0MKLGgsOEPmONZiynNWySKQWnCs2+yhEt+nmnGszcEkEJdOH4TFCTOfn mhsyppphPkyBj4mckq4pa5xOmFwS/aRIJmNejG7VzJPNEtcTyWUxDmhLSmAGWuCoPK44 OhOtEMFkGe3AkS+OP26G1HdqgbngoNNHiXVD5qRoIBAioJ1yBEHSkVASbB/+bd9OTFbz E0fA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=IKvOD8x5; 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: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=Q1j5lKI+rOlAx2h1uUaRboT299FlAwTvalpHqyfzg0I=; b=FUa2KrLdcRKqIYSmd5Uw5iTxz5aTvR3Z+FLaotQN5zfb8xxA8PtqrKPy/WsDE7pRVZ o3wLqrHq0RONjNbOzvQ9cmMI0sFR85Mc2sggDs671Im5m3oKAcOuedwjuuqZyzEWpe/Y yorklDpPb6SeUO5G3hy7jrpERGaZO0DM/jGi9EXFUVITAU/CMeh9YY2nyaCC9cAKAGLj zK5Qqt3Gq38DY1XvaLpjG2TNJfdm1A+Nws9b/zwvUmE7Y9O/naIIe0EMxlVf1DjxctNd MUWULfQpTRuqzNGMHuPPValoIKzU7Q2YGu4PUyxomDuoTGYhV0lGAOIlfQalM1rfMn6n I/FQ== 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: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=Q1j5lKI+rOlAx2h1uUaRboT299FlAwTvalpHqyfzg0I=; b=O5Ja850rP8jKyG+9TMes1q4D1+wL5tcPD3iq7phN9hvtcQt8/p+6aUP8e6AA2qLdvW kTJbJgxjqRiNnSPJnul7Q8tuha0HkqbG4zyOjwAAwMzaphyxYsOcvOs5nw7fBS5Nk7OY f+E9A3SEv0VquBt7ExXOm/bGQPcuCrJHeKEmIVhmncrCLSV8vx8xguk2AlxxXlwF1eUC ISYa5KO5dZc9cuu6Oof5A/SlQiproQY+t3UXN5LcsXk7Mur8nLa8rJOSCjdBhCvPal0D RE3GBrNy43rWVq//ebe/cUcJAoDcrwdMi/WDUx+Ju5ojD/ntdhTB8YlAGQhW+2zqFPw0 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531MsE/YqTupJI7OmCpL7zsD3/b68tpi6XyClF6HyIRKhkAt78Ds 9JUM9qP6HZsrO3l7yksJFWs= X-Google-Smtp-Source: ABdhPJzrmA8eSfWvtQoKXHW+QTWrc99HB3kBE4RQf3oYffpDCjNEXlHacRE1Crby1GDk/oIXkV3fiQ== X-Received: by 2002:a63:6782:: with SMTP id b124mr18182008pgc.308.1599501868823; Mon, 07 Sep 2020 11:04:28 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90b:3590:: with SMTP id mm16ls79770pjb.3.canary-gmail; Mon, 07 Sep 2020 11:04:24 -0700 (PDT) X-Received: by 2002:a17:90b:108e:: with SMTP id gj14mr397848pjb.225.1599501864654; Mon, 07 Sep 2020 11:04:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599501864; cv=none; d=google.com; s=arc-20160816; b=otudyBe/JMV4unzFW+42FH6a3rD8gIzVsoijtusg0QQy58ZR3AYZ1LhNDaFnHFnfoc ZqxlV5fLFiz1vau1SxDXZC2koMQbRSVgj0X4lvaXnAqWx3pvq1dhu+8igI5qzTHvflQ3 n2bztjvUlcQ54dNNg70rtsyll7e4C+ism3GRrc49kyN2Jxd7x395XG1mVSgANSxu43YS 7qzLcPS8XkxV4ETSjO6kLlHS3W9KRbNUj/9X4K7T8wEHF9vrZKOa2MCdeyQFf9MzMNsp 2AzJYU4sHoEx8+kIsAfrQPActrQEA2WPEO60epHmxtbY6hI9iXdpIRemlep0+F1uANwq lEUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=gh1hN+77ru6FHbnRyM2bf7WpvW6K8TgLoh4hkJurn88=; b=FZ6w6vgInlOkSX/Z8Tueyaijhv7Mzh7dd8gflGlppStTTWQDarlAZge89Kh11uxSH5 lRzS7d/sXRTi5RoriD+5dNr/t+PR3NtqZv4U+8MsC0jjsorjdRPWH4K/I6CP1oU2xYLE /3mwR5HjNxDs7mlsXKK9dJFmtn8i6iEHBdf+59hYqP6uV1msH3PIuBJtF5jm6O6ehkpo rFK+kY5ZHOP77HrKcODwOH6oLgzeoIMus73j7lDuM2HQmMQvUHFgBxNgyscaeXRibizV UIHxfikJokpgidGW0ESi/cvtmgJniRI1V3FCT8SdyU8lqU8uQdBOXClqbhS4RpsnG1fA 4/2A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=IKvOD8x5; 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 a199si1097970pfd.1.2020.09.07.11.04.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Sep 2020 11:04:24 -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 a8so4761413plm.2 for ; Mon, 07 Sep 2020 11:04:24 -0700 (PDT) X-Received: by 2002:a17:90a:c781:: with SMTP id gn1mr390115pjb.151.1599501863764; Mon, 07 Sep 2020 11:04:23 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id f12sm1263717pjm.5.2020.09.07.11.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 11:04:22 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 3620DA2A1; Mon, 7 Sep 2020 14:04:12 -0400 (EDT) In-Reply-To: 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=IKvOD8x5; 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.io gmane.text.pandoc:26077 Archived-At: If you use the --mathjax option, the math should be passed directly through to the HTML, e.g. % pandoc --mathjax -t html5 $\color{red}{x}$

\(\color{red}{x}\)

So the texmath limitation shouldn't make any difference if you're using MathJax. Gwern Branwen writes: > 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 dir= ectly. > > 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 = LaTeX package xcolor, which is included in Pandoc=E2=80=99s default LaTeX t= emplate. > > 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 us= ed. ...The color extension defines the \color macro as in the LaTeX color p= ackage, along with \colorbox, \fcolorbox, and \definecolor. It declares the= standard set of colors (Apricot, Aquamarine, Bittersweet, and so on), and = provides the RGB, rgb, and grey-scale color spaces in addition to named col= ors...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= 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/CAMwO0gzotcqk5J0uHvp3YZqmfhmistbkbv7Mv-QLq5vqdbD7LQ%40mail= .gmail.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/m28sdlv4ys.fsf%40MacBook-Pro.hsd1.ca.comcast.net.