Tran Le Nam
Please help me draw two kinds of calculator keyboards as the below figure. How is it used for LaTeX code?

Many thanks!

![HinhMayTinh.png](/image?hash=7b2868052ec6541159c627ace9a924e4f1e7afedbeb886d8e6e058c9d4da5d76)
samcarter
There are several packages which provide calculator keys, for example the [tipfr package](https://www.ctan.org/pkg/tipfr) which


\documentclass{article}

\usepackage{tipfr}

\begin{document}

\centering

\Touche[principal={on}]

\hrule

\Touche[principal={shift}] \Touche[principal={on}]

\hrule

\Touche[style=number, principal=0]
\Touche[style=number, principal=1]
\Touche[style=number, principal=2]
\Touche[style=number, principal=3]

\Touche[style=number, principal=4]
\Touche[style=number, principal=5]
\Touche[style=number, principal=6]
\Touche[style=number, principal=7]

\Touche[style=number, principal=8]
\Touche[style=number, principal=9]

\end{document}


![Screenshot 2021-08-02 at 11.17.28.png](/image?hash=5d678a743324c12a2ea4a7c3543fe7b75f57e824335b48335dbc9b61511b21d5)

Or if you prefer a more Casio-like look, you could use the [graph35 package](https://ctan.org/pkg/graph35)


\documentclass{article}
\usepackage[
%color=blackandwhite
]{graph35}

\begin{document}

\centering

\key{ACON}

\key{SHIFT}\key{ACON}

\key{zero}\key{1}\key{2}\key{3}

\key{4}\key{5}\key{6}\key{7}

\key{8}\key{9}

\end{document}


Or you could use tikz and give the buttons whatever look you want:


\documentclass{article}
\usepackage{tikz}

\newcommand{\key}[2][]{\begin{tikzpicture}
\end{tikzpicture}}

\begin{document}

\centering

\key[ellipse]{ON}

\key[ellipse]{ON}
\key[ellipse]{SHIFT}

\key{0}
\key{1}
\key{2}
\key{3}

\key{4}
\key{5}
\key{6}
\key{7}

\key{8}
\key{9}
\end{document}



\documentclass{article}
\usepackage{tikz}

\newcommand{\key}[2][]{\begin{tikzpicture}
\end{tikzpicture}}

\begin{document}

\centering

\key[ellipse]{ON}

\key[ellipse]{ON}
\key[ellipse]{SHIFT}

\key{0}
\key{1}
\key{2}
\key{3}

\key{4}
\key{5}
\key{6}
\key{7}

\key{8}
\key{9}
\end{document}


![Screenshot 2021-08-02 at 16.28.00.png](/image?hash=764dc6b72b8ab98418e175b2acaa3c109db639ce344c0dfd65b4f78354052971)
Skillmon
An option missing from [@samcarter's wonderful answer](https://topanswers.xyz/tex?q=1872#a2102) is menukeys[^1].

Though originally written for computer keyboards (and so there are a few special key names like \shift and so on). Placement would have to be done by some other means (either via Ti*k*Z or via tabulars):


\documentclass[]{article}

\usetikzlibrary{shapes.geometric}
% change the used style for the keys to have a shadow and the delimiter
% character between multiple keys for key combinations (the package default is
% + which seems unhandy for calculator keys).

{% set the TikZ style which should be applied for each key
,minimum width=2em
,font=\relsize{-1}\sffamily
,ellipse
,inner ysep=0pt
}
[% set the separator between multiple keys
\hspace{0.2ex}\hspace{0.1em plus 0.1em minus 0.05em}%
\hspace{0.1em plus 0.1em minus 0.05em}%
]
{gray}

\usepackage{collcell} % will also load array
\usepackage{expkv-cs}
% define a new column type which typesets the column contents using the \keys
% macro. The column type will be called k and accept an optional argument
% which has a small key value interface (powered by expkv-cs so we don't have to
% add some expansion chain here to get the column type)
\newcolumntype{k}[1]{}
\makeatletter
\ekvcSplit\keys@col@parse
{
type=\keys
,align=c
}
{%
\@temptokena\expandafter
{\the\@temptokena>{\let\keys@col@#1\collectcell\keys@col}#2<{\endcollectcell}}%
}
\ekvcSecondaryKeys\keys@col@parse
{%
nmeta oval=type=\okeys
,nmeta rect=type=\keys
,nmeta c=align=c
,nmeta l=align=l
,nmeta r=align=r
}
\renewcommand*\NC@rewrite@k[1][]
{%
\keys@col@parse{#1}%
\NC@find
}
\newcommand\keys@col[1]{\if\relax\detokenize{#1}\relax\else\keys@col@{#1}\fi}
\makeatother

\usepackage{booktabs}

\begin{document}
\keys{\shift}\keys{ON}

\okeys{\shift;1}

\bigskip

\begingroup
\tabcolsep=1pt
\extrarowheight=1pt
\begin{tabular}{*4k}
\toprule
\multicolumn{4}{k[oval]}{ON} \\
\midrule
& \shift & ON \\
\midrule
0 & 1 & 2 & 3 \\
4 & 5 & 6 & 7 \\
& 8 & 9 \\
\bottomrule
\end{tabular}
\endgroup
\end{document}


[^1]: Disclaimer: I somehow ended up being one of the maintainers.