Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.43 KB | None | 0 0
  1. documentclass[a4paper,10pt]{book} % Defines document type
  2.  
  3. usepackage{sectsty} % Allows section and chapter colours (This should always be one of the first packages loaded)
  4. usepackage{layout}
  5. usepackage{titlesec}
  6. usepackage{afterpage}
  7. usepackage{wallpaper}
  8. usepackage{transparent}
  9. usepackage{eso-pic}
  10. usepackage{mathpazo} % package to change fonts
  11. usepackage{graphicx} % required if want to include graphics
  12. usepackage[margin=1in,bottom=0.5cm,paperwidth=8.5in, paperheight=11in]{geometry}
  13. usepackage[T1]{fontenc} % Import usual characters
  14. usepackage[utf8]{inputenc} % Import usual characters
  15. usepackage{amsmath} % For math stuff
  16. usepackage{import} % For math stuff
  17. usepackage{hyperref} % For fancy url encoding, and jumping around the document
  18. usepackage{fancyhdr} % For fancy headers including
  19. usepackage{chappg} % For pages numbered within chapters
  20. usepackage{graphicx} % For images, etc.
  21. %usepackage{epstopdf} % For eps images
  22. %usepackage{epsfig} % For eps images
  23. usepackage{attrib} % For fancy inclusion of quotes
  24. usepackage{float} % For using [H] option in includegraphics
  25. usepackage[figurewithin=chapter]{caption} % For labeling figures only within chapters (eg Fig 2.1, not 2.2.1). Note: Labels must now go at the end of the environment. Also for label colours.
  26. usepackage{longtable} % For tables that span multiple pages
  27. usepackage{booktabs} % For help formatting tables
  28. usepackage{multirow} % For merged cells in a table
  29. usepackage{graphbox} % Related to centering images vertically
  30. usepackage{fullpage}
  31. %usepackage[export]{adjustbox} % Another package that can be used for centering images vertically
  32. usepackage{pifont}% http://ctan.org/pkg/pifont % A package for symbols (used here for checkmarks and x's)
  33. %usepackage{fontspec}
  34. %usepackage[table]{xcolor} % Colour names, also [table] option allows for alternating row background colours in tables (This package should always be loaded last)
  35. %overfullrule=2cm % Uncomment to find overfull hboxes
  36.  
  37. hypersetup{%
  38. colorlinks = false, % ensures toc remains black if colour applied to chapter headings
  39. linkcolor = black
  40. }
  41.  
  42.  
  43. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  44. %%%% IMPORTANT NOTE: YOU MUST USE THE LINE: %%%%
  45. %%%% graphicspath{{CHAPTERNAME/Images/}} %%%%
  46. %%%% OR SOMETHING SIMILAR AT THE TOP OF EACH CHAPTER FILE %%%%
  47. %%%% FOR LATEX TO FIND YOUR IMAGES %%%%
  48. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  49.  
  50.  
  51. %%%%%%%%%% Create Page Styles %%%%%%%%%%
  52. fancypagestyle{F1}
  53. {
  54. fancyhf{}renewcommand{headrulewidth}{0pt}fancyfoot[c]
  55. {scriptsize vspace{0.1cm} Company Name}
  56. }
  57.  
  58. fancypagestyle{F2}
  59. {
  60. fancyhf{}
  61. renewcommand{headrulewidth}{0pt}fancyfoot[LE,LO]
  62. {
  63. scriptsize vspace{0.1cm} texttransparent{0.5}{Company Name}
  64. }
  65. fancyfoot[C]{thepage}
  66. }
  67.  
  68. %%%%%%%%%% Setup page style, headers %%%%%%%%%%
  69. %%% sets up non chapter pages %%%
  70. setlength{parindent}{0pt} % No indents on new paragraphs
  71. setlength{parskip}{14pt} % Space between paragraphs
  72. %headheight = 43pt
  73. %headsep = 20pt
  74.  
  75. renewcommand{headrulewidth}{0pt} % remove header line
  76. renewcommand{footrulewidth}{0.1 pt} % thin footer line
  77. pagestyle{fancy}
  78. fancyhead{}
  79. fancyfoot{}
  80. fancyhead[L]{small texttransparent{0.5}{Product}}
  81. chead{}
  82. fancyhead[R]{transparent{0.5}includegraphics[scale = 0.5]{Tex.png}}fancyfoot[L]{scriptsize vspace{0.1cm} texttransparent{0.5} {Some Company Name}}
  83. raggedbottom
  84.  
  85. %%%%%%%%%% Colours of Titles %%%%%%%%%%
  86. definecolor{ChapTitle}{RGB}{54,95,145}
  87. definecolor{SectTitle}{RGB}{79,129,189}
  88. allsectionsfont{color{SectTitle}} % sets colour of sections
  89. chapterfont{color{ChapTitle}} % sets colour of chapters
  90. captionsetup{justification=raggedright,singlelinecheck=false, font={color=SectTitle}} % Sets captions left, Doesn't auto-set captions centre if they fit in one line, sets caption colour
  91.  
  92. % redefine fancy page style to apply header and footer to chapter page
  93. fancypagestyle{plain}{
  94. fancyhf{}
  95. renewcommand{headrulewidth}{0pt}% Line at the header invisible
  96. renewcommand{footrulewidth}{0.4pt}% Line at the footer visible
  97. renewcommand{headsep}{14pt}% Line at the footer visible
  98. fancyhead[LE,LO]{small texttransparent{0.5}{Product Name}}
  99. fancyhead[RE,RO]{transparent{0.5}includegraphics[scale = 0.5]{Tex.png}}
  100. fancyfoot[LE,LO]{scriptsize vspace{0.1cm} texttransparent{0.5} {Product Name}}
  101. fancyfoot[C]{thepage}
  102. }
  103.  
  104. %%%%%%%%%% Spacing %%%%%%%%%%
  105. titlespacing{chapter}{0pt}{12pt}{20pt}
  106. titlespacing{section}{0pt}{14pt}{-8pt}
  107.  
  108. %%%%%%%%%% Allows proper alignment in Table of Contents in chapters with more than 9 sections %%%%%%%%%%
  109. makeatletter
  110. renewcommand{@pnumwidth}{3em}
  111. renewcommand{@tocrmarg}{4em}
  112. makeatother
  113.  
  114. %%%%%%%%%% For proper handling of the references %%%%%%%%%%
  115. renewcommandbibname{References} %Names the references section `References' instead of `Bibliography'
  116. makeatletter % Macro to make 'references' a section instead of a chapter. This is better for the table of contents, and because there is no blank page created before the references.
  117. renewenvironment{thebibliography}[1]
  118. {section*{bibname}%
  119. @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
  120. list{@biblabel{@arabicc@enumiv}}%
  121. {settowidthlabelwidth{@biblabel{#1}}%
  122. leftmarginlabelwidth
  123. advanceleftmarginlabelsep
  124. @openbib@code
  125. usecounter{enumiv}%
  126. letp@enumiv@empty
  127. renewcommandtheenumiv{@arabicc@enumiv}}%
  128. sloppy
  129. clubpenalty4000
  130. @clubpenalty clubpenalty
  131. widowpenalty4000%
  132. sfcode`.@m}
  133. {def@noitemerr
  134. {@latex@warning{Empty `thebibliography' environment}}%
  135. endlist}
  136. makeatother
  137.  
  138. %%%%%%%%%% Some new commands %%%%%%%%%%
  139. newcommand{Note}{textbf{textcolor{SectTitle}{NOTE:} }} % Defines the Note command
  140. newcommand{cmark}{ding{51}}%
  141. newcommand{xmark}{ding{55}}%
  142.  
  143. newcommandblankpage{%
  144. null
  145. thispagestyle{empty}%
  146. addtocounter{page}{-1}%
  147. newpage}
  148.  
  149. %%%%%%%%%% Title & Section Formatting %%%%%%%%%%
  150. thispagestyle{F2}
  151. %newfontfamilyheadingfont[]{Arial}
  152. titleformat{chapter}
  153. {color{ChapTitle}filrightnormalfonthugebfseries}{chaptername hspace{0.25em}thechapter:} {0.2em} {}
  154. fancyfoot[C]{thepage}
  155. titleformat{section}
  156. {Largecolor{SectTitle}bfseries}{thesection}{0.5em}{}
  157. headsep = 45pt %%%%% this command ensures second page of chapter respects header %%%%%
  158.  
  159.  
  160.  
  161.  
  162. begin{document}
  163.  
  164. %maketitle
  165.  
  166.  
  167. begin{titlepage} %custom title page
  168.  
  169. begin{center}
  170. begin{flushright}
  171. %vspace*{0.5cm}
  172. includegraphics[scale=1]{Tex.png} % scale image
  173. vspace{1in}
  174. end{flushright}
  175. Huge{bfseries My First Book huge }
  176. line(1,0){450}\ %draws a line
  177. [0.1in] %space
  178. textbf{LARGE My Corporation \}
  179. textsc{large today}
  180. begin{center}
  181. vspace{3.5in}
  182. underline{textsf{small Name and Address}} \
  183. textsf{small Other info. }
  184. end{center}
  185. newpage
  186. thispagestyle{F1}
  187. %pagesytyle{plain}
  188. end{center}
  189.  
  190. %afterpage{blankpage} % insert blank page after title page
  191. end{titlepage}
  192. frontmatter
  193. %color{black}{tableofcontents}
  194. %chapterfont{color{black}} % sets TOC colour to be black
  195. renewcommand*contentsname{hfill color{black}Contents hfill}
  196. hypersetup{linkcolor=black}
  197. %thispagestyle{F2}
  198.  
  199. pagenumbering{roman}
  200. setcounter{page}{1}
  201. fancyfoot[C]{thepage}
  202. tableofcontents
  203.  
  204. hypersetup{linkcolor=black}
  205.  
  206.  
  207. %chapterfont{color{ChapTitle}} % sets colour of chapters
  208. mainmatter
  209.  
  210. hypersetup{linkcolor=black}
  211.  
  212. chapter{Introduction}
  213. This is the introduction, it should be quite short but give readers an idea of the book contents
  214. section{First Section}
  215. This first section should wrap automatically to ensure the text does not appear in the header.
  216. section{First Section}
  217. More sections should wrap automatically to ensure the text does not appear in the header.
  218. More sections should wrap automatically to ensure the text does not appear in the header.
  219. More sections should wrap automatically to ensure the text does not appear in the header.
  220. More sections should wrap automatically to ensure the text does not appear in the header.
  221. More sections should wrap automatically to ensure the text does not appear in the header.
  222. More sections should wrap automatically to ensure the text does not appear in the header.
  223. More sections should wrap automatically to ensure the text does not appear in the header.
  224. More sections should wrap automatically to ensure the text does not appear in the header.
  225. More sections should wrap automatically to ensure the text does not appear in the header.
  226. More sections should wrap automatically to ensure the text does not appear in the header.
  227. More sections should wrap automatically to ensure the text does not appear in the header.
  228. More sections should wrap automatically to ensure the text does not appear in the header.
  229. More sections should wrap automatically to ensure the text does not appear in the header.
  230. More sections should wrap automatically to ensure the text does not appear in the header.
  231. More sections should wrap automatically to ensure the text does not appear in the header.
  232.  
  233. section{Second Section}
  234. More sections should wrap automatically to ensure the text does not appear in the header.
  235. More sections should wrap automatically to ensure the text does not appear in the header.
  236. More sections should wrap automatically to ensure the text does not appear in the header.
  237. More sections should wrap automatically to ensure the text does not appear in the header.
  238. More sections should wrap automatically to ensure the text does not appear in the header.
  239. More sections should wrap automatically to ensure the text does not appear in the header.
  240. More sections should wrap automatically to ensure the text does not appear in the header.
  241. More sections should wrap automatically to ensure the text does not appear in the header.
  242. More sections should wrap automatically to ensure the text does not appear in the header.
  243. More sections should wrap automatically to ensure the text does not appear in the header.
  244. More sections should wrap automatically to ensure the text does not appear in the header.
  245. More sections should wrap automatically to ensure the text does not appear in the header.
  246. More sections should wrap automatically to ensure the text does not appear in the header.
  247. More sections should wrap automatically to ensure the text does not appear in the header.
  248. More sections should wrap automatically to ensure the text does not appear in the header.
  249. More sections should wrap automatically to ensure the text does not appear in the header.
  250. More sections should wrap automatically to ensure the text does not appear in the header.
  251. More sections should wrap automatically to ensure the text does not appear in the header.
  252. More sections should wrap automatically to ensure the text does not appear in the header.
  253. More sections should wrap automatically to ensure the text does not appear in the header.
  254. More sections should wrap automatically to ensure the text does not appear in the header.
  255. More sections should wrap automatically to ensure the text does not appear in the header.
  256. More sections should wrap automatically to ensure the text does not appear in the header.
  257. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement