I am trying to renew the \item
command, inside the \setlist
command for How to create a enumerate list adding a custom prefix before each item number?, but latex keeps telling me:
test1.tex:22: Illegal parameter number in definition of \enit@before
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
But I am already typing ##
. I also tried typing ###
, ####
and #####
, but the error still the same. If I replace the ##
by a single one #
, then, latex stops creating the PDF correctly. As it is now, the PDF is generated correctly, even with that error popping up.
\documentclass{scrbook}
\usepackage{enumitem}
\usepackage{xspace}
\newcounter{descriptcount}
\newlist{enumdescript}{description}{1}
\setlist[enumdescript,1]{%
before={%
\setcounter{descriptcount}{0}%
\renewcommand*\thedescriptcount{\arabic{descriptcount}}%
\let\olditem\item%
\renewcommand{\item}[1][]{%
\olditem##1\space\stepcounter{descriptcount}\thedescriptcount)\xspace}%
},
after={\let\item\olditem},
align=left
}
\begin{document}
\begin{enumdescript}
\item one
\item two
\item[Some Text] three
\item four
\item five
\end{enumdescript}
\end{document}
Related questions
- Error: Illegal Parameter number in definition of \iterate
- How to fix Illegal parameter number in definition of a new Tikz command?
- href: Illegal parameter number in definition of \test
- ! Illegal parameter number in definition of \NewValue
- Error: Illegal parameter number in definition of \reserved@a
- hyperref error using latex: "Illegal parameter number in definition of \Hy@temp"
- ! Illegal parameter number in definition of \abx@list@location
- LaTeX error: illegal parameter number in definition of \pgffor@b
- Why do I get the error "! Illegal parameter number in definition of \appendix."while redefining the \appendix command?
- Error "! Illegal parameter number in definition of \ tikz @ children @ list." with library mindmap and hyperref packages
- "! Illegal parameter number in definition of \reserved@a" working with fncychap