I have made a custom chapter head style and I would like to use it even with table of content.
so for this I have:
\documentclass{memoir}
\usepackage[utf8]{inputenc}
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usepackage{arrayjob}
\title{demo}
\newarray\dnaletters
\readarray{dnaletters}{A&C&G&T}
\colorlet{Random1}{cyan}
\colorlet{Random2}{yellow}
\colorlet{Random3}{red}
\colorlet{Random4}{green}
\makeatletter
\makechapterstyle{thesisStyle}{
\renewcommand{\chapternamenum}{}
\renewcommand{\chapnumfont}{\normalfont\Huge\bfseries}
\renewcommand{\printchapternum}{}
\renewcommand{\printchaptername}{}
\renewcommand\printchaptertitle[1]{
\begin{tikzpicture}[remember picture,overlay,shift={(current page.north west)},yshift=-3cm]
\path[fill=Black] (0,0) rectangle(\paperwidth,3cm);
\foreach \x in {0,1, ..., 70}{
\foreach \y in {0, ...,7}
\pgfmathsetmacro\Random{random(1,4)}
\node[draw=none,color=Random\Random,anchor=south west,font=\tiny,xshift=-.05cm] at (\x*.3cm,\y*.33cm) {\dnaletters(\Random)};
};
\node[anchor=east,xshift=.9\paperwidth,rectangle, rounded corners=20pt,inner sep=11pt, fill=MidnightBlue] {
\ifnum\value{chapter}>\value{0}
\normalfont\Huge\bfseries\color{white}\thechapter|~##1
\else
\normalfont\Huge\bfseries\color{white}##1
\fi
};
\end{tikzpicture}
}
\renewcommand{\afterchapternum}{}
}
\makeatother
\headstyles{thesisStyle}
\chapterstyle{thesisStyle}
\begin{document}
\tableofcontents
\chapter{test}
\end{document}
And I do not understand the error raised:
Missing number, treated as zero.
<to be read again>
\c@0
l.50 \chapter{test}
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
The result can be seen at: https://fr.sharelatex.com/project/576e90018ad9fc69396c79eb
Thanks for your help