Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. documentclass[oneside]{memoir}
  2. usepackage{tikz}
  3. usepackage{titletoc}
  4. usepackage{lipsum}
  5.  
  6. begin{document}
  7. tableofcontents
  8. chapter{A chapter}
  9. startcontents[chapters]
  10. begin{tikzpicture}[overlay]
  11. node[fill=blue] {printcontents[chapters]{}{1}{}};
  12. end{tikzpicture}
  13. section{Section}
  14. lipsum[1]
  15. section{Section 2}
  16. lipsum
  17. chapter{Second chapter}
  18. startcontents[chapters]
  19. printcontents[chapters]{}{1}{}
  20. section{Section}
  21. lipsum[2]
  22. section{Another section}
  23. lipsum
  24. end{document}
  25.  
  26. documentclass[oneside]{memoir}
  27.  
  28. usepackage{tikz}
  29. usetikzlibrary{shadows.blur}
  30.  
  31. usepackage{titletoc}
  32. usepackage{lipsum}
  33.  
  34. usepackage{calc}
  35.  
  36. definecolor{yourcolor}{HTML}{008bb2}
  37.  
  38. %define new chapter style (just for a nicer look)
  39. makechapterstyle{mystyle}{%
  40. chapterstyle{default}
  41. renewcommand*{chapnumfont}{normalfontHugesffamilybfseries}
  42. renewcommand*{chaptitlefont}{normalfonthugesffamilyitshapecolor{yourcolor}}
  43. settowidth{chapindent}{chapnumfont 111}
  44. renewcommand*{chapterheadstart}{}
  45. renewcommand*{chapnamefont}{hfillcolor{yourcolor}normalfontHugesffamilybfseries}
  46. renewcommand*{printchapternum}{%
  47. begin{tikzpicture}[baseline={([yshift=-.6ex]current bounding box.center)}]
  48. node[fill=yourcolor,circle,text=white] {thechapter};
  49. end{tikzpicture}\[1ex]
  50. hrule height 1.5pt}
  51. renewcommand*{printchaptertitle}[1]{%
  52. {chaptitlefont ##1}}
  53. }
  54.  
  55. %use new chapter style
  56. chapterstyle{mystyle}
  57.  
  58. %command to print the acutal minitoc
  59. newcommand{printmyminitoc}{noindenthspace{-2cm}begin{tikzpicture}
  60. node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}]{%
  61. color{white}%
  62. begin{minipage}{8cm}%minipage trick
  63. printcontents[chapters]{}{1}{}
  64. end{minipage}};
  65. end{tikzpicture}}
  66.  
  67. begin{document}
  68. tableofcontents
  69. chapter{A chapter}
  70. startcontents[chapters]
  71. %print minitoc
  72. printmyminitoc
  73.  
  74.  
  75.  
  76. section{Section}
  77. lipsum[1]
  78. section{Section 2}
  79. section{test}
  80. section{abc}
  81. lipsum
  82. chapter{Second chapter}
  83. end{document}
  84.  
  85. documentclass[twoside]{book}
  86.  
  87. usepackage{tikz}
  88. usetikzlibrary{shadows.blur}
  89.  
  90. usepackage{titletoc}
  91. usepackage{lipsum}
  92.  
  93. usepackage{calc}
  94.  
  95. usepackage[]{titlesec}
  96. definecolor{yourcolor}{HTML}{008bb2}
  97.  
  98. colorlet{chpnumbercolor}{black}
  99. makeatletter
  100. letoldl@chapterl@chapter
  101. defl@chapter#1#2{oldl@chapter{#1}{textcolor{chpnumbercolor}{#2}}}
  102.  
  103. letold@dottedcontentsline@dottedtocline
  104. def@dottedtocline#1#2#3#4#5{%
  105. old@dottedcontentsline{#1}{#2}{#3}{#4}{{textcolor{chpnumbercolor}{#5}}}}
  106. makeatother
  107.  
  108. titleformat{chapter}[display]
  109. {normalfontcolor{yourcolor}}
  110. {filleftHugesffamilybfserieschaptertitlenamehspace*{2mm}%
  111. begin{tikzpicture}[baseline={([yshift=-.6ex]current bounding box.center)}]
  112. node[fill=yourcolor,circle,text=white] {thechapter};
  113. end{tikzpicture}}
  114. {1ex}
  115. {titlerule[1.5pt]vspace*{5ex}hugesffamilyitshape}
  116. []
  117.  
  118. titleformat{name=chapter,numberless}[display]
  119. {normalfontcolor{yourcolor}}
  120. {}
  121. {1ex}
  122. {vspace*{5ex}hugesffamilyitshape}
  123. []
  124.  
  125. %command to print the acutal minitoc
  126. newcommand{printmyminitoc}{%
  127. noindenthspace{-2cm}%
  128. colorlet{chpnumbercolor}{white}%
  129. begin{tikzpicture}
  130. node[rounded corners,align=left,fill=yourcolor, blur shadow={shadow blur steps=5}]{%
  131. color{white}%
  132. begin{minipage}{8cm}%minipage trick
  133. printcontents[chapters]{}{1}{}
  134. end{minipage}};
  135. end{tikzpicture}}
  136.  
  137. begin{document}
  138. tableofcontents
  139. chapter{A chapter}
  140. startcontents[chapters]
  141. %print minitoc
  142. printmyminitoc
  143.  
  144.  
  145.  
  146. section{Section}
  147. lipsum[1]
  148. section{Section 2}
  149. section{test}
  150. section{abc}
  151. lipsum
  152. chapter{Second chapter}
  153. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement