I am trying to create a simple document that contains questions with their respective answers "hidden" behind a mouse click. The problem is when I try to implement this with a list with labels other than default (via enumitem). My MWE is below:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb}
\usepackage{ocgx}
\usepackage{enumitem}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{ex}{\bf Example}[section]
\newenvironment{mysolution}{\begin{ocg}{OCG\theex\theenumi}{ocg\theex\theenumi}{0}\leavevmode\marginpar{SOLUTION}}{\end{ocg}\hfill\switchocg{ocg\theex\theenumi}{$\Box$}}
\begin{document}
\section{Math}
\begin{ex}
A math question
\begin{enumerate}
\item
What is $1+1$?
\begin{mysolution}
$1+1=2$
\end{mysolution}
\end{enumerate}
\end{ex}
\end{document}
I would like to have [label=\bfseries(\alph*)]
as an argument for enumerate, but this causes an issue as \theenumi
renames to {\theenumi}
(which you can see in the PDF) and ocgx
cannot read this; this results in a string of errors. This only seems to be an issue with the enumitem
package as it works with alpha labels no problem, but I can't get them bolded. Any suggestions as to what I should try?