need help with preamble debugging



Hi.

I'm trying to get my latex preamble to work.
I have tried these three ways of marking a section with a box or with just
horizontal lines, but I can't get them to work, except the first one.
LaTeX is complaining about extra }'s.

Any ideas?


\newtheorem{EEee}{Exempel}[section]

\newenvironment{EE}{\vspace{3mm}\begin{boxedminipage}
{154mm}\begin{EEee}}{\end{EEee}\end{boxedminipage} \vspace{3mm}\\}


\newenvironment{EE}{\vspace{2mm}\fbox{\parbox{18cm}{\begin{EEee}}
{\end{EEee}}}\vspace{2mm}\\}

\newcommand\HRule{\noindent\rule{\linewidth}{1.5pt}}
\newenvironment{EE}{\vspace{3mm}\HRule \begin{EEee}} {\end{EEee}
\HRule \vspace{3mm}\\}
.