答案1
手册ToC
中介绍的样式可以在的文档目录中找到,例如,在我的个人电脑上,TL 2017 的路径是tcolorbox
tcolorbox.doc.abtract.tex
tcolorbox
/usr/local/texlive/2017/texmf-dist/doc/latex/tcolorbox
我从那里复制了代码并将其包装在一个小的文档中。
基本上,设置只是tcolorbox
“标准”,然后使用\@starttoc{toc}
来加载内容\jobname.toc
,就像在任何宏中所做的那样\tableofcontents
。
该文件随包裹goldshade.png
一起提供tcolorbox
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{blindtext}
\begin{document}
\begin{tcolorbox}[breakable,enhanced jigsaw,title={Contents},fonttitle=\bfseries\Large,
colback=yellow!10!white,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 Contents},
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
\@starttoc{toc}
\makeatother
\end{tcolorbox}
\blinddocument
\end{document}