I defined a new environment. The problem with it is, that I get errors if I place a \label{} in it. What am I doing wrong?
The definition:
Code: Select all
%minisec
\newcommand*{\minisec}[1]{\par
\vspace{-\parskip}\vspace{8mm}\noindent
\textsf{\textbf{#1}}\par\nobreak
\vspace{-\parskip}\nobreak\vspace{2mm}\nobreak\noindent
\ignorespaces
}
\newcounter{uczaehler}
\def\theuczaehler{[UC.\arabic{uczaehler}]}
\newenvironment{usecase}[2]{
\refstepcounter{uczaehler}
\minisec{\theuczaehler\ #1}
#2
\vspace{5mm}\sffamily\footnotesize%
\rowcolors{1}{tapbabyblue}{white}%
\begin{longtable}{|p{.2\textwidth}p{.65\textwidth}|}
\hline\endfirsthead
\hline\endlastfoot
}
{\end{longtable}\normalsize\rmfamily}
Code: Select all
\begin{usecase}{Header}
\par Bla & Some more bla \\
Blabla & enough of bla\\
etc & and so on \\
\end{usecase}
Code: Select all
\begin{usecase}{Header}\label{mylabel}
\par Bla & Some more bla \\
Blabla & enough of bla\\
etc & and so on \\
\end{usecase}
And now what latex tries to tell me (the first error):
Code: Select all
! Missing \endcsname inserted.
<to be read again>
\protect
l.253 ...{35}{ASectionName\relax }{uczaehler.5}{}}
The error points at the following line in the aux-file
Code: Select all
\newlabel{\vspace }{{[UC.5]}{35}{ASectionName\relax }{uczaehler.5}{}}
Code: Select all
! Missing number, treated as zero.
<to be read again>
\endcsname
l.253 ...{35}{ASectionName\relax }{uczaehler.5}{}}
! Illegal unit of measure (pt inserted).
<to be read again>
\endcsname
l.253 ...{35}{ASectionName\relax }{uczaehler.5}{}}
! Extra \endcsname
<to be read again>
\endcsname
l.253 ...{35}{ASectionName\relax }{uczaehler.5}{}}

Help please!!!