I'm trying to write a custom environment, but I keep running into a strange error..
This is my setup
\documentclass{article}
\usepackage{environ}
\usepackage{longtable}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{advdate}
\usepackage{varwidth}
\environbodyname\scenarioBODY
\NewEnviron{scenario}
{
\renewcommand{\tabcolsep}{0.8ex}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\longtable{@{\extracolsep{\fill}}ll@{}}
\hline
{\bf Scenario name} & \multicolumn{1}{l}{Some scenario} \\
\hline
\endhead
body & \scenarioBODY \\
{\bf Total} & {\bf 100 DKK} \\
\hline
\endlongtable
}
It works with
\begin{document}
\begin{scenario}
Some body
\end{scenario}
\end{document}
but not with
\begin{document}
\begin{scenario}
\begin{enumerate}
\item Some body
\end{enumerate}
\end{scenario}
\end{document}
What am I doing wrong?
\longtable{@{\extracolsep{\fill}}lp{3cm}@{}}
rather then\longtable{@{\extracolsep{\fill}}ll@{}}
l
column type to insert paragraph or list, instead you can usep{<width>}
tables-wiki\bseries
intead of\bf
, those old commands will cause errors, depending of the documentclass. Read the manual of the array package to learn about different kinds of columns (texdoc array
) on the command line. The l-type throws an error, if there is a\par
in the content, the p-type not. The enumerate env. and such end an item with a paragraph.