Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{book}
- %PAGES
- usepackage[
- vcentering,
- hcentering,
- inner=16mm,
- outer=16mm,
- top=22.0mm,
- bottom=15.0mm,
- headsep=9.3mm,
- headheight=5mm,
- % showframe
- ]
- {geometry} % Extended page layout customization
- geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages
- %usepackage[cross,a4,center]{crop} %Package to print on A4 with crop signs.
- usepackage{multicol}% handling of multicolumn in documents
- usepackage[toc]{multitoc}%enables table of contents with multiple columns
- renewcommand*{multicolumntoc}{2}% Set two columns for the table of contents
- usepackage{emptypage} % suppresses page numbers and headings on empty pages
- usepackage{xcolor}[2007/01/21] % Driver-independent color extensions
- %SKETCHES AND PLOTS
- usepackage{tikz} % To create graphics programmatically. TikZ is build on top of PGF.
- usetikzlibrary{decorations.markings,arrows,backgrounds}
- usetikzlibrary{patterns}
- usetikzlibrary{shapes.misc, positioning}
- usetikzlibrary{calc}
- usepackage{xcolor}[2007/01/21] % Driver-independent color extensions
- definecolor{BlueGreen}{RGB}{7,116,159}
- definecolor{LightBlue}{RGB}{185,229,251}
- definecolor{LightGreen}{RGB}{203,231,211}
- %FONTS
- usepackage{fontspec}%LuaLaTex fonts
- setmainfont[Ligatures=TeX,ItalicFont={Apollo MT Std Italic}]{Apollo MT}
- usepackage{titletoc,xpatch}%
- usepackage[explicit]{titlesec}% An interface to sectioning commands for selection from various title styles.
- %Font families
- newfontfamilyAvenir{Avenir}
- newfontfamilyAvenirLight{Avenir Light}
- newfontfamilyAvenirHeavy{Avenir Heavy}
- %Chapters in TOC
- newcommand{chaptertocfont} {fontsize{10}{12}color{red}AvenirHeavy}
- newcommand{chaptertocpagefont} {fontsize{10}{12}color{red}AvenirHeavy}
- %Chapters
- newcommand{chapterfont} {fontsize{24}{27}color{black}AvenirLight}
- newcommand{chapternrfont} {fontsize{24}{27}color{BlueGreen}AvenirHeavy}
- titlecontents{chapter}% section-type
- [1.5em]% <- changed
- {vspace*{0.6cm}}
- {chaptertocfontcontentslabel{1.5em}}% <- changed
- {hspace*{-1.5em}}% <- changed
- {hfillchaptertocpagefontcontentspage}[]
- %CHAPTER HEADINGS
- titlespacing{chapter}{2cm}{-0.7cm}{1.7cm} % set spacing: left, before, after
- titleformat{chapter}[hang]% command to be modified
- {chapterfont} %format
- {hspace*{-2.7cm}
- tikz [anchor=base, baseline,remember picture, overlay]
- {% colorbox for the chapter number
- node[
- line width = 1pt,
- draw=BlueGreen,
- fill =LightBlue,
- anchor=base,
- rectangle,
- text width=2cm,
- align=right,
- rounded rectangle,
- rounded rectangle west arc=5pt,
- minimum height=15mm,
- inner sep=11pt
- ] (A)
- {
- chapternrfontthechapter};
- draw[line width = 1pt, red] let p1=(A.south east), p2=(current page.east) in ([xshift=2.6ex]A.south east) -- +(x2,0);
- }
- }% label
- {dimexpr2emrelax}% sep
- {#1} % before-code
- [] % after-code
- begin{document}
- tableofcontents
- chapter{Energy Conversion Systems}
- chapter[Thermodynamic Properties of \ Multicomponent Fluids]{Thermodynamic Properties of \ Multicomponent Fluids}
- end{document}
Add Comment
Please, Sign In to add comment