forked from joelfenwick/ctute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
92 lines (82 loc) · 2.83 KB
/
main.tex
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
\documentclass[a4paper,10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{color}
\usepackage[colorlinks=true, linkcolor=black]{hyperref}
\usepackage{graphicx}
\usepackage{framed}
% This document (including sub files) is made available under
% Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
% Original document by Joel Fenwick - 2016
% Contributions by Joel Fenwick are copyright by The University of Queensland
% Additional authors added for non-trivial contributions
% Design principles:
% * this is not intended to be a textbook - it is supposed to support lectures or other resources
% * it is intended to be usable (if not optimal) as both a reference and as a tutorial
% * forward concept references are to be avoided. If something is presented as an example which
% readers are supposed to learn from, then they should be able to understand everything in that example.
% That is not to say concept explanations can't be iterated/elaborated on later
% * System/environment specific details should be separated into their own files so they can be disabled/switched out.
% * Except for small fragments, hypreref link to programs so they can be placed elsewhere in the document/floated.
% * Only use widely available LaTeX packages --- distributed with or auto download for most major LaTeX distributions.
% Think you need to add a class or package to this repo, please think again.
% * Content is to be restricted to standard-C99
\newenvironment{exercise}{\noindent\ignorespaces {\large Exercise:}\addcontentsline{toc}{section}{Exercise}\\}{}
\newenvironment{knowledge}{\begin{framed}}{\end{framed}}
\newcommand{\todo}[1]{\textbf{#1}}
\lstset{basicstyle=\ttfamily,
columns=flexible, % To convince it to do the right thing with quotes
language=C,
upquote=true,
showstringspaces=false,
escapechar=~,
keywordstyle=\color[rgb]{0,0,1},
commentstyle=\color[rgb]{0.133,0.545,0.133},
stringstyle=\color[rgb]{0.627,0.126,0.941}
}
\lstnewenvironment{codeblock}{\lstset{
numbers=left,
frame=l}}{}
\lstnewenvironment{codeinline}{\lstset{
frame=none,
numbers=none}}{}
\begin{document}
\title{A C tutorial/refresher}
\author{Joel Fenwick (editor)}
\addcontentsline{toc}{section}{Cover}
\pagestyle{empty}
\vspace*{6cm}
\begin{center}
{\LARGE A C tutorial/refresher}\\
\vspace*{5mm}
{\large 2018-2}\\
\end{center}
\vfill
\begin{flushright}
Joel Fenwick (editor)\\
Justin Goldizen\\
Mitchell Krome\\
Will Toohey
\end{flushright}
\vfill
\vfill
\tableofcontents
\addcontentsline{toc}{section}{Contents}
\lstset{language=C}
\input{linuxenv}
\input{firstprog}
\input{firstoutput}
\input{operators}
\input{functions}
\input{arraysandpointers}
\input{structs}
\input{simplefileio}
\input{strings}
\input{enums}
\input{simpleinput}
\input{queue}
\input{gloss}
\appendix
\input{howto}
\end{document}