2

What I know/I tried so far:

  1. \spadesuit or \spades renders spade with filled black color.

  2. Similarly, \clubs or \clubsuit renders club with filled black color.

  3. Now \hearts or \heartsuit just renders heart with white filled bg.

  4. \colorbox treats this as a box/rectangle, thus hiding the shape obviously.

  5. I can get black diamond as \blacklozenge

Please see this in new tab

Also, I get it that club and spade are black and the diamonds and heart are red in a deck, but I want heart symbol in black as well.

How can I get that? Thanks.

Asked on github too : https://github.com/KaTeX/KaTeX/discussions/2546

JustCurious
  • 344
  • 5
  • 15

1 Answers1

0

Credits and thanks to : Ronkok

KaTeX \hearts and \heartsuit render a heart outline, ♡, U+2661, , so they do not help you. The Unicode character for a filled heart is ♥, U+2665. That glyph is not in the KaTeX fonts, but you can still use it and KaTeX will substitute the glyph from the Times New Roman system font.

KaTeX emulates LaTeX, and this is not a LaTeX function, so KaTeX will write at least one error to the console (two if in strict mode). If you don't mind a console error, then no worries. KaTeX does render the heart. Just copy ♥ and paste it into your work.

Until there is any further update, this is what'll we have to work with guys.

JustCurious
  • 344
  • 5
  • 15