# Replace tasks with enumerate

I'm trying to reformat a separate tex file without having to change the source file. What I want to do here is convert a tasks environment to a simpler enumerate environment. It should be simple -- replace "tasks" with "enumerate" and replace "\task" with "\item."

I've tried many variations on the MWE theme below, but to no avail. I'm sure it's some really simple syntax that I'm just not getting. Thanks in advance for your help!

\documentclass[openany]{book}
\usepackage[most]{tcolorbox}

\begin{document}

\task $\pi$
\task $e^{\pi}$

\end{document}

• Do you want to keep the layout of tasks, but just use an enumerate environment? That is, skip (3) supplied to the tasks environment? Also, tcolorbox seems unnecessary in this example. Feb 1 at 19:52

Like this?

\documentclass{book}

\begin{document}

\task $\pi$
\task $e^{\pi}$

It is not (or only with some tricks) possible to define an optional argument with parentheses with \newenvironment. But it is rather easy with \NewDocumentEnvironment. The details of said command are explained in the xparse manual: https://ctan.org/pkg/l3packages It is part of an up to date LaTeX kernel, though.