mirror of
https://github.com/sdiehl/wiwinwlh.git
synced 2024-09-11 12:05:25 +03:00
219 lines
4.7 KiB
TeX
219 lines
4.7 KiB
TeX
\documentclass[10pt,openright]{$documentclass$}
|
|
\usepackage{geometry}
|
|
\usepackage{resources/dtrt}
|
|
\geometry{
|
|
%a4paper,
|
|
%total={21.59cm,27.94cm},
|
|
%total={21cm,25cm},
|
|
papersize={21cm,25cm},
|
|
top=1.5cm,
|
|
bottom=1.5cm,
|
|
inner=1.91cm,
|
|
outer=6.68cm,
|
|
% For pdf
|
|
left=1.5cm,
|
|
right=1.5cm,
|
|
% For print
|
|
%marginparwidth=4cm,
|
|
%marginparsep=0.8cm
|
|
}
|
|
\usepackage{lmodern}
|
|
\usepackage{xcolor}
|
|
\usepackage{tikz}
|
|
\usepackage{hyperref}
|
|
|
|
\hypersetup{%
|
|
colorlinks=false, % hyperlinks will be black
|
|
linkcolor=black,
|
|
pdfborderstyle={0 0 0},
|
|
pdfauthor={Stephen Diehl},
|
|
pdfsubject={Haskell Programming},
|
|
pdftitle={What I Wish I Knew When Learning Haskell},
|
|
pdfkeywords={LaTeX, PDF, hyperlinks}
|
|
}
|
|
|
|
\newif\ifprint
|
|
\printtrue
|
|
\ifprint
|
|
\let\oldhref\href
|
|
\renewcommand\href[2]{%
|
|
\oldhref{#1}{#2}%
|
|
\footnote{\url{#1}}%
|
|
}
|
|
\fi
|
|
|
|
\usepackage{amssymb,amsmath}
|
|
\usepackage{framed}
|
|
\usepackage{fancyvrb}
|
|
\usepackage{fancyhdr}
|
|
\usepackage{graphicx}
|
|
%\usepackage{pst-poker}
|
|
|
|
\pagestyle{fancy}
|
|
\fancyhf{}
|
|
\fancyhead[RE,LO]{\leftmark}
|
|
\fancyhead[LE,RO]{\thepage}
|
|
|
|
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
|
|
|
|
\usepackage{csvsimple}
|
|
\usepackage{catchfile}
|
|
|
|
% Syntax Higlighting
|
|
\usepackage{listings}
|
|
|
|
% Haskell Syntax Highlighting
|
|
\usepackage{resources/haskell}
|
|
|
|
\lstset{
|
|
language=haskell,
|
|
basicstyle=\linespread{0.2}\small\sffamily,
|
|
breaklines=true,
|
|
frame=ltb,
|
|
framerule=0pt,
|
|
xleftmargin=15pt,
|
|
framexleftmargin=16pt,
|
|
framextopmargin=25pt,
|
|
framexbottommargin=25pt,
|
|
stepnumber=1,
|
|
numbers=left,
|
|
numbersep=5pt,
|
|
numberstyle=\ttfamily\tiny\color[gray]{0.3},
|
|
belowcaptionskip=\bigskipamount,
|
|
captionpos=b,
|
|
escapeinside={*'}{'*},
|
|
tabsize=2,
|
|
emphstyle={\bf},
|
|
commentstyle=\it,
|
|
stringstyle=\mdseries\rmfamily,
|
|
showspaces=false,
|
|
keywordstyle=\bfseries\rmfamily,
|
|
columns=fullflexible,
|
|
showstringspaces=false,
|
|
morecomment=[l]\%,
|
|
}
|
|
|
|
\usepackage{etoolbox}
|
|
\makeatletter
|
|
%\patchcmd{\chapter}{\newpage \newpage}{}{}{}
|
|
|
|
\usepackage[utf8]{inputenc}
|
|
\usepackage{ifxetex,ifluatex}
|
|
\usepackage{fontspec}
|
|
\setmainfont[Ligatures=Common,
|
|
ItalicFont={Adobe Garamond Pro Italic}]
|
|
{Adobe Garamond Pro}
|
|
\setmonofont[Ligatures=NoCommon, Scale=0.8]{Source Code Pro}
|
|
|
|
\urlstyle{same}
|
|
\usepackage{longtable,booktabs}
|
|
|
|
\usepackage{graphicx,grffile}
|
|
\makeatletter
|
|
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
|
|
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
|
|
\makeatother
|
|
% Scale images if necessary, so that they will not overflow the page
|
|
% margins by default, and it is still possible to overwrite the defaults
|
|
% using explicit options in \includegraphics[width, height, ...]{}
|
|
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
|
|
|
|
$if(indent)$
|
|
$else$
|
|
\IfFileExists{parskip.sty}{%
|
|
\usepackage{parskip}
|
|
}{% else
|
|
\setlength{\parindent}{0pt}
|
|
\setlength{\parskip}{6pt plus 2pt minus 1pt}
|
|
}
|
|
$endif$
|
|
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
|
\providecommand{\tightlist}{%
|
|
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
|
$if(numbersections)$
|
|
\setcounter{secnumdepth}{5}
|
|
$else$
|
|
\setcounter{secnumdepth}{0}
|
|
$endif$
|
|
$if(subparagraph)$
|
|
$else$
|
|
% Redefines (sub)paragraphs to behave more like sections
|
|
\ifx\paragraph\undefined\else
|
|
\let\oldparagraph\paragraph
|
|
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
|
|
\fi
|
|
\ifx\subparagraph\undefined\else
|
|
\let\oldsubparagraph\subparagraph
|
|
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
|
|
\fi
|
|
$endif$
|
|
$if(dir)$
|
|
\ifxetex
|
|
% load bidi as late as possible as it modifies e.g. graphicx
|
|
$if(latex-dir-rtl)$
|
|
\usepackage[RTLdocument]{bidi}
|
|
$else$
|
|
\usepackage{bidi}
|
|
$endif$
|
|
\fi
|
|
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
|
\TeXXeTstate=1
|
|
\newcommand{\RL}[1]{\beginR #1\endR}
|
|
\newcommand{\LR}[1]{\beginL #1\endL}
|
|
\newenvironment{RTL}{\beginR}{\endR}
|
|
\newenvironment{LTR}{\beginL}{\endL}
|
|
\fi
|
|
$endif$
|
|
$for(header-includes)$
|
|
$header-includes$
|
|
$endfor$
|
|
|
|
\date{$date$}
|
|
|
|
\begin{document}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
\input{resources/cover.tex}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
\input{resources/copyright.tex}
|
|
|
|
\newpage
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
$for(include-before)$
|
|
$include-before$
|
|
|
|
$endfor$
|
|
$if(toc)$
|
|
{
|
|
\setcounter{tocdepth}{$toc-depth$}
|
|
\tableofcontents
|
|
|
|
\newpage
|
|
|
|
}
|
|
$endif$
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
$body$
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
$for(include-after)$
|
|
$include-after$
|
|
$endfor$
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
\newpage
|
|
\input{resources/back.tex}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
\end{document}
|