forked from aosabook/500lines
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.tex
More file actions
81 lines (66 loc) · 2.27 KB
/
Copy pathsample.tex
File metadata and controls
81 lines (66 loc) · 2.27 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
\begin{aosachapter}{A Sample Chapter}{s:sample}{Michael DiBernardo}
\aosasecti{Introduction}\label{introduction}
A lot of people like to start chapters with a quote like this, or
something similarly inspiring.
\begin{quote}
``Good chapters will make judicious use of formatting\ldots{}''
Anonymous
\end{quote}
There are a lot of quotes that can be used for inspiration.
\href{http://www.brainyquote.com/quotes/keywords/computer_science.html}{This
page} has quite a few.
\aosasecti{Important}\label{important}
Images usually make something look more important.
\aosafigure[240pt]{sample-images/image.png}{Extreme Gravity}{500l.sample.image}
It's especially useful if you can refer to images like
\aosafigref{500l.sample.image} later in the text.\footnote{You can learn
more about this in \aosachapref{s:template-engine}.}
\aosasecti{Data stuff}\label{data-stuff}
We can render a lot of useful stuff in tables like
\aosatblref{500l.tbl.tablesample}.
\begin{table}
\centering
{\footnotesize
\rowcolors{2}{TableOdd}{TableEven}
\begin{tabular}{rl}
\hline
\textbf{Delay}
& \textbf{User Reaction}
\\
\hline
0--100 ms
& Instant
\\
100--300 ms
& Small perceptible delay
\\
300--1000 ms
& Machine is working
\\
1 s+
& Mental context switch
\\
10 s+
& I'll come back later{\ldots}
\\
\hline
\end{tabular}
}
\caption{User Perception of Latency}
\label{500l.tbl.tablesample}
\end{table}
Sometimes things are difficult to put in the PDF, but are fine to put
into HTML. We can use \texttt{markdown} or \texttt{latex} tags for these
cases, which let us choose what to show in each context. An example of
this might be a long link, like a reference to part of the HTML5 spec
\footnote{\url{http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#link-type-prefetch}}
.
You can use LaTeX dollar-style rendering inline in the source markdown
and it will ``just work'' in the PDF, such as with this relation taken
from POSA: $S(N) = \frac{1}{(1 - P) + \frac{P}{N}}$. The HTML version
plays some tricks with MathJax to achieve the same thing.
A lot of authors will cite their references via footnotes. However, if
you'd rather use normal bibtex-style citations, you can use normal LaTeX
citation formatting and this will reference the resources in the final
bibliography \cite{Schmidt:02g}.
\end{aosachapter}