I'm using the code below for my \part
heading style. I want to be able to modify what appears in ToC as my part name. Possibly put a different text there and also modify its font style (size, shape etc.). What should I modify in my code?
\documentclass[draft]{book}
\usepackage[table]{xcolor}
\usepackage{epigraph}
\setlength\epigraphwidth{.6\textwidth}
\makeatletter
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >-2\relax
\thispagestyle{epigraph}
\refstepcounter{part}%
\addcontentsline{toc}{part}{\partname~\thepart:\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
\markboth{}{}%
\reset@font
\parindent \z@
\vspace*{-400\p@}%
\hbox{%
\vbox{%
\hsize=7mm%
\makebox(0,0){\put(10,-100){\fbox{\phantom{\rule[-4cm]{7mm}{4cm}}}}}%
\begin{tabular}{@{}p{7mm}@{}}
\makebox[7mm]{\scshape\strut\small\partname}\\
\makebox[7mm]{\cellcolor{gray}\Huge\color{white}\bfseries\strut\thepart\rule[-4cm]{0pt}{4cm}}%
\end{tabular}%
}%
\kern6pt
\vbox to 0pt{%
\tabular[t]{@{}p{1cm}>{\raggedright\arraybackslash}p{\dimexpr\hsize-2.55cm}@{}}\hline
& \Huge\itshape\rule{0pt}{1.5\ht\strutbox}#1\endtabular}%
}%
\cleardoublepage
}
\makeatother
\begin{document}
\tableofcontents
\cleardoublepage
\epigraphhead[450]{Fairy tales are more than true: not because they tell us that dragons exist, but because they tell us dragons can be beaten.\par\hfill\textsc{C.K. Chesterton}}
\part{A Test Part Title}
\end{document}