Guest User

Untitled

a guest
Dec 10th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. documentclass{book}
  2.  
  3. %PAGES
  4. usepackage[
  5. vcentering,
  6. hcentering,
  7. inner=16mm,
  8. outer=16mm,
  9. top=22.0mm,
  10. bottom=15.0mm,
  11. headsep=9.3mm,
  12. headheight=5mm,
  13. % showframe
  14. ]
  15. {geometry} % Extended page layout customization
  16.  
  17. geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages
  18. %usepackage[cross,a4,center]{crop} %Package to print on A4 with crop signs.
  19. usepackage{multicol}% handling of multicolumn in documents
  20. usepackage[toc]{multitoc}%enables table of contents with multiple columns
  21. renewcommand*{multicolumntoc}{2}% Set two columns for the table of contents
  22. usepackage{emptypage} % suppresses page numbers and headings on empty pages
  23. usepackage{xcolor}[2007/01/21] % Driver-independent color extensions
  24.  
  25. %SKETCHES AND PLOTS
  26. usepackage{tikz} % To create graphics programmatically. TikZ is build on top of PGF.
  27. usetikzlibrary{decorations.markings,arrows,backgrounds}
  28. usetikzlibrary{patterns}
  29. usetikzlibrary{shapes.misc, positioning}
  30. usetikzlibrary{calc}
  31.  
  32. usepackage{xcolor}[2007/01/21] % Driver-independent color extensions
  33. definecolor{BlueGreen}{RGB}{7,116,159}
  34. definecolor{LightBlue}{RGB}{185,229,251}
  35. definecolor{LightGreen}{RGB}{203,231,211}
  36.  
  37. %FONTS
  38. usepackage{fontspec}%LuaLaTex fonts
  39. setmainfont[Ligatures=TeX,ItalicFont={Apollo MT Std Italic}]{Apollo MT}
  40. usepackage{titletoc,xpatch}%
  41. usepackage[explicit]{titlesec}% An in­ter­face to sec­tion­ing com­mands for se­lec­tion from var­i­ous ti­tle styles.
  42.  
  43. %Font families
  44. newfontfamilyAvenir{Avenir}
  45. newfontfamilyAvenirLight{Avenir Light}
  46. newfontfamilyAvenirHeavy{Avenir Heavy}
  47.  
  48.  
  49. %Chapters in TOC
  50. newcommand{chaptertocfont} {fontsize{10}{12}color{red}AvenirHeavy}
  51. newcommand{chaptertocpagefont} {fontsize{10}{12}color{red}AvenirHeavy}
  52.  
  53. %Chapters
  54. newcommand{chapterfont} {fontsize{24}{27}color{black}AvenirLight}
  55. newcommand{chapternrfont} {fontsize{24}{27}color{BlueGreen}AvenirHeavy}
  56.  
  57.  
  58. titlecontents{chapter}% section-type
  59. [1.5em]% <- changed
  60. {vspace*{0.6cm}}
  61. {chaptertocfontcontentslabel{1.5em}}% <- changed
  62. {hspace*{-1.5em}}% <- changed
  63. {hfillchaptertocpagefontcontentspage}[]
  64.  
  65. %CHAPTER HEADINGS
  66. titlespacing{chapter}{2cm}{-0.7cm}{1.7cm} % set spacing: left, before, after
  67.  
  68. titleformat{chapter}[hang]% command to be modified
  69. {chapterfont} %format
  70. {hspace*{-2.7cm}
  71. tikz [anchor=base, baseline,remember picture, overlay]
  72. {% colorbox for the chapter number
  73. node[
  74. line width = 1pt,
  75. draw=BlueGreen,
  76. fill =LightBlue,
  77. anchor=base,
  78. rectangle,
  79. text width=2cm,
  80. align=right,
  81. rounded rectangle,
  82. rounded rectangle west arc=5pt,
  83. minimum height=15mm,
  84. inner sep=11pt
  85. ] (A)
  86. {
  87. chapternrfontthechapter};
  88. draw[line width = 1pt, red] let p1=(A.south east), p2=(current page.east) in ([xshift=2.6ex]A.south east) -- +(x2,0);
  89. }
  90. }% label
  91. {dimexpr2emrelax}% sep
  92. {#1} % before-code
  93. [] % after-code
  94.  
  95. begin{document}
  96.  
  97. tableofcontents
  98.  
  99. chapter{Energy Conversion Systems}
  100.  
  101. chapter[Thermodynamic Properties of \ Multicomponent Fluids]{Thermodynamic Properties of \ Multicomponent Fluids}
  102.  
  103. end{document}
Add Comment
Please, Sign In to add comment