0

I found in github, that I can set the item-format of a task list to math mode using \ensuremath. This seems to be equivalent to inline math i.e. for writing something like \task \(x^2 + y^2 = z^2\). But what can I do to get the equivalent to

\task
\begin{equation*}
x^2 + y^2 = z^2
\end{equation*}

I tried to item-format = \ensuremath\displaystyle. But this doesn't work.

Here is the MWE from github:

\documentclass{article}
\usepackage{tasks}[2016/05/02]

\settasks{
  item-format = \ensuremath
}

\begin{document}

\begin{tasks}(4)
  \task y + 4x
  \task \sin(x)
  \task \int e^x \,dx
  \task a^2 + b^2
\end{tasks}

\end{document}

1 Answer 1

2

The value for item-format can be a one-argument command.

\documentclass{article}
\usepackage{tasks}

\NewDocumentCommand{\ensuredisplaymath}{m}{\ensuremath{\displaystyle#1}}

\settasks{
  item-format = \ensuredisplaymath
}

\begin{document}

\begin{tasks}(4)
  \task y + 4x
  \task \sin(x)
  \task \int e^x \,dx
  \task a^2 + b^2
\end{tasks}

\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 .