3

I would like to write multiple dots in some formation (in circle, in a row, etc.) within text or formulas. Somewhat similar like the token dots in petri nets, which made me look into the TeX/Tikz petri net package. But I need the dots independently from petri net drawings.

To make it more clear, I would like to be able to do something like this:

Some text and now \tokens{3} and some more text.

Or alternatively within math mode:

$dots(3) = \mathtokens{3}$

I any case, I need to put the (in this case 3) dots in-line.

1

1 Answer 1

5

For straight-line dots, this approach may suffice...

\documentclass[12pt]{article}
\usepackage{stackengine}
\newcommand\tokendots[1]{\ifnum#1>0\relax
  {\ensuremath{\cdot}}\tokendots{\the\numexpr#1-1}\fi}
\newcommand\stackedtokendots[2]{%
  \stackanchor[-2pt]{\tokendots{#1}}{\tokendots{#2}}}
\begin{document}
Some text and now \tokendots{2} and some more text.

$dots(5) = \tokendots{5} = \stackedtokendots{2}{3}$

$dots(6) = \stackedtokendots{3}{3}$
\end{document}

enter image description here

You must log in to answer this question.

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