I have a personalized class for exams and I need to do something different before the end of my custom enumerated list (questions).
After each question I add a new blank page with some text at the top (such as "(question X, cont'd)", and then start the next question on a new page -- so question 1 is on the first page, page 2 is blank except for some text on the top, and question 2 is on the third page. But for the last question I don't want to add the extra page for the next question (there is no next question).
Is there a way of doing this without manually adding the \newpage? That is, can I code this inside the custom enumerated list, so that if I change the order of the questions I won't have to keep changing the information?
I am already using the enumitem package, but can't find an option to check if current item is the last item (even if compiled more than once).
What I have right now (simplified):
\documentclass{article}
\begin{document}
Questions:
\begin{enumerate}
\item \label{qa} This is a question.
\newpage
(Question \ref{qa}, cont'd)
\newpage
\item \label{qb} Another question.
\newpage
(Question \ref{qb}, cont'd)
\newpage
\item \label{qc} Final question. Note that there is only one "newpage" after it.
\newpage
(Question \ref{qc}, cont'd)
\end{enumerate}
\end{document}
I'm trying to create an environment which has this behavior but I'm not seeing a solution.
I've also thought that perhaps I could change the first item (such that it does not get a \newpage before the item is defined), as it might be easier to check if the counter is zero.
Also, as a bonus, is it possible to create two different types of \items depending on the behavior expected (for example, if for a question I didn't want to add any extra pages)?



\let\olditem\item, as you're using\questionin the environment? – egreg Oct 06 '17 at 13:36