Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[a4paper,10pt]{book} % Defines document type
- usepackage{sectsty} % Allows section and chapter colours (This should always be one of the first packages loaded)
- usepackage{layout}
- usepackage{titlesec}
- usepackage{afterpage}
- usepackage{wallpaper}
- usepackage{transparent}
- usepackage{eso-pic}
- usepackage{mathpazo} % package to change fonts
- usepackage{graphicx} % required if want to include graphics
- usepackage[margin=1in,bottom=0.5cm,paperwidth=8.5in, paperheight=11in]{geometry}
- usepackage[T1]{fontenc} % Import usual characters
- usepackage[utf8]{inputenc} % Import usual characters
- usepackage{amsmath} % For math stuff
- usepackage{import} % For math stuff
- usepackage{hyperref} % For fancy url encoding, and jumping around the document
- usepackage{fancyhdr} % For fancy headers including
- usepackage{chappg} % For pages numbered within chapters
- usepackage{graphicx} % For images, etc.
- %usepackage{epstopdf} % For eps images
- %usepackage{epsfig} % For eps images
- usepackage{attrib} % For fancy inclusion of quotes
- usepackage{float} % For using [H] option in includegraphics
- 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.
- usepackage{longtable} % For tables that span multiple pages
- usepackage{booktabs} % For help formatting tables
- usepackage{multirow} % For merged cells in a table
- usepackage{graphbox} % Related to centering images vertically
- usepackage{fullpage}
- %usepackage[export]{adjustbox} % Another package that can be used for centering images vertically
- usepackage{pifont}% http://ctan.org/pkg/pifont % A package for symbols (used here for checkmarks and x's)
- %usepackage{fontspec}
- %usepackage[table]{xcolor} % Colour names, also [table] option allows for alternating row background colours in tables (This package should always be loaded last)
- %overfullrule=2cm % Uncomment to find overfull hboxes
- hypersetup{%
- colorlinks = false, % ensures toc remains black if colour applied to chapter headings
- linkcolor = black
- }
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%% IMPORTANT NOTE: YOU MUST USE THE LINE: %%%%
- %%%% graphicspath{{CHAPTERNAME/Images/}} %%%%
- %%%% OR SOMETHING SIMILAR AT THE TOP OF EACH CHAPTER FILE %%%%
- %%%% FOR LATEX TO FIND YOUR IMAGES %%%%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %%%%%%%%%% Create Page Styles %%%%%%%%%%
- fancypagestyle{F1}
- {
- fancyhf{}renewcommand{headrulewidth}{0pt}fancyfoot[c]
- {scriptsize vspace{0.1cm} Company Name}
- }
- fancypagestyle{F2}
- {
- fancyhf{}
- renewcommand{headrulewidth}{0pt}fancyfoot[LE,LO]
- {
- scriptsize vspace{0.1cm} texttransparent{0.5}{Company Name}
- }
- fancyfoot[C]{thepage}
- }
- %%%%%%%%%% Setup page style, headers %%%%%%%%%%
- %%% sets up non chapter pages %%%
- setlength{parindent}{0pt} % No indents on new paragraphs
- setlength{parskip}{14pt} % Space between paragraphs
- %headheight = 43pt
- %headsep = 20pt
- renewcommand{headrulewidth}{0pt} % remove header line
- renewcommand{footrulewidth}{0.1 pt} % thin footer line
- pagestyle{fancy}
- fancyhead{}
- fancyfoot{}
- fancyhead[L]{small texttransparent{0.5}{Product}}
- chead{}
- fancyhead[R]{transparent{0.5}includegraphics[scale = 0.5]{Tex.png}}fancyfoot[L]{scriptsize vspace{0.1cm} texttransparent{0.5} {Some Company Name}}
- raggedbottom
- %%%%%%%%%% Colours of Titles %%%%%%%%%%
- definecolor{ChapTitle}{RGB}{54,95,145}
- definecolor{SectTitle}{RGB}{79,129,189}
- allsectionsfont{color{SectTitle}} % sets colour of sections
- chapterfont{color{ChapTitle}} % sets colour of chapters
- 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
- % redefine fancy page style to apply header and footer to chapter page
- fancypagestyle{plain}{
- fancyhf{}
- renewcommand{headrulewidth}{0pt}% Line at the header invisible
- renewcommand{footrulewidth}{0.4pt}% Line at the footer visible
- renewcommand{headsep}{14pt}% Line at the footer visible
- fancyhead[LE,LO]{small texttransparent{0.5}{Product Name}}
- fancyhead[RE,RO]{transparent{0.5}includegraphics[scale = 0.5]{Tex.png}}
- fancyfoot[LE,LO]{scriptsize vspace{0.1cm} texttransparent{0.5} {Product Name}}
- fancyfoot[C]{thepage}
- }
- %%%%%%%%%% Spacing %%%%%%%%%%
- titlespacing{chapter}{0pt}{12pt}{20pt}
- titlespacing{section}{0pt}{14pt}{-8pt}
- %%%%%%%%%% Allows proper alignment in Table of Contents in chapters with more than 9 sections %%%%%%%%%%
- makeatletter
- renewcommand{@pnumwidth}{3em}
- renewcommand{@tocrmarg}{4em}
- makeatother
- %%%%%%%%%% For proper handling of the references %%%%%%%%%%
- renewcommandbibname{References} %Names the references section `References' instead of `Bibliography'
- 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.
- renewenvironment{thebibliography}[1]
- {section*{bibname}%
- @mkboth{MakeUppercasebibname}{MakeUppercasebibname}%
- list{@biblabel{@arabicc@enumiv}}%
- {settowidthlabelwidth{@biblabel{#1}}%
- leftmarginlabelwidth
- advanceleftmarginlabelsep
- @openbib@code
- usecounter{enumiv}%
- letp@enumiv@empty
- renewcommandtheenumiv{@arabicc@enumiv}}%
- sloppy
- clubpenalty4000
- @clubpenalty clubpenalty
- widowpenalty4000%
- sfcode`.@m}
- {def@noitemerr
- {@latex@warning{Empty `thebibliography' environment}}%
- endlist}
- makeatother
- %%%%%%%%%% Some new commands %%%%%%%%%%
- newcommand{Note}{textbf{textcolor{SectTitle}{NOTE:} }} % Defines the Note command
- newcommand{cmark}{ding{51}}%
- newcommand{xmark}{ding{55}}%
- newcommandblankpage{%
- null
- thispagestyle{empty}%
- addtocounter{page}{-1}%
- newpage}
- %%%%%%%%%% Title & Section Formatting %%%%%%%%%%
- thispagestyle{F2}
- %newfontfamilyheadingfont[]{Arial}
- titleformat{chapter}
- {color{ChapTitle}filrightnormalfonthugebfseries}{chaptername hspace{0.25em}thechapter:} {0.2em} {}
- fancyfoot[C]{thepage}
- titleformat{section}
- {Largecolor{SectTitle}bfseries}{thesection}{0.5em}{}
- headsep = 45pt %%%%% this command ensures second page of chapter respects header %%%%%
- begin{document}
- %maketitle
- begin{titlepage} %custom title page
- begin{center}
- begin{flushright}
- %vspace*{0.5cm}
- includegraphics[scale=1]{Tex.png} % scale image
- vspace{1in}
- end{flushright}
- Huge{bfseries My First Book huge }
- line(1,0){450}\ %draws a line
- [0.1in] %space
- textbf{LARGE My Corporation \}
- textsc{large today}
- begin{center}
- vspace{3.5in}
- underline{textsf{small Name and Address}} \
- textsf{small Other info. }
- end{center}
- newpage
- thispagestyle{F1}
- %pagesytyle{plain}
- end{center}
- %afterpage{blankpage} % insert blank page after title page
- end{titlepage}
- frontmatter
- %color{black}{tableofcontents}
- %chapterfont{color{black}} % sets TOC colour to be black
- renewcommand*contentsname{hfill color{black}Contents hfill}
- hypersetup{linkcolor=black}
- %thispagestyle{F2}
- pagenumbering{roman}
- setcounter{page}{1}
- fancyfoot[C]{thepage}
- tableofcontents
- hypersetup{linkcolor=black}
- %chapterfont{color{ChapTitle}} % sets colour of chapters
- mainmatter
- hypersetup{linkcolor=black}
- chapter{Introduction}
- This is the introduction, it should be quite short but give readers an idea of the book contents
- section{First Section}
- This first section should wrap automatically to ensure the text does not appear in the header.
- section{First Section}
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- section{Second Section}
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- More sections should wrap automatically to ensure the text does not appear in the header.
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement