main.tex 4.69 KB
Newer Older
1
\documentclass[a4paper,11pt,twoside]{book}
2 3

% english and utf8
4
\usepackage[T2A]{fontenc}
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
\usepackage[utf8]{inputenc}
%\usepackage[british,russian]{babel}
\usepackage[british]{babel}

% url support
\usepackage{url}

% make links clickable
\usepackage{hyperref}

% code listings
\usepackage{listings}
\usepackage{color}

\definecolor{codebg}{rgb}{0.9,0.9,0.9}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}

24 25 26
% TODO ensure copyable indentation:
% http://tex.stackexchange.com/questions/142617/copy-pasting-leading-whitespace-and-blank-lines-in-listings-package-pdf

27 28
\lstset{%
  backgroundcolor=\color{codebg},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
29 30
  basicstyle=\ttfamily\footnotesize, % the size of the fonts that are used for the code
  columns=fullflexible,
31 32 33 34
  breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
  breaklines=true,                 % sets automatic line breaking
  extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
35 36
%
  commentstyle=\color{mygreen},    % comment style
37
  keywordstyle=\color{blue},       % keyword style
38 39
  stringstyle=\color{mymauve},     % string literal style
%
40 41
% language=Octave,                 % the language of the code
% morekeywords={*,...},            % if you want to add more keywords to the set
42 43 44 45
% deletekeywords={...},            % if you want to delete keywords from the given language
%
  numbers=none,                    % where to put the line-numbers; possible values are (none, left, right), not using line numbers to allow copy&paste
  stepnumber=1,                    % the step between two line-numbers. If it's 1, each line will be numbered
46 47
  numbersep=5pt,                   % how far the line-numbers are from the code
  numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
48
%
49 50 51
  showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  showstringspaces=false,          % underline spaces within strings only
  showtabs=false,                  % show tabs within strings adding particular underscores
52
%
53
  tabsize=2,                       % sets default tabsize to 2 spaces
54 55 56 57 58
%  title=\lstname                   % show the filename of files included with \lstinputlisting; also try caption instead of title
%
    literate={-}{-}1,
    %    {\'}{'}1,
    %    {\"}{\"}1
59
  extendedchars=false
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
}

\lstdefinelanguage{json}{
	morekeywords={},
	sensitive=false,
	morestring=[b]",
}

\lstdefinelanguage{css}{
	morekeywords={},
	sensitive=false,
	morestring=[b]",
}

\lstdefinelanguage{javascript}{
	morekeywords={},
	sensitive=false,
	morestring=[b]",
}

% include images
\usepackage{graphicx}

% support github markdown strikethrough
% http://tex.stackexchange.com/questions/23711/strikethrough-text
\usepackage{ulem}

87 88 89 90 91 92 93 94 95
\newcommand{\centeronpage}{% Horizontal adjustment of image
  \ifodd\value{page}\hspace*{\dimexpr\evensidemargin-\oddsidemargin}\else\hspace*{-\dimexpr\evensidemargin-\oddsidemargin}\fi%
}

\title{The definitive Guide to Yii 2.0}
\author{
    Qiang Xue,
    Alexander Makarov,
    Carsten Brandt,
96
    Klimov Paul,
97 98 99 100 101 102 103
    and
    many contributors from the Yii community
}

% uncomment for debugging layout issues
%\usepackage{showframe}

104 105
\begin{document}

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
    \frontmatter

    \begin{titlepage}
        % ensure centering the title page by ignoring odd and even margin
        \setlength{\oddsidemargin}{-1in}
        \setlength{\evensidemargin}{-1in}
        \setlength{\textwidth}{\paperwidth}

        \vspace*{\fill}

        % typesetting the title line
        \noindent
        \parbox{\textwidth}{\centering \bfseries \Huge
            The Definitive Guide
        }\vspace{.5cm}
        \parbox{\textwidth}{\centering \bfseries \Huge
            to
        }\vspace{.5cm}
        \parbox{\textwidth}{\centering \bfseries \Huge
            Yii 2.0
        }

        \vfill

        % typesetting authors
        \noindent
        \parbox{\textwidth}{\centering \Large
            Qiang Xue,\\
            Alexander Makarov,\\
            Carsten Brandt,\\
136
            Klimov Paul,\\
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
            and\\
            the Yii community
        }

        \vspace*{\fill}

        \noindent
        \parbox{\textwidth}{\centering
            Copyright 2014 Yii Software LLC.
        }
    \end{titlepage}

    %Take a blank Page
    \pagebreak \thispagestyle{empty} \cleardoublepage

    \setcounter{tocdepth}{1}
153 154
    \tableofcontents

155 156
    \mainmatter

157 158 159
	\include{guide}

\end{document}