summaryrefslogtreecommitdiffstats
path: root/src/seastar/doc/template.tex
blob: 8c26c2070b8c8b336c1d947b4f74fe5816f735f6 (plain)
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
% The pandoc command line (see configure.py) can communicate variables to this
% LaTeX skelaton, by using the "-V varname=value" command line parameter, and
% there are also some builtin variables defined by other options. With such a
% variable, we can use "$varname$" for the value, and $if(varname)$...$endif$
% for conditional code when this varname is defined.
%
% For an example of a more complete LaTeX template covering more of pandoc's
% features, check out the example templates/default.latex in pandoc's
% installation, or pandoc.org/demo/mytemplate.tex on their site.

\documentclass[11]{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{lmodern}
\usepackage{microtype}

% In code snippets, show backtick (`, grave accent) as a short straight line,
% not a curved quote. I could have used \IfFileExists{upquote.sty}{...}{}
% to make this package optional, but I really think it's important, and
% the user in a modern Linux distribution should be able to get it easily.
\usepackage{upquote}

% Nice header with document's name and section name, and footer
% with page number.
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{\itshape Seastar}
\chead{}
\rhead{\itshape{\nouppercase{\leftmark}}}
\lfoot{}
\cfoot{}
\rfoot{\thepage}

$if(highlighting-macros)$
$highlighting-macros$
$endif$

% Support links in PDF files
\usepackage[]{hyperref}
\hypersetup{breaklinks=true,
            bookmarks=true, % show bookmark bar (i.e, TOC sidebar) in PDF viewer
	    pdfstartview=FitH, % cause Adobe Acrobat to do "fit to width"
            pdfauthor={ScyllaDB},
            pdftitle={Asynchronous Programming with Seastar},
            colorlinks=true,  % if false, uses boxed links
            urlcolor=blue,    % color of external links
            linkcolor=magenta % color of internal links (to other sections)
}

% Indentation went out of style with Disco music... It is especially
% inconvenient in text which includes a lot of code snippets, etc, which
% causes a lot of indents not preceeded by a text paragraph. So replace
% the indentation with increased spacing between paragraphs. Note that this
% also makes the TOC more spacious, I'm not sure it's a great idea.
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}

% Apparently, newer versions of pandoc use a "\tightlist" command, and
% we need to implement it.
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

% Fancy-formatted title, but take the author list and date (if set) from the
% preable in the markdown file.
\title{\textbf{\fontsize{0.75cm}{1.5em}\selectfont Asynchronous Programming} \\ \textbf{\fontsize{0.75cm}{1.5em}\selectfont with} \\ \textbf{\fontsize{3cm}{1.5em}\selectfont Seastar}}
\author{$for(author)$$author$$sep$ \and $endfor$}
\date{$date$}

\begin{document}
\maketitle

% Table of contents, before the body of the document. Make the TOC clickable,
% with links to the respective sections, but override the internal link color
% set above (magenta) by normal black color, because the entire TOC being in
% a different color looks rather conspicuous.
{
\hypersetup{linkcolor=black}
\tableofcontents
}

$body$

\end{document}