Skip to content
This repository
tree: aac7aa1679
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 361 lines (304 sloc) 8.725 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
\documentclass[
    DIV=10,
    parskip=full,
    headsepline=on,
    footsepline=off,
    chapterprefix=on,
    12pt,
    twoside,
    openright,
    cleardoublepage=plain,
    BCOR=0pt
]{scrbook}

\usepackage[[% IF paper -%]
paper=[% paper %]paper
[%- ELSE -%]
paperwidth=[% paper_width %],paperheight=[% paper_height %]
[% END %]]{geometry}

% For (r) and (c)
\usepackage{textcomp}

% XeTeX unicode support -- e.g. character replacements
\usepackage{xunicode}

% This ensures that our dollar signs, braces, tildes and circumflex are shown correctly
\DeclareTextSymbol{\textdollar}{EU1}{`\$}
\DeclareTextSymbol{\textbraceright}{EU1}{`\}}
\DeclareTextSymbol{\textbraceleft}{EU1}{`\{}
\DeclareTextSymbol{\textasciitilde}{EU1}{`\~}
\DeclareTextSymbol{\textasciicircum}{EU1}{`\^}

% For the sidebars.
\usepackage{fancybox}

% Smart quotes
\usepackage{csquotes}
\MakeOuterQuote{"}

% For index generation. Supplies \printindex.
\usepackage{index}

% For cover
\usepackage{eso-pic}

% Fonts.
\usepackage{fontspec}
\setromanfont[Mapping=tex-text]{Minion Pro}
\setsansfont[Mapping=tex-text]{Myriad Pro}
\setmonofont[Scale=0.75]{Luxi Mono}

% microtype is not available for XeTeX yet
%\usepackage{microtype}

% Supplies 'tabular' environment and \rowcolor.
\usepackage{colortbl}

% Used as a default tables env., nicely wrapping longer texts in cells
\usepackage{tabulary}

% Optimize for this language.
\usepackage[english]{babel}

% Verbatim definition for code blocks.
\usepackage{fancyvrb}
\RecustomVerbatimEnvironment
{Verbatim}{Verbatim}
{xleftmargin=0.35in,commandchars=\\\{\},fontsize=\small,gobble=4,labelposition=topline}

% Allows among other things the \documentclass '...paper' option
% to be passed on to the DVI processor.
\usepackage[xetex]{hyperref}
\hypersetup{
    pdftitle={Using Perl~6},
    colorlinks,
    linkcolor=black,
    urlcolor=black,
}

% URLs
\DeclareUrlCommand\email{\urlstyle{rm}\urlstyle{bf}}

% Footnote correction
\deffootnote{1.5em}{1.5em}{\makebox[1.5em][c]{\textsuperscript\thefootnotemark}}

% Needed for \includegraphics from '=for figure' in some src/*.pod.
\usepackage{graphics,graphicx}

% Set TOC to mostly sans-serif
\usepackage[titles]{tocloft}
 
\setlength{\cftbeforechapskip}{2ex}
\setlength{\cftbeforesecskip}{0.8ex}
\setlength{\cftbeforesubsecskip}{0.8ex}
 
\renewcommand{\cftchapfont}{%
   \sffamily\bfseries
}
\renewcommand{\cftchappagefont}{\sffamily}
\renewcommand{\cftsecfont}{\sffamily}
\renewcommand{\cftsecpagefont}{\sffamily}
\renewcommand{\cftsubsecfont}{\sffamily}
\renewcommand{\cftsubsecpagefont}{\sffamily}
\usepackage[sf,sl,outermarks,noindentafter,nobottomtitles]{titlesec}

% Headlines formatting
\titleformat{\section}[hang]{\Large\sffamily}{\thetitle}{8pt}{}
\titleformat{\subsection}[hang]{\large\sffamily}{\thetitle}{8pt}{}
\titleformat{\subsubsection}[hang]{\normalfont\sffamily}{\thetitle}{8pt}{}
\titleformat{\paragraph}[hang]{\bfseries\sffamily}{\thetitle}{8pt}{}

% Chapter heading formatting
\titleformat{\chapter}[display]
{\filleft\huge\sffamily}
{\fontsize{100pt}{90pt}\selectfont\thechapter}
{-2ex}{\vspace{1ex}}
[\vspace{1ex}]

%% HEADINGS %%
\newlength{\marginWidth}
\setlength\marginWidth{\marginparwidth+\marginparsep}
\newlength{\fulllinewidth}
\setlength\fulllinewidth{\textwidth+\marginWidth}
 
\usepackage{truncate}
 
\footskip=1.6cm
\makeatletter

% Standard footer on odd pages
\def\oddfootSTANDARD{
  \renewcommand{\@oddfoot}{
      \hbox to\textwidth{\vbox{\hbox to\textwidth{
         \hfill
         \strut
         \hspace{1pt}
       }}}
       \hbox to\marginWidth{\vbox{\hbox to\marginWidth{
          \strut
               \hspace{5pt}
               \vrule width 1pt height 2ex
            \hspace{8pt}
            \textsf{\thepage}
            \hfill
       }}}\hss
   }
}
 
% Standard footer on even pages
\def\evenfootSTANDARD{
  \renewcommand{\@evenfoot}{
     \hspace{-\marginWidth}
         \hbox to\marginWidth{\vbox{\hbox to\marginWidth{
         \strut
         \hfill
         \textsf{\thepage}
         \hspace{5pt}
         \vrule width 1pt height 2ex
         \hspace{7pt}
      }}}\hss
   }
}
 
\newcommand{\ps@doc}{
  %% TODO: Re-enable when all text is in some kind of subchapter, since otherwise
  %% the header is empty and the number is 2.0 or something like it.

  %% \renewcommand{\@oddhead}{
  %% \hbox to\textwidth{\vbox{\hbox to\textwidth{
  %% \textsf
  %% \hfill
  %% \rightmark
  %% \strut
  %% \hspace{1pt}
  %% }}}
  %% \hbox to\marginWidth{\vbox{\hbox to\marginWidth{
  %% \strut
  %% \hspace{5pt}
  %% \vrule width 1pt
  %% \hspace{5pt}
  %% \textsf
  %% \thesection
  %% \hfill
  %% }}}\hss
  %% }
   
   \renewcommand{\@evenhead}{
     \hspace{-\marginWidth}
         \hbox to\marginWidth{\vbox{\hbox to\marginWidth{
            \hfill
            \strut
            \textbf{\textsf{Chapter~\thechapter}}
            \hspace{5pt}
            \vrule width 1pt
            \hspace{7pt}
            \strut
         }}}\hss
         
         \hbox to\textwidth{\vbox{\hbox to\textwidth{
            \strut
         \truncate{.9\textwidth}{\leftmark}
         \hfill
      }}}\hss
   }
   
   \oddfootSTANDARD
   \evenfootSTANDARD
}
 
\renewcommand{\ps@plain}{
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \let\@evenfoot\@empty
  \oddfootSTANDARD
}
 
\newcommand{\ps@docINTRO}{
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \oddfootSTANDARD
  \evenfootSTANDARD
}
 
\newcommand{\ps@docAPPENDIX}{
  \let\@oddhead\@empty
   \renewcommand{\@evenhead}{
     \hspace{-\marginWidth}
         \hbox to\marginWidth{\vbox{\hbox to\marginWidth{
            \hfill
            \strut
            \textbf{\textsf{Appendix~\thechapter}}
            \hspace{5pt}
            \vrule width 1pt
            \hspace{7pt}
            \strut
         }}}\hss
         
         \hbox to\textwidth{\vbox{\hbox to\textwidth{
            \strut
            \truncate{.9\textwidth}{\leftmark}
            \hfill
         }}}\hss
   }
   
   \oddfootSTANDARD
   \evenfootSTANDARD
}
 
\newcommand{\ps@reallyempty}{
  \let\@oddhead\@empty
  \let\@evenhead\@empty
  \let\@oddfoot\@empty
  \let\@evenfoot\@empty
}
 
\renewcommand{\chaptermark}[1]{\markboth{\uppercase{\textsf{#1}}}{}}
\renewcommand{\sectionmark}[1]{\markright{\textsf{#1}}}
 
\makeatother
 
%% \let\origdoublepage\cleardoublepage
%% \newcommand{\clearemptydoublepage}{%
%% \clearpage
%% {\pagestyle{empty}\origdoublepage}%
%% }
%% \let\cleardoublepage\clearemptydoublepage

%% HEADINGs END %%

% No widows and orphans
\clubpenalty = 10000
\widowpenalty = 10000
\displaywidowpenalty = 10000

% Admonition
\usepackage{framed}
\usepackage{xcolor}
 
\definecolor{MyBoxColor}{rgb}{0.9,0.9,0.9}
\newenvironment{sidebar}{
 \def\FrameCommand{\fboxsep=\FrameSep \colorbox{MyBoxColor}}
  \MakeFramed {\advance\hsize-2\width\FrameRestore}}
{\endMakeFramed}
 
\makeindex

\begin{document}

\AddToShipoutPicture*{%
\includegraphics[width=\paperwidth]{../src/images/title.pdf}
}

\titlehead{}
\subject{}
\title{}
\subtitle{}
\author{}
\date{}
\publishers{}
\uppertitleback{
  {\bfseries Credits}
  \begin{description}
  \item[Text] Jonathan S. Duff, Moritz Lenz, Carl Mäsak, Patrick R. Michaud,
      Jonathan Worthington.
  \item[Front cover] Sebastian Riedel (\url{http://kraih.com})
  \item[Fonts]Adobe Minion® Pro, Adobe Myriad® Pro, B\&H Luxi Mono
  \item[\LaTeX-Layout] Nikolai Prokoschenko, Luc St-Louis et al. Special thanks to Konrad Mühler for his \LaTeX\ tips collection (\url{http://www.kfiles.de/latex.php})
  \item[Editor] chromatic
  \item[Further contributions]
        % please maintain alphabetical order by last name (or nick)
        % when adding new contributors
        Carlin Bingham,
        Tim Bunce,
        Nuno Carvalho,
        Will Coleda,
        Patrick Donelan,
        James E. Keenan,
        Alex Elsayed,
        Jason Felds,
        Matt Follett,
        Solomon Foster,
        Piotr Fusik,
        Bruce Gray,
        Prakash Kailasa,
        Matt Kraai,
        Philipp Marek,
        molecules,
        Kevin Polulak,
        Hongwen Qiu,
        Dean Serenevy,
        Aaron Sherman,
        snarkyboojum,
        Tadeusz Sośnierz,
        Gabor Szabo,
        Ralf Valerien,
        Przemysław Wesołek,
  \end{description}
}
\lowertitleback{
  \includegraphics[width=\textwidth]{../src/images/license.pdf}
}
\maketitle
\frontmatter
\pagestyle{docINTRO}
\tableofcontents

\mainmatter
\pagestyle{doc}

[% content %]

\backmatter
\begin{appendix}
\pagestyle{docAPPENDIX}
\printindex

\end{appendix}

\end{document}

Something went wrong with that request. Please try again.