8

I play and teach bridge, and the shape of hands is very important. For instance:

KJ854
Q9842
8
A3

is easy to recognize as equal-length majors (top two rows). But then there's the ten.

Various style guides have options for this card; all of which are designed to minimize the "shape" problem. Either use spaces:

K J 10 8 5
Q 9 8 4 2
8
A 10

(but that doesn't work completely - the spades still look longer than the hearts, just not quite as bad as KJ1085 Q9842) or use "T" for ten:

KJT85
Q9842
8
AT

(but the card has "10" on it, not "T", and it's hard to read!)

In unicode there are several characters that are single-character-width 10, but never naked (10-in-circle, 10-as-playing-card, 10-full-stop, ...) Is there a native (i.e. normal font) or simple way in LaTeX to get a single-width "10" element?

3
  • A very cheap-and-dirty way would be to use some non-Latin letter visually similar to “10”, e.g. the Cyrillic Ю: AJЮ83. May 14, 2021 at 22:39
  • 2
    There is the onedown package designed for typesetting bridge hands and play. It requires you to enter T for 10, but it displays 10 with extra kerning so that the two characters sit closer together. If you google there are also quite a few other bridge typsetting packages floating around that are not on CTAN. May 16, 2021 at 3:29
  • Had not seen this. I was looking at tweaking the taigabridge.net/latex/index.htm grbbridge package (which does everything I want, I know the writer, and use his other bridge package already, but didn't handle kerned 10). Now I have more options. Thank you all.
    – Mycroft
    May 16, 2021 at 15:51

3 Answers 3

11

You can use

\makebox[2em]{1}...\makebox[2em]{9}...\makebox[2em]{10}...\makebox[2em]{K}

and they will all be 2em wide, choose whatever width works best for the font you are using.

Here are three versions, a spacy version with 2em width and 10 normally spaced and a tighter version using 1em spacing and 10 squeezed slightly and a ver y tight version.

enter image description here

\documentclass{article}

\begin{document}

\makebox[2em]{1}\makebox[2em]{9}\makebox[2em]{10}\makebox[2em]{K}

\makebox[2em]{10}\makebox[2em]{J}\makebox[2em]{Q}\makebox[2em]{K}


\bigskip


\makebox[1em]{1}\makebox[1em]{9}\makebox[1em]{1\kern-.1em0}\makebox[1em]{K}

\makebox[1em]{1\kern-.1em0}\makebox[1em]{J}\makebox[1em]{Q}\makebox[1em]{K}


\bigskip


\makebox[.8em]{1}\makebox[.8em]{9}\makebox[.8em]{1\kern-.16em0}\makebox[.8em]{K}

\makebox[.8em]{1\kern-.16em0}\makebox[.8em]{J}\makebox[.8em]{Q}\makebox[.8em]{K}

\end{document}


Once you have decided the tweaks you want, you can abstract that into a command, something like

enter image description here

\documentclass{article}

\def\tmpx{10}
\newcommand\Cd[1]{%
  \makebox[.8em]{\def\tmp{#1}%
   \ifx\tmp\tmpx
     \kern-.05em1\kern-.12em0%  10
   \else
    #1% not 10
   \fi}}

\begin{document}

\Cd{1}\Cd{9}\Cd{10}\Cd{K}

\Cd{10}\Cd{J}\Cd{Q}\Cd{K}

\end{document}

You could also test for other letters, Q could perhaps have a slight adjustment to the left as well.

3
  • I'll see how this works when embedded in full hands. I think this will work very well, given the other issue is spacing (all hands have 13 cards in 4 suits, but might be 5512 like my example, or 3433, or 1192). I see the same \kern game that Oni suggested here as well; I think a combination of the two (make a newcommand \T and set cards in \makebox-es in a \hand macro) will solve my problem nicely. Will wait a bit before accepting an answer.
    – Mycroft
    May 15, 2021 at 15:04
  • @Mycroft yes either way you'd want a macro that abstracts away any tweaks that you decide, you don't want to be puttting makebox[1.23457em explicitly all over the document. May 15, 2021 at 15:58
  • 1
    @Mycroft note it isn't just 10 that I have forced here, but JQK are also forced to the same width as are the digits. so you'd probably want more than just a\T macro, something like \Cd{1}\Cd{10}\Cd{J} defined as \newcommand\Cd[1]{\makebox[1.5em]{\def\tmp{#1}\ifx\tmp\tmpx1\kern-.16em0\else#1\fi}} \def\tmpx{10} May 15, 2021 at 16:06
6

One can use \newcommand{\T}{\kern-.3em 10},

If 1 and 0 need to be closer set kerning between them

\newcommand{\T}{\kern-.2em 1\kern-.2em 0}

8, 10, Q

with tabbing each tab can be define what length of spacing you want between numbers.

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Liberation Sans}
\setmonofont[Ligatures=TeX]{Liberation Mono}

\usepackage{xcolor}
\newcommand{\Heart}{\textcolor{red}{♥}}
\newcommand{\Spade}{♠}
\newcommand{\Club}{♣}
\newcommand{\Diamant}{\textcolor{red}{♦}}
\newcommand{\T}{\kern-.3em 10}
\begin{document}

{\Huge\ttfamily
\begin{tabbing}
\hspace{15mm} \= \hspace{15mm} \= \hspace{15mm} \= \hspace{15mm} \= \hspace{15mm} \= \kill
\> K \> J \> \T \> 8 \> 5 \\
\> Q \> 9 \> 8 \> 4 \> 2 \\
\> 8 \\
\> A \> \T \\
\end{tabbing}%
}
\end{document}

table

If one adds ♠♥♦♣ signs with font that support them like Liberation Mono

cards

1
  • The intent is to avoid the spacing (and bridge style sorts for suits, so we would write \Spade{}KJ\T\85\\\Heart{}Q9842. But I'll try the kerning. This solution would work well for on-the-fly writing; the makebox solution can be loaded into a \hand macro easily for presentation of all 13 well, and a \deal macro for the 4 hands, table, and other relevant information. Thanks for this!
    – Mycroft
    May 15, 2021 at 15:00
4

There is also the playing cards Unicode block. This is supported by various fonts, such as DejaVu Sans (Linux), Segoe UI Symbol (Windows), Symbola (cross-platform). You can enter the symbols directly or define macros to make it easier to enter a symbol.

MWE (compile with XeLaTeX or LuaLaTeX):

\documentclass{article}
\usepackage{xcolor}
\usepackage{fontspec}
\setmainfont{DejaVu Sans}
\def\acl{🃑}\def\iiicl{🃓} % macros to make entering easier
\begin{document}
\noindent Example:\\
🂮🂫🂪🂨🂥\\ % or enter symbols directly
\color{red}
🂽🂹🂴🂲\\
🃈\\
\color{black}
\acl\iiicl\\
\end{document}

Result:

enter image description here

2
  • I noticed the question mentions "10 as playing card" as undesired, but it looks sort of nice I guess :)
    – Marijn
    May 15, 2021 at 21:45
  • Yeah, that's too cute for the style of writing common to bridge. It's also very hard to read 13 cards. But still a good answer for other work, potentially poker writing. Thank you!
    – Mycroft
    May 16, 2021 at 1:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .