Something very peculiar is happening in a TeX document I'm typing.
The relevant packages I'm using are xcolor, mdframed, amsthm, and enumerate.
Below is a minimal working example which shows the error I'm seeing:
When I compile it, the first item doesn't get a number, and the second item gets both labels 1 and 2, then the third item (and onwards) is labelled correctly.\documentclass{report}[12pt]
\usepackage{xcolor,mdframed,amsthm,enumerate}
\newtheorem{alg}{{\color{black}{Algorithm}}}[section]
\begin{document}
\begin{mdframed}[backgroundcolor=yellow!10,linewidth=1.5pt]
\begin{alg} {{\textbf{(Algorithm Name)}}}
\begin{enumerate}
\item First item
\item Second item
\item Third item
\end{enumerate}
\end{alg}
\end{mdframed}
\end{document}
I'm also attaching a picture of what I see.
If I remove the algorithm lines only, everything works (I just don't have my algorithm environment). If I remove just the mdframed lines only, everything works (I just don't get my box and colour). So, I can only assume there's some weird interaction between mdframed and amsthm?
I haven't tried replacing mdframed with a different boxing/colouring package, but I'd be hesitant to do so. I'm typing lecture notes, and I was planning on using the mdframed package throughout to box important theorems, etc. I particularly like mdframed because of the way it wraps between pages (something fbox, etc., doesn't seem to do). However, if there is an functionally equivalent package to mdframed, then I'd be happy to give that a try!
Any help would be greatly appreciated.
Thanks in advance,
Jonathan