I know how to add questions to the Table of Contents using exsheets
key questions-totoc
.
I would like the Table of Contents to have question subtitles, so my students (and I) know what the questions are about at a glance.
How can I add subtitles to the ToC?
\documentclass{article}
\usepackage{exsheets}
\SetupExSheets{
headings=block-subtitle,
questions-totoc=true,
question/name=Question
}
\begin{document}
\tableofcontents
\begin{question}[subtitle=Gradient Vector]
\end{question}
\begin{question}[subtitle=Optimization]
\end{question}
\begin{question}[subtitle=Optimization with Constraints]
\end{question}
\begin{question}[subtitle={Proving Second Derivative Test for $f(x,y)$}]
\end{question}
\end{document}
One idea I had was to use \IfQuestionSubtitleTF
to conditionally add to the current ToC line. However, I don't know how to add to the current ToC line.