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}
Showing posts with label LaTeX. Show all posts
Showing posts with label LaTeX. Show all posts
Monday, December 25, 2006
How to create a new environment in LaTeX
Označenia: LaTeX
Subscribe to:
Posts (Atom)