Tikz设计的目录样式分享

话不多说,下面这一目录样式如何用TeX来实现,截图如下:

tocfancydesign20141223202831代码如下:

\documentclass{book}

\usepackage{tikz}
\usepackage{titletoc}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{times}
%
\definecolor{doc}{RGB}{0,60,110}
\definecolor{myblueii}{RGB}{63,200,244}

%~~~~~~~~~~~~~~~~~Hyperref Settings~~~~~~~~~~~~~~~~~~~~~~
\hypersetup{%
    pdfborder = {0 0 0},
    colorlinks,
    citecolor=red,
    filecolor=green,
    linkcolor=myblueii,
    urlcolor=cyan!50!black!90
}

%~~~~~~~~~~~~~~~~~~~~~Fancy ToC~~~~~~~~~~~~~~~~~~~~~~
\contentsmargin{0cm}
\titlecontents{chapter}[0pc]
{\addvspace{30pt}%
\begin{tikzpicture}[remember picture, overlay]%
\draw[fill=myblueii,draw=myblueii, rounded corners] (-4,-.1) rectangle (-0.15,.5);%
\pgftext[left,x=-2.7cm,y=0.2cm]{\color{white}\Large \chaptertitlename\ \thecontentslabel};%
\end{tikzpicture}\color{myblueii}\large\bfseries}%
{}
{}
{\hspace*{6pt}\titlerule\hspace*{6pt}\large\bfseries \thecontentspage
\begin{tikzpicture}[remember picture, overlay]
\draw[fill=doc!25,draw=myblueii, rounded corners=0pt] (2pt,0) rectangle (6,0.1pt);
\end{tikzpicture}}%
\titlecontents{section}[2.4pc]
{\addvspace{1pt}}
{\contentslabel[\thecontentslabel]{2.4pc}}
{}
{\hfill\small \thecontentspage}
[]
\titlecontents{subsection}[4.8pc]
{\addvspace{1.0pt}}
{\contentslabel[\thecontentslabel]{2.4pc}}
{}
{\hfill\small\thecontentspage}
[]

\makeatletter
\renewcommand{\tableofcontents}{%
\chapter*{%
\vspace*{-20\p@}%
\begin{tikzpicture}[remember picture, overlay]%
\pgftext[right,x=15cm,y=0.2cm]{\color{myblueii}\Huge \contentsname};%
\draw[fill=myblueii,draw=myblueii, rounded corners=15pt] (13,-.75) rectangle (20,1);%
\clip (13,-.75) rectangle (20,1);
\pgftext[right,x=15cm,y=0.2cm]{\color{white}\Huge \contentsname};%
\end{tikzpicture}}%
\@starttoc{toc}}
\makeatother

%~~~~~~~~~~~~~~~~~Main Document~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}
{
  \hypersetup{hidelinks}
  \tableofcontents%
}
  \chapter{rkbnjg}
  \section{ljkihb;kjb}
  \url{http://www.google.com}
  \section{lkhb;hkb}
  \section{;kjbkjb}
  \subsection{;kjblkhjblhkb}
  \subsection{lhjbljh}
  \subsection{;jbnlkhjblbh}
  \section{ljhblkhbj}
  \subsection{ljhblhjkblkbh}
  \chapter{kgjb}
  \chapter{;kjdfb543}
\end{document}

选自:http://tex.stackexchange.com/questions/196159/fancy-table-of-contents-and-hyperref-set-up扩展阅读:http://tex.stackexchange.com/questions/202350/modify-fancy-table-of-contents

分享到:
未经允许不得转载:Tikz设计的目录样式分享
已有 条意见

    最新文章

    加载中...
      本站提供专业LaTeX排版、咨询、定制服务,请点击下图咨询详情


      全国首个精品的LaTeX视频教程,大牛带着你入门,让LaTeX学习不再纠结,请点击下图咨询详情

      热门评论

        联系我们

        交流QQ群:91940767
        本站QQ号:343083553
        邮箱联系latexstudio@qq.com
        淘宝店铺https://shop240512713.taobao.com/ 提供排版,模板定制,培训,图片处理,视频教程等LaTeX服务。

        关注我们微信公众号

        如果您投稿或者希望加入我们团队,请发送您的简历到latexstudio@qq.com。