I’d love to create something like this using latex. 
There’s a great post achieving something similar with letters, so I think I just need some tikz code for the digits themselves. Is anybody able to help?
Thanks so much!
I’d love to create something like this using latex. 
There’s a great post achieving something similar with letters, so I think I just need some tikz code for the digits themselves. Is anybody able to help?
Thanks so much!
Here's a starting point for you. To better follow the code you cited I took the liberty to:
As Tikz can be overwhelming for the beginner, though it's "simple" once you understood its basic concepts, I suggest to study the 4 tutorials at the beginning of the pgfmanual several times. To separate frequently from less frequently used commands I suggest to focus on these first:
\draw and styles (put as [options]) ... ;\path ... ;Amongst the more advanced statements used here try to get the essence of these:
\foreach \X [count=\Y] in {A,1,4}
\X take values A, 1 and 4code={
...
}
\pic\pic as a kind of tikz-macroThat should make ~ 70 % of the code quite readable to you.
Finally, just introduce more digits inside the \tikzset-statement the way I indicated AND expand the list at the end of this statemen \foreach \X [count=\Y] in {A,1,4} . Take care to define the -mid coordinate somewhere in the drawing path, as it's needed to draw those lines of characters in the documents main-code.
Look for \arc, circle, ellipse for the other digits inside the manual, while recapitulating the path-concept : to perform a series of actions until the ; .
\documentclass[tikz,border=3mm]{standalone}
% ~~~ drawing on 3 layers, display-order as stated ~~~~~~~~~
\pgfdeclarelayer{background}
\pgfdeclarelayer{behind}
\pgfdeclarelayer{foreground}
\pgfsetlayers{behind,background,main,foreground}
% from https://tex.stackexchange.com/a/460842/121799
%
% ~~~ drawing each character ~~~~~~~~~~~~~~~~~~~~~
\tikzset{pics/.cd,
A/.style={
code={
% ~~~ the A's outer shape (start, up, down) ~~~
\draw[pic actions]
(0,-0.5) -- (0.3,0.4) -- (0.6,-0.5);
% ~~~ the A's line in the middle ~~~~~~~
\draw[pic actions](0.1,1/3-0.45) -- coordinate(-mid)
(0.5,1/3-0.45);
% ~~~│ some kind of advance ~~~
\path (0.7,0);
}
},
%
1/.style={
code={
% ~~~ the 1, with coordinate defined for the middle ~~~
\draw[pic actions]
(0.3,0.4)-- coordinate(-mid) (0.3,-.1) -- (0.3,-0.5);
% ~~~│ some kind of advance ~~~
\path (0.7,0);
}
},
%
4/.style={
code={
% ~~~ the 4, with coordinate defined for the middle ~~~
\draw[pic actions]
(0.5,0.4)-- (0.5,-0.5);
\draw[pic actions]
(0.1,0.4)-- coordinate(-mid) (0.1,-.1) -- (0.6,-.1);
% ~~~│ some kind of advance ~~~
\path (0.7,0);
}
},
%
}
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
\begin{tikzpicture}
\begin{scope}[local bounding box=letters]
% ~~~ left column of letters A-Z ~~~~~~~~
\foreach \X [count=\Y] in {A,1,4}
{
% ~~~ drawing upper and lower line for the characters ~~~
\draw[thick,blue] (0,-\Y-0.25) -- ++ (5,0) (0,-\Y+0.25) -- ++ (5,0);
% ~~~ drawing the character as a \pic ~~~~~~~~~~
\path[thick] (0.5,-\Y) pic[scale=0.5](\X){\X}% first solid character
% ~~~ introducing 4 dashed characters ~~~
foreach \Z in {1,...,4}
{(\Z+0.5,-\Y) pic[scale=0.5,dash pattern=on 1.5pt off 1.2pt]{\X}}
;
% ~~~ drawing the dashed red line in the middle
\begin{pgfonlayer}{background}
\draw[red,dashed] (0,-\Y|-\X-mid) -- ++ (5,0);
\end{pgfonlayer}
}
% ~~~ NOT NEEDED HERE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% % ~~~ right column of letters a-z ~~~~~~~~
% \foreach \X [count=\Y] in {a,...,z}
% {\draw[thick,blue] (6,-\Y-0.25) -- ++ (5,0) (6,-\Y+0.25) -- ++ (5,0);
% \path[thick] (6.5,-\Y) pic[scale=0.5](\X){\X} foreach \Z in {1,...,4}
% {(\Z+6.5,-\Y) pic[scale=0.5,dash pattern=on 1.5pt off 1.2pt]{\X}};
% \begin{pgfonlayer}{background}
% \draw[red,dashed] (6,-\Y|-\X-mid) -- ++ (5,0);
% \end{pgfonlayer}
% }
\end{scope}
% ~~~ NOT NEEDED HERE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% ~~~ putting all those blueish colors on paper ~~~
% \begin{pgfonlayer}{behind}
% \path[left color=cyan!10,right color=cyan!30]
% (letters.south west) rectangle (letters.north east);
% \end{pgfonlayer}
% \draw[line width=2mm,blue!30] ([xshift=-3mm,yshift=3mm]letters.north west)
% -- ([xshift=-3mm,yshift=-3mm]letters.south west);
\end{tikzpicture}
\end{document}
Thanks again!
– Wendy Taylor Sep 18 '23 at 09:28Thanks to your great help, I figured out the other digits. It was good fun!
\pgfdeclarelayer{behind}
\pgfdeclarelayer{foreground}
\pgfsetlayers{behind,background,main,foreground}
% from https://tex.stackexchange.com/a/460842/121799
%
% ~~~ drawing each character ~~~~~~~~~~~~~~~~~~~~~
\tikzset{pics/.cd,
9/.style={code={\draw[pic actions] (0.2,0.15) circle[x radius=0.2,y radius=0.25];
\draw[pic actions] (0.4,-0.5) -- coordinate[pos=0.5](-mid)(0.4,0.4);}},
%
6/.style={code={\draw[pic actions] (0.2,-0.25) circle[x radius=0.2,y radius=0.25];
\draw[pic actions] (0.0,-0.175) -- coordinate[pos=0.5](-mid)(0.3,0.4);}},
%
%
2/.style={
code={
% ~~~ the 4, with coordinate defined for the middle ~~
\draw[pic actions]
(0,0.25) to[out=45,in=45,looseness=2.5] (0,-0.45);
\draw[pic actions](0,-0.45) -- (0.5,-0.45);
\path (0.7,0);}},
1/.style={code={\draw[pic actions] (0.3,0.4) -- (0.3,-0.5);}},
%
4/.style={code={\draw[pic actions] (0.3,0.4) -- (0.3,-0.5);
\draw[pic actions] (0,0.4) -- (0,-0.1) -- (0.5,-0.1);}},
%
Is 5/.style={code={\draw[pic actions] (0.5,0.4) -- (0,0.4) -- (0,0.1)-- (0.15,0.1);
\draw (0.15,0.1) arc(90:-90:0.4cm and 0.275cm);
\draw[pic actions] (0,-0.45) -- (0.15,-0.45);
%\draw (-0.02,0.1) arc(90:-90:0.5cm and 0.3cm);
%\draw[pic actions] (0,0.1) to[out=0,in=0,looseness=3] (0,-0.45);
}},
%
3/.style={code={
\draw (0.0,0.35) arc(130:-90:0.25cm and 0.2cm);
\draw (0.15,0) arc(90:-120:0.3cm and 0.225cm);
}},
%
7/.style={code={\draw[pic actions] (0.0,0.4) -- (0.5,0.4) -- (0.2,-0.45);
}},
%
8/.style={code={
\draw (0.25,0.4) arc(90:-90:0.2cm and 0.2cm);
\draw (0.25,0.4) arc(90:270:0.2cm and 0.2cm);
\draw (0.25,0) arc(90:-90:0.25cm and 0.25cm);
\draw (0.25,0) arc(90:270:0.25cm and 0.25cm);
}},
%
0/.style={code={
\draw (0.25,0.4) arc(90:-90:0.25cm and 0.45cm);
\draw (0.25,0.4) arc(90:270:0.25cm and 0.45cm);
}},
%
}
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
\begin{tikzpicture}
\begin{scope}[local bounding box=letters]
% ~~~ left column of letters A-Z ~~~~~~~~
\foreach \X [count=\Y] in {1,2,3,4,5,6,7,8,9,0}
{
% ~~~ drawing upper and lower line for the characters ~~~
\draw[thick,blue] (0,-\Y-0.25) -- ++ (5,0) (0,-\Y+0.25) -- ++ (5,0);
% ~~~ drawing the character as a \pic ~~~~~~~~~~
\path[thick] (0.5,-\Y) picscale=0.5{\X}% first solid character
% ~~~ introducing 4 dashed characters ~~~
foreach \Z in {1,...,4}
{(\Z+0.5,-\Y) pic[scale=0.5,dash pattern=on 1.5pt off 1.2pt]{\X}}
;
}
% ~~~ NOT NEEDED HERE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% % ~~~ right column of letters a-z ~~~~~~~~
% \foreach \X [count=\Y] in {a,...,z}
% {\draw[thick,blue] (6,-\Y-0.25) -- ++ (5,0) (6,-\Y+0.25) -- ++ (5,0);
% \path[thick] (6.5,-\Y) pic[scale=0.5](\X){\X} foreach \Z in {1,...,4}
% {(\Z+6.5,-\Y) pic[scale=0.5,dash pattern=on 1.5pt off 1.2pt]{\X}};
% \begin{pgfonlayer}{background}
% \draw[red,dashed] (6,-\Y|-\X-mid) -- ++ (5,0);
% \end{pgfonlayer}
% }
\end{scope}
% ~~~ NOT NEEDED HERE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% ~~~ putting all those blueish colors on paper ~~~
% \begin{pgfonlayer}{behind}
% \path[left color=cyan!10,right color=cyan!30]
% (letters.south west) rectangle (letters.north east);
% \end{pgfonlayer}
% \draw[line width=2mm,blue!30] ([xshift=-3mm,yshift=3mm]letters.north west)
% -- ([xshift=-3mm,yshift=-3mm]letters.south west);
\end{tikzpicture}
\end{document}