Sebastian Sauer
Sebastian Sauer

Reputation: 1673

Custom colors equation in epub format is not working

I am writing a document via Quarto in epub format which contains equations. I would like to use custom colors for the equations. However, this is not working.

Consider the following example:

---
format:
  epub:
    html-math-method:
      method: webtex
      url: https://latex.codecogs.com/svg.latex?
---

no color (working):
$e^2$

standard color  (working):
$\color{red} s^2$

custom color (NOT working):
$\color{#FF00FF} x^2 + \color{#00FF00} y^2 = \color{#0000FF} z^2$

Quarto check:

Quarto 1.6.8 [✓] Checking versions of quarto binary dependencies... Pandoc version 3.2.0: OK Dart Sass version 1.70.0: OK Deno version 1.41.0: OK Typst version 0.11.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.6.8 Path: /Applications/quarto/bin

[✓] Checking tools....................OK TinyTeX: v2024.07.03 Chromium: 869685

[✓] Checking LaTeX....................OK Using: TinyTex Path: /Users/sebastiansaueruser/Library/TinyTeX/bin/universal-darwin Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK Version: 3.11.1 Path: /Users/sebastiansaueruser/.pyenv/versions/3.11.1/bin/python3 Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK Version: 4.2.1 Path: /Library/Frameworks/R.framework/Resources LibPaths: - /Users/sebastiansaueruser/Rlibs - /Library/Frameworks/R.framework/Versions/4.2/Resources/library knitr: 1.48 rmarkdown: 2.28

[✓] Checking Knitr engine render......OK

Upvotes: 0

Views: 26

Answers (1)

Wayne
Wayne

Reputation: 9780

Did you try the following?

$\color[HTML]{FF00FF} x^2 + \color[HTML]{00FF00} y^2 = \color[HTML]{0000FF} z^2$

According to here quarto uses \color to add support for that and it looks to me like you aren't using syntax that seems to match the use of \color like here, specifically \color[HTML]{ABCDEF}. (Described in more general terms here with other options for specifying custom colors.)

Upvotes: 0

Related Questions