main.tex 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. \documentclass[a4paper,11pt,twoside]{book}
  2. % english and utf8
  3. \usepackage[T2A]{fontenc}
  4. \usepackage[utf8]{inputenc}
  5. %\usepackage[british,russian]{babel}
  6. \usepackage[british]{babel}
  7. % declare some unicode characters
  8. \DeclareUnicodeCharacter{2713}{yes} % ✓
  9. \DeclareUnicodeCharacter{20AC}{EUR} % €
  10. %
  11. % Title and author info
  12. %
  13. \newcommand{\plainTitle}{The definitive Guide to Yii 2.0}
  14. \newcommand{\formattedTitle}{The Definitive Guide\\\vspace{.5cm}to\\\vspace{.5cm}Yii 2.0}
  15. \newcommand{\plainAuthors}{
  16. Qiang Xue,
  17. Alexander Makarov,
  18. Carsten Brandt,
  19. Klimov Paul,
  20. and
  21. many contributors from the Yii community
  22. }
  23. \newcommand{\formattedAuthors}{
  24. Qiang Xue,\\
  25. Alexander Makarov,\\
  26. Carsten Brandt,\\
  27. Klimov Paul,\\
  28. and\\
  29. many contributors from the Yii community
  30. }
  31. \newcommand{\formattedTranslators}{}
  32. %
  33. % ---
  34. %
  35. \usepackage{color}
  36. % list spacing http://stackoverflow.com/questions/3275622/latex-remove-spaces-between-items-in-list
  37. \usepackage{enumitem}
  38. % url support
  39. \usepackage{url}
  40. % make links clickable
  41. \usepackage{hyperref}
  42. \definecolor{linkcol}{rgb}{0,0,0.4}
  43. \definecolor{citecol}{rgb}{0.5,0,0}
  44. % Change this to change the informations included in the pdf file
  45. % See hyperref documentation for information on those parameters
  46. \hypersetup
  47. {
  48. bookmarksopen=true,
  49. pdftitle="\plainTitle",
  50. pdfauthor="\plainAuthors",
  51. %pdfsubject="Creation of atlases and atlas based segmentation", %subject of the document
  52. %pdftoolbar=false, % toolbar hidden
  53. pdfmenubar=true, %menubar shown
  54. pdfhighlight=/O, %effect of clicking on a link
  55. colorlinks=true, %couleurs sur les liens hypertextes
  56. pdfpagemode=None, %aucun mode de page
  57. pdfpagelayout=SinglePage, %ouverture en simple page
  58. pdffitwindow=true, %pages ouvertes entierement dans toute la fenetre
  59. linkcolor=linkcol, %couleur des liens hypertextes internes
  60. citecolor=citecol, %couleur des liens pour les citations
  61. urlcolor=linkcol %couleur des liens pour les url
  62. }
  63. \title{\plainTitle}
  64. \author{\plainAuthors}
  65. % code listings
  66. \usepackage{listings}
  67. \definecolor{codebg}{rgb}{0.9,0.9,0.9}
  68. \definecolor{mygreen}{rgb}{0,0.6,0}
  69. \definecolor{mygray}{rgb}{0.5,0.5,0.5}
  70. \definecolor{mymauve}{rgb}{0.58,0,0.82}
  71. % TODO ensure copyable indentation:
  72. % http://tex.stackexchange.com/questions/142617/copy-pasting-leading-whitespace-and-blank-lines-in-listings-package-pdf
  73. \lstset{%
  74. backgroundcolor=\color{codebg}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
  75. basicstyle=\ttfamily\footnotesize, % the size of the fonts that are used for the code
  76. columns=fullflexible,
  77. breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
  78. breaklines=true, % sets automatic line breaking
  79. extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
  80. keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
  81. %
  82. commentstyle=\color{mygreen}, % comment style
  83. keywordstyle=\color{blue}, % keyword style
  84. stringstyle=\color{mymauve}, % string literal style
  85. %
  86. % language=Octave, % the language of the code
  87. % morekeywords={*,...}, % if you want to add more keywords to the set
  88. % deletekeywords={...}, % if you want to delete keywords from the given language
  89. %
  90. numbers=none, % where to put the line-numbers; possible values are (none, left, right), not using line numbers to allow copy&paste
  91. stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
  92. numbersep=5pt, % how far the line-numbers are from the code
  93. numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
  94. %
  95. showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
  96. showstringspaces=false, % underline spaces within strings only
  97. showtabs=false, % show tabs within strings adding particular underscores
  98. %
  99. tabsize=2, % sets default tabsize to 2 spaces
  100. % title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title
  101. %
  102. literate={-}{-}1,
  103. % {\'}{'}1,
  104. % {\"}{\"}1
  105. extendedchars=false
  106. }
  107. \lstdefinelanguage{json}{
  108. morekeywords={},
  109. sensitive=false,
  110. morestring=[b]",
  111. }
  112. \lstdefinelanguage{css}{
  113. morekeywords={},
  114. sensitive=false,
  115. morestring=[b]",
  116. }
  117. \lstdefinelanguage{less}{
  118. morekeywords={},
  119. sensitive=false,
  120. morestring=[b]",
  121. }
  122. \lstdefinelanguage{scss}{
  123. morekeywords={},
  124. sensitive=false,
  125. morestring=[b]",
  126. }
  127. \lstdefinelanguage{javascript}{
  128. morekeywords={},
  129. sensitive=false,
  130. morestring=[b]",
  131. }
  132. \lstdefinelanguage{apache}{
  133. morekeywords={},
  134. sensitive=false,
  135. morestring=[b]",
  136. }
  137. \lstdefinelanguage{nginx}{
  138. morekeywords={},
  139. sensitive=false,
  140. morestring=[b]",
  141. }
  142. \lstdefinelanguage{bash}{
  143. morekeywords={},
  144. sensitive=false,
  145. morestring=[b]",
  146. }
  147. % include images
  148. \usepackage{graphicx}
  149. % better tables using tabularx
  150. \usepackage{tabularx}
  151. % support github markdown strikethrough
  152. % http://tex.stackexchange.com/questions/23711/strikethrough-text
  153. \usepackage{ulem}
  154. \newcommand{\centeronpage}{% Horizontal adjustment of image
  155. \ifodd\value{page}\hspace*{\dimexpr\evensidemargin-\oddsidemargin}\else\hspace*{-\dimexpr\evensidemargin-\oddsidemargin}\fi%
  156. }
  157. % uncomment for debugging layout issues
  158. %\usepackage{showframe}
  159. \begin{document}
  160. \frontmatter
  161. \include{title}
  162. %Take a blank Page
  163. \pagebreak \thispagestyle{empty} \cleardoublepage
  164. \setcounter{tocdepth}{1}
  165. \tableofcontents
  166. \mainmatter
  167. \include{guide}
  168. \end{document}