# \newpage inside of \newtheorem

Ηow to enter \newpage in the environment so that each exercise is contained in its own page.

\newtheorem{exercise}{ \color{magenta} \Large \bfseries }[chapter]


Something seemingly simple but troubling enough time now without any result

I would prefer \newtheorem . And this because I have already thousands of exercises and just want each one on a separate page so that I can make handwritten corrections

• You can use the package xpatch with \xpretocmd{\exercise}{\clearpage}{}{} – Marco Daniel Apr 1 '13 at 11:18
• BTW: Why do you set the size etc. as argument? – Marco Daniel Apr 1 '13 at 11:20
• @MarcoDaniel the xpatch... did not work for me. For your second comment I do not understand how to do this – karathan Apr 1 '13 at 11:26
• @MarcoDaniel I guess I figured something wrong ... sorry my english not help me ... you mean about \Large? – karathan Apr 1 '13 at 11:32
• I had the same problem with this language ;-). I provided an example. – Marco Daniel Apr 1 '13 at 11:33

To execute a command before the exercise environment is executed, you can use the package xpatch which provides the command \xpretocmd:

Here an example:

\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage{xpatch}
\newtheorem{exercise}{Exercise}[chapter]

\xpretocmd{\exercise}{\clearpage}{}{}
\usepackage{kantlipsum}
\begin{document}

\begin{exercise}
\kant
\end{exercise}
\begin{exercise}
\kant
\end{exercise}
\begin{exercise}
\kant
\end{exercise}

\end{document}


I don't know your package for theorems. A small list is:

• amsthm
• ntheorem
• thmtools

e.g. with ntheorem you can set the font by: \theorembodyfont{} or \theoremheaderfont

• Sorry should Ι have mentioned from the outset. I would prefer \newtheorem . And this because I have already thousands of exercises and just want each one on a separate page so that I can make handwritten corrections – karathan Apr 1 '13 at 11:40
• @karathan: I used the command \newtheorem. What's the matter? – Marco Daniel Apr 1 '13 at 11:48
• ok works very well ... after the first test. I thought that I will have a problem but everything is okay Thank you very much :) – karathan Apr 1 '13 at 11:51