Monday, December 25, 2006

How to create a new environment in LaTeX

This is an example how to create a new environment in latex.
The \newenvironment command have two important parts: the begin code and the and code. The begin code is executed when the environment is initialized (in our case \begin{example}) and the end code executed at the \end{example} command.

{% This is the begin code
\stepcounter{Examplecount} {\bf\small Example} \arabic{Examplecount}\scriptsize \begin{it}
{% This is the end code
\end{it} }


This is an example



sturmer said...

Thanks, good example.

Anonymous said...

Thank you. This is what I was looking for.

Anonymous said...