From mboxrd@z Thu Jan 1 00:00:00 1970 From: Norman Tovey-Walsh Subject: Re: equal syntax highlighting for publishing code blocks to html and pdf Date: Sat, 01 Feb 2020 08:53:20 -0600 Message-ID: References: <22BE5D0D-6438-4CC8-B4C6-0E755AF28FCA@nordakademie.de> <87imkqodw3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36850) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixu9N-00017T-En for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 09:53:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixu9L-00081D-Uf for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 09:53:33 -0500 Received: from outbound1p.ore.mailhop.org ([54.149.210.130]:13265) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ixu9L-0007wf-EN for emacs-orgmode@gnu.org; Sat, 01 Feb 2020 09:53:31 -0500 In-reply-to: <87imkqodw3.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Bastien writes: >> Frequently I publish org-mode documents containing source code blocks >> to html (htmlize) and pdf (minted). I would like to see the same >> colors in both export types. But >> I cannot figure out, what=E2=80=99s the best way to achieve this. >> >> Has anyone solved this problem? Are there any hints? On casual inspection, HTML export seems to derive the colors from the way Emacs has fontified the buffer. It appears to insert the colors literally, which I guess it has to if it=E2=80=99s going to base them on fa= ce properties. > If you find a solution, please mention it here, others may be > interested. I think there are two plausible ways forward. If you like the colors used by minted, you can try changing the faces in Emacs to match them. If you like the colors used by Emacs, you can change the colors used by minted to match. Minted appears to use pygments, so you could create your own style[1] and then use that style in your documents[2]. My own approach to printed output[3] doesn=E2=80=99t use minted yet, so I haven=E2=80=99t actually tried to do any of these things :-) Be seeing you, norm [1] https://pygments.org/docs/styles/ [2] https://tex.stackexchange.com/questions/218556/style-pygments-at-python= tex [3] https://so.nwalsh.com/2020/01/05-latex =2D- Norman Tovey-Walsh | The fact that an opinion has been https://nwalsh.com/ | widely held is no evidence | whatever that it is not utterly | absurd; indeed in view of the | silliness of the majority of | mankind, a widespread belief is | more likely to be foolish than | sensible.--Bertrand Russell --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1ury//rzuvqf7fN/hVWfHhJMAHkFAl41kOAACgkQhVWfHhJM AHnHDxAAx6QuVvhJyYcT/93+5KSYqvPx0n1HKVLwDJVBa5wtJ21M4mbA/srhH6VD WgNzkAWldghs40SOR/rSgLvzliNkVB/kL06ZVaJdKx8SkSaWBKCDqYWrgQJjPjMY uokKKaNnbFGLns0UTHfVFWQQBy7Dg2sG82zPgv1pGHZMy9QsqVXehooD6d5E6gmj HE/JbWopk6z8X41oDTgF8eqqvq8auJlf8CvaBViwf7Q7AE3IcGWX4uEqKdrvM0Qg d7wwNxoTObjmzFv9vTQsckA2TBU9utLUjkpFdT2i+lCHhk8g1qGPJCmAvcFpemPj MIVz//T/767Z+H0hHVswzDabnF7eLywbUksiZuo7TxGzwF0PvZbQ1/NwFan69PmA B0rxRAtKpbeBd0McEFVUNwGRFvRgWZUZbUJZcGOobiozO2Lf9bBJQbhtGzq3Mxk3 YynkGc/OwIhirZFqsdOigv6v0/AORS3ks6smAbL1zOLQUri1i7GkTQ0Cw4uu3XjG RdwdBoOUzpCKe8vwXvnFb9N8q8Q5RY63z7ti1GUng+rharxEh2SWx6XdtY5yWQbx WOlGhor51Red3Yxgcnl4uqT42b0r88CXE8POQvxJrhp990IzchGfWqWqHhn4iYBA ihSFvovKf/JmptQXG78oQPoXhds1UwSow5Wr9hkUmAksBSOGLb0= =904b -----END PGP SIGNATURE----- --=-=-=--