I want to create an automatic numbering with a black colored box around each number .I have searched a lot but not able to find a suitable package .
please help me. Thank you

Asked
Active
Viewed 81 times
1 Answers
3
Here is my suggestion based on an adapted version of ℝaphink's answer and the use of the tasks package for the horizontal lists:
\documentclass{article}
\usepackage{tikz}
\newcommand*\boxednumber[1]{\tikz[baseline=(char.base)]{%
\node[shape=rectangle,fill=black] (char) {\color{white}#1};}}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{tasks}
\settasks{label=(\Alph*), label-width=2em}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}[label=\protect\boxednumber{\arabic*}]
\item \textbf{What is the value of...}
\begin{tasks}(2)
\task $-\dfrac{4}{5}$ but not $\dfrac{4}{5}$
\task $-\dfrac{4}{5}$ but not $\dfrac{4}{5}$
\task $-\dfrac{4}{5}$ but not $\dfrac{4}{5}$
\task $-\dfrac{4}{5}$ but not $\dfrac{4}{5}$
\end{tasks}
\item \textbf{Two isosceles triangles...}
\begin{tasks}(4)
\task 25:35
\task 25:35
\task 25:35
\task 25:35
\end{tasks}
\item \textbf{In an Arithmetic sequence}
\end{enumerate}
\end{document}
leandriis
- 62,593
