I was attempting to simplify my LaTeX document to write a Maths assessment with LaTeX, but when I created new environments I got an error that I cannot solve. Can you please explain me what is wrong with my definition? The source is the following:
\documentclass{article}
\usepackage{tabu}
\usepackage{longtable}
% ASSESSMENT TEXT
\newenvironment{assessment}
{\tabulinesep=1.5mm
\begin{longtabu} to \linewidth{|X[13 l]|X[c]|}
\hline
& \scriptsize DO NOT WRITE IN THIS MARGIN \cr}
{\end{longtabu}}
% Pattern \begin{AssExer}{mark}{space}
\newcounter{exercise}
\newenvironment{AssExerc}[2]
{\hline
\begin{minipage}[t]{\linewidth}
\refstepcounter{exercise}\textbf{\theexercise.}~}
{\end{minipage}\vspace{#2} & \textbf{#1}\cr
\hline}
\begin{document}
\begin{assessment}
\begin{AssExerc}{1}{2cm}
Solve the following equation $2x-1 = 0$.
\end{AssExerc}
\end{assessment}
\end{document}
The assessment environment works, but the AssExerc doesn't. Thank you for your help.
\newenvironment{AssExer}
is missing the c.