I am trying to add table of content to the bookmarks while using the tcolorbox
package, I am using memoir
class. Following is my MWE.
\documentclass[oneside]{memoir}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\usepackage[bookmarks=true]{hyperref}
\begin{document}
\frontmatter
\chapter{Sample front matter chapter}
\lipsum[1-2]
\newpage
\begin{tcolorbox}[
breakable,
enhanced jigsaw,title={\contentsname},fonttitle=\bfseries\Large,
% colback=white,% colback=yellow!10!white,
opacityback=0,
colframe=red!50!black,before=\par\bigskip\noindent,
% interior style={fill overzoom image=goldshade.png,fill image opacity=0.25},
colbacktitle=red!50!yellow!75!black,
enlargepage flexible=\baselineskip,pad at break*=3mm,
% watermark color=yellow!75!red!25!white,
% watermark text={\bfseries\Large \contentsname},
attach boxed title to top center={yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=2mm-\tcboxedtitleheight/2},
boxed title style={enhanced,boxrule=0.5mm,
frame code={ \path[tcb fill frame] ([xshift=-4mm]frame.west) -- (frame.north west)
-- (frame.north east) -- ([xshift=4mm]frame.east)
-- (frame.south east) -- (frame.south west) -- cycle; },
interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west)
-- (interior.north west) -- (interior.north east)
-- ([xshift=2mm]interior.east) -- (interior.south east) -- (interior.south west)
-- cycle;} },
% drop fuzzy shadow
]
\makeatletter
\small
\@starttoc{toc}
\makeatother
% \addcontentsline{toc}{chapter}{test}
\end{tcolorbox}
\mainmatter
\part{Test Part One}
\chapter{Test Chapter One}
\lipsum[1]
\section{Test Section One}
\lipsum[1]
\end{document}