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.
\documentclass[a4paper,12pt,oneside]{article}
\newcounter{Examplecount}
\setcounter{Examplecount}{0}
\newenvironment{example}
{% This is the begin code
\stepcounter{Examplecount} {\bf\small Example} \arabic{Examplecount}\scriptsize \begin{it}
}
{% This is the end code
\end{it} }
\begin{document}
\begin{example}
This is an example
\end{example}
\end{document}
Monday, December 25, 2006
How to create a new environment in LaTeX
Subscribe to:
Post Comments (Atom)
3 comments:
Thanks, good example.
Thank you. This is what I was looking for.
Thanks!
Post a Comment