I am using musixtex for writing music. I want to use environment music with enumerate. See this code -
\documentclass{article}
\usepackage{musixtex}
\begin{document}
\begin{enumerate}
\item \begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item \begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item \begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\end{enumerate}
\end{document}
This renders the following output. It is evident that the enumeration has happened wrongly. What can be the cause of this and how to solve this?
Solution provided by @Piroooh and some further doubts.
\documentclass{article}
\usepackage{musixtex}
\begin{document}
\begin{enumerate}
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{c} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\item\mbox{\null}
\begin{music}
\setclef{1}{\alto}
\startextract
\notes \wh{g} \en
\endextract
\end{music}
\hrule
\end{enumerate}
\end{document}
See 9th and 17th point. The enumeration and the point are on different pages.


\item\phantom{text}\\and then my music environment. I tried it and it works fine, I want a real solution which will enumerate the music correctly. – Niranjan Dec 08 '19 at 09:54\mbox{}? – egreg Dec 08 '19 at 09:59