48

\clubsuit, \diamondsuit and the like produce the familiar card suit symbols; however, the diamond and heart suits are empty (only outlined), while clubs and spades are filled. Is there a way to obtain the filled versions of \diamondsuit and \heartsuit in TeX?

A "clean" solution would be preferred, but even an ugly "take this shape and fill it" TikZ hack would do the job.

8 Answers 8

15
\usepackage{fdsymbol}

\clubsuit
\vardiamondsuit
\spadesuit
\varheartsuit
4
  • 3
    Welcome to TeX.SX! Please make your answer compilable, starting with \documentclass and ending with \end{document}. Could you add also some explanations why it works?
    – Bobyandbob
    Sep 20, 2018 at 6:31
  • Welcome to TeX.SX! It might be a nice touch to say a few more words ... although I admit that the answer is fairly clear as it is already. But you should definitely mention that the commands need math mode and thus can not be used in normal text as shown.
    – moewe
    Sep 20, 2018 at 6:31
  • Can you make with no fill?
    – k.dkhk
    Sep 12, 2019 at 9:35
  • 1
    Using fdssymbol package makes some other symbols weird-looking, including \sum and \int.
    – JACKY88
    Dec 14, 2020 at 15:27
45

As Alan has pointed out, the symbols are available in arev, which does normally change all your fonts. The following (added to your preamble) only takes the two symbols you want from arev.

\DeclareSymbolFont{extraup}{U}{zavm}{m}{n}
\DeclareMathSymbol{\varheart}{\mathalpha}{extraup}{86}
\DeclareMathSymbol{\vardiamond}{\mathalpha}{extraup}{87}

Unfortunately the style differs slightly from the default symbols:

$\heartsuit\varheart\diamondsuit\vardiamond\clubsuit\spadesuit$

example

3
  • The other two suits are 84 and 85. \DeclareMathSymbol{\varclub}{\mathalpha}{extraup}{84} \DeclareMathSymbol{\varspade}{\mathalpha}{extraup}{85} Strangely, 3 are filled and 1 isn't (spades)...
    – PatrickT
    Mar 16, 2013 at 11:03
  • @Caramdir: Can symbols from Computer/Latin Modern be imported in a similar fashion? I ask because Neo Euler lacks all of the card suit symbols, and it would be nice to import the club and diamond from Computer/Latin Modern. Dec 24, 2014 at 18:41
  • @emacsomancer I suppose. Please ask a separate question.
    – Caramdir
    Dec 25, 2014 at 8:37
15

The arev package provides \varheart and \vardiamond which are filled. (The Comprehensive LaTeX Symbols Guide is your friend here.)

\documentclass[12pt]{article}
\usepackage{arev}
\begin{document}
$\heartsuit\varheart\diamondsuit\vardiamond\clubsuit\spadesuit$
\end{document}

arev font output

Since arev changes the math font, it's maybe not the best solution. (But see Caramdir's answer for a way around that.)

The txfonts packages also provides \varheartsuit and \vardiamondsuit, but again changes the math font.

\documentclass[12pt]{article}
\usepackage{newtxtext,newtxmath}
\begin{document}
$\heartsuit\varheartsuit\diamondsuit\vardiamondsuit\clubsuit\spadesuit$
\end{document}

txfonts output

Alternatively, if you use XeLaTeX or LuaLaTeX, there are many fonts that contain these characters.

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\suitfont{Dejavu Sans}

\begin{document}
{\suitfont♠︎♣︎♥︎♦︎♤♧♡♢}
\end{document}

XeTeX output

5
  • 3
    The arev package does change the whole math font though.
    – Caramdir
    Jan 24, 2011 at 23:19
  • Also possible are \varheartsuit and \Diamondblack from the txfonts package, and these work without extra dependencies (txfonts package excluded. arev pulled two or three additional packages on my system). Maybe you'd like to edit your answer to include these? It feels wrong for me to post it as a separate answer. Jan 24, 2011 at 23:26
  • @Martin and Caramdir. Thanks. I've edited my answer.
    – Alan Munn
    Jan 24, 2011 at 23:53
  • can u provide detail tex file for reference
    – larrycai
    Jan 7, 2019 at 13:46
  • @larrycai I've added example documents for each method.
    – Alan Munn
    Jan 7, 2019 at 16:01
8

The symbols are available in the pifont package using

\usepackage{pifont}

in your preamble and

\ding{168}              % club
{\color{red}\ding{169}} % diamond
{\color{red}\ding{170}} % heart
\ding{171}              % spade

to access the different symbols.

7

Another font that provides the filled diamond and heart suit symbols is kpfonts. From the preamble of my template file for type-setting bridge stuff:

\usepackage{kpfonts}
\usepackage{color}

\newcommand*\Hs[1]{\ensuremath{{\color{blue} #1}{\color{red}\varheartsuit}}}
\newcommand*\Ss[1]{\ensuremath{{\color{blue} #1}{\color{black}\spadesuit}}}
\newcommand*\Ds[1]{\ensuremath{{\color{blue} #1}{\color{red}\vardiamondsuit}}}
\newcommand*\Cs[1]{\ensuremath{{\color{blue} #1}{\color{black}\clubsuit}}}
\newcommand*\NT[1]{{\color{blue} #1}{\color{black}\textsc{nt}}}

of course, this predicates on your willing to switch to a whole new font, so is in some sense inferior to the solutions already given.

3
  • Is it possible to only use these symbols from your font package without changing fonts?
    – ಠ_ಠ
    Feb 19, 2018 at 4:50
  • 1
    A variant of Caramdir's answer should work. You will have to go through the kpfonts.sty to find the font name (I think replacing the zavm with jkpss should work), and also find the correct numbers for the symbols somehow. You may want to ask a new questions so someone more familiar with how this works can give you a better answer. Feb 19, 2018 at 5:09
  • 1
    Here it is: \DeclareSymbolFont{extraup}{U}{jkpsyc}{m}{n} \DeclareMathSymbol{\varclubsuit}{\mathalpha}{extraup}{112} \DeclareMathSymbol{\vardiamondsuit}{\mathalpha}{extraup}{113} \DeclareMathSymbol{\varheartsuit}{\mathalpha}{extraup}{114} \DeclareMathSymbol{\varspadesuit}{\mathalpha}{extraup}{115} Diamonds and hearts are filled, clubs and spades are outlined.
    – GuiRitter
    Aug 22 at 0:47
5

I found an unexpectedly easy way here: https://tex.stackexchange.com/a/124347/80217.

\documentclass{article}

\usepackage{ascii}

\begin{document}
\ETX
\end{document}

enter image description here

4

The package amssymb provides the filled lozenge symbol \blacklozenge similar to the filled diamond.

4

You asked this question in 2011. As of 2020, the modern toolchain with unicode-math also supports \varheartsuit and \vardiamondsuit.

If your Unicode text font contains the symbols ♥ (U+2665) and ♦ (U+2666), you can load fontspec and enter them directly, or as as ^^^^2665 and ^^^^2666.

If you want to use them in text mode and your main font does not contain them, you could patch them in as follows:

\newfontfamily\symbolfont{DejaVu Serif}[Scale=MatchUppercase]
\DeclareRobustCommand\textheart{{\symbolfont\symbol{"2665}}}
\DeclareRobustCommand\textdiamond{{\symbolfont\symbol{"2666}}}

Another option would be to set a font for that entire block of symbols using ucharclasses.

2
  • Thanks; great to know Latex is getting better with time thanks to the work of many people. (By the way, quick question: does your snippet work in Pdflatex, or only in Xelatex?) Apr 28, 2020 at 6:38
  • @FedericoPoloni Either LuaLaTeX or XeLaTeX, but not PDFLaTeX.
    – Davislor
    Apr 28, 2020 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.