Code: Select all
\ProvidesClass{min}
\LoadClass{article}
\newcommand{\example}[1]{\def\@example{#1}}
\newcommand{\exampletwo}{\@example}
Code: Select all
\documentclass{min}
\example{example}
\begin{document}
\exampletwo
\end{document}
The problem is that instead of the .tex file reading the \example{example} as an indication to use this where appropriate in the .cls file, it automatically prints "example" to the PDF file (even though it is not even contained within the document environment - I know this is what is happening from my more complicated codes and also the fact that it still compiles even if I comment out \begin{document}).
Can anybody explain why this code is not working and point me in the direction of a solution (or even a better piece of code with a similar outcome)? Many thanks.