Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[oneside]{memoir}
- usepackage{tikz}
- usepackage{titletoc}
- usepackage{lipsum}
- begin{document}
- tableofcontents
- chapter{A chapter}
- startcontents[chapters]
- begin{tikzpicture}[overlay]
- node[fill=blue] {printcontents[chapters]{}{1}{}};
- end{tikzpicture}
- section{Section}
- lipsum[1]
- section{Section 2}
- lipsum
- chapter{Second chapter}
- startcontents[chapters]
- printcontents[chapters]{}{1}{}
- section{Section}
- lipsum[2]
- section{Another section}
- lipsum
- end{document}
- documentclass[oneside]{memoir}
- usepackage{tikz}
- usetikzlibrary{shadows.blur}
- usepackage{titletoc}
- usepackage{lipsum}
- usepackage{calc}
- definecolor{yourcolor}{HTML}{008bb2}
- %define new chapter style (just for a nicer look)
- makechapterstyle{mystyle}{%
- chapterstyle{default}
- renewcommand*{chapnumfont}{normalfontHugesffamilybfseries}
- renewcommand*{chaptitlefont}{normalfonthugesffamilyitshapecolor{yourcolor}}
- settowidth{chapindent}{chapnumfont 111}
- renewcommand*{chapterheadstart}{}
- renewcommand*{chapnamefont}{hfillcolor{yourcolor}normalfontHugesffamilybfseries}
- renewcommand*{printchapternum}{%
- begin{tikzpicture}[baseline={([yshift=-.6ex]current bounding box.center)}]
- node[fill=yourcolor,circle,text=white] {thechapter};
- end{tikzpicture}\[1ex]
- hrule height 1.5pt}
- renewcommand*{printchaptertitle}[1]{%
- {chaptitlefont ##1}}
- }
- %use new chapter style
- chapterstyle{mystyle}
- %command to print the acutal minitoc
- newcommand{printmyminitoc}{noindenthspace{-2cm}begin{tikzpicture}
- node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}]{%
- color{white}%
- begin{minipage}{8cm}%minipage trick
- printcontents[chapters]{}{1}{}
- end{minipage}};
- end{tikzpicture}}
- begin{document}
- tableofcontents
- chapter{A chapter}
- startcontents[chapters]
- %print minitoc
- printmyminitoc
- section{Section}
- lipsum[1]
- section{Section 2}
- section{test}
- section{abc}
- lipsum
- chapter{Second chapter}
- end{document}
- documentclass[twoside]{book}
- usepackage{tikz}
- usetikzlibrary{shadows.blur}
- usepackage{titletoc}
- usepackage{lipsum}
- usepackage{calc}
- usepackage[]{titlesec}
- definecolor{yourcolor}{HTML}{008bb2}
- colorlet{chpnumbercolor}{black}
- makeatletter
- letoldl@chapterl@chapter
- defl@chapter#1#2{oldl@chapter{#1}{textcolor{chpnumbercolor}{#2}}}
- letold@dottedcontentsline@dottedtocline
- def@dottedtocline#1#2#3#4#5{%
- old@dottedcontentsline{#1}{#2}{#3}{#4}{{textcolor{chpnumbercolor}{#5}}}}
- makeatother
- titleformat{chapter}[display]
- {normalfontcolor{yourcolor}}
- {filleftHugesffamilybfserieschaptertitlenamehspace*{2mm}%
- begin{tikzpicture}[baseline={([yshift=-.6ex]current bounding box.center)}]
- node[fill=yourcolor,circle,text=white] {thechapter};
- end{tikzpicture}}
- {1ex}
- {titlerule[1.5pt]vspace*{5ex}hugesffamilyitshape}
- []
- titleformat{name=chapter,numberless}[display]
- {normalfontcolor{yourcolor}}
- {}
- {1ex}
- {vspace*{5ex}hugesffamilyitshape}
- []
- %command to print the acutal minitoc
- newcommand{printmyminitoc}{%
- noindenthspace{-2cm}%
- colorlet{chpnumbercolor}{white}%
- begin{tikzpicture}
- node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}]{%
- color{white}%
- begin{minipage}{8cm}%minipage trick
- printcontents[chapters]{}{1}{}
- end{minipage}};
- end{tikzpicture}}
- begin{document}
- tableofcontents
- chapter{A chapter}
- startcontents[chapters]
- %print minitoc
- printmyminitoc
- section{Section}
- lipsum[1]
- section{Section 2}
- section{test}
- section{abc}
- lipsum
- chapter{Second chapter}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement