Moved things around a bit. Improved pantuml styles.
1 parent 7a52f59 commit 4c73f16206ba70475be624cae9c93a2008af080d
Mark authored on 13 Apr 2015
Showing 22 changed files
View
63
labs/Makefile 100644 → 0
# Makefile for latex documents.
 
# Author: Mark George <mgeorge@infoscience.otago.ac.nz>
 
# driver file (tries to automatically find the driver file)
SOURCE=$(basename $(or $(wildcard lab*.tex), $(wildcard test*.tex), $(wildcard outline.tex), $(wildcard project.tex),$(wildcard *exercises.tex),$(wildcard *report.tex),$(wildcard lec*.tex)))
# if the driver file isn't one of the above then just set the value of the SOURCE variable to the name WITHOUT the extension
 
 
# preamble file
PREAMBLE=preamble
 
# files that will be deleted when we clean
RUBBISH=*.aux *.out *.dvi *.log *.ps *~ *.*~ auto *.toc *.fdb_latexmk *.fls
 
# latex command
LATEX=pdflatex
 
.PHONY: clean
 
default: texify clean-rubbish
 
pdf: default
 
2up: pdf
# spit out a 2up driver
echo "\documentclass{article}\usepackage{pdfpages}\usepackage[a4paper,landscape, pdftex,vmargin=0in,hmargin=0.0in]{geometry}\begin{document}\includepdf[nup=2x1,frame,pages=-,delta=0mm 0mm]{%" >| 2up.tex
echo ${SOURCE}.pdf% >> 2up.tex
echo "}\end{document}" >> 2up.tex
 
# texify it
${LATEX} 2up.tex
 
# clean up
rm 2up.tex
mv 2up.pdf ${SOURCE}_2up.pdf
 
# get rid of any additional generated rubbish
rm -rf $(RUBBISH)
 
# texify target
texify: ${SOURCE}.pdf
 
# compile as many times as needed (at least twice to get PDF bookmarks right) to sort out references and labels
${SOURCE}.pdf: ${SOURCE}.tex ${PREAMBLE}.tex
$(LATEX) ${SOURCE}.tex
$(LATEX) ${SOURCE}.tex
 
# once more if there are still undefined references
if [ -n "$(shell grep 'There were undefined references' ${SOURCE}.log)" ]; then $(LATEX) ${SOURCE}.tex ; fi
 
# once more if there are labels that have changed
if [ -n "$(shell grep 'Label(s) may have changed' ${SOURCE}.log)" ]; then $(LATEX) ${SOURCE}.tex ; fi
 
# delete unwanted generated files
clean-rubbish:
rm -rf $(RUBBISH)
 
# delete ALL generated files
clean: clean-rubbish
rm -rf ${SOURCE}.pdf ${SOURCE}_2up.pdf
 
View
237
labs/preamble.tex 100644 → 0
\documentclass[a4paper, 12pt]{article}
 
\usepackage[a4paper, portrait, hmargin=20mm, vmargin=25mm]{geometry}
\usepackage[bookmarks, colorlinks]{hyperref}
\usepackage{paralist, float, tabularx, hhline, graphicx, xcolor, todonotes, hyperref}
 
\hypersetup{
bookmarks, colorlinks,
citecolor=black, linkcolor=black, % don't need colored links
urlcolor=blue!55!black % blue enough to see, but dark enough to print
}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% fonts %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\usepackage{cmap} % fix PDF searching (ligatures cause problems)
\usepackage{libertine} % default font set (looks good on both screen and paper)
\usepackage[scaled]{beramono} % code font
\usepackage[T1]{fontenc} % force type 1 fonts
\usepackage{microtype} % general improvements to typography
\usepackage{textcomp} % additional symbols (like the degrees symbol}
\usepackage{listings} % syntax highlighting
 
% make \emph do italics (just in case other environments change it)
\renewcommand{\emph}[1]{\textit{#1}}
 
% add a \strong command
\newcommand{\strong}[1]{\textbf{#1}}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% sections %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\usepackage[sf,bf]{titlesec}
\titlespacing{\section}{0pt}{0.75\parskip}{-0.25\parskip}
\titlespacing{\subsection}{0pt}{0.75\parskip}{-0.25\parskip}
\titlespacing{\subsubsection}{0pt}{0.75\parskip}{-0.25\parskip}
\titlespacing{\paragraph}{0pt}{0.75\parskip}{-0.25\parskip}
 
% repurpose \paragraph as \subsubsubsection (which it sort of is already)
\titleformat{\paragraph}{\normalfont\normalsize\sffamily\bfseries}{\theparagraph}{1em}{}
\titlespacing{\paragraph}{0pt}{0.75\parskip}{-0.25\parskip}
\newcommand{\subsubsubsection}[1]{\paragraph{#1}}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% headers/footers %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead[L]{\footnotesize\PaperCode~--~\PaperTitle}
\fancyhead[C]{}
\fancyhead[R]{\footnotesize\LabNum\LabTitle}
\fancyfoot[L]{}
\fancyfoot[C]{\thepage}
\fancyfoot[R]{}
\setlength{\headheight}{14pt}
\renewcommand{\footrulewidth}{0pt}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% general layout %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% relax the justification/hyphenation wrapping settings
\tolerance=800
\emergencystretch=5mm
 
% try to avoid widows and orphans
\clubpenalty = 10000
\widowpenalty = 10000
 
% kill the paragraph indenting
\setlength{\parindent}{0 mm}
\setlength{\parskip}{0.7\baselineskip}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% syntax highlighting %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% create the fonts for code highlighting
\newcommand\codesize{\fontsize{11}{8}\selectfont}
\newcommand{\codefont}{\fontfamily{fvm}\selectfont} % beramono
\newcommand{\commentfont}{\rmfamily\itshape} % standard roman
 
% define the colors for code highlighting (based on Eclipse colors)
%\definecolor{KeywordColor}{rgb}{0.5,0,0.33}
%\definecolor{CommentColor}{rgb}{0.25,0.5,0.37}
%\definecolor{StringColor}{rgb}{0.16,0,1}
 
% define the colors for code highlighting (based on NetBeans colors, although darker)
\definecolor{KeywordColor}{rgb}{0.0,0,0.7}
\definecolor{CommentColor}{rgb}{0.3,0.3,0.3}
\definecolor{StringColor}{rgb}{0.4,0.22.0}
 
\lstdefinelanguage{JavaScript}{
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break, this},
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]',
morestring=[b]"
}
 
% create a new environment for source code blocks
\lstnewenvironment{codeblock}[1][]
{
\lstset{
language=Java,
upquote=true,
basicstyle=\color{black}\codefont\codesize,
keywordstyle=\color{KeywordColor}\codefont\codesize,
commentstyle=\color{CommentColor}\commentfont\normalsize,
stringstyle=\color{StringColor}\codefont\codesize,
aboveskip=10pt,
belowskip=0pt,
showstringspaces=false,
tabsize=3,
showtabs=false,
columns=fullflexible,
flexiblecolumns=true,
breaklines=true
}\lstset{#1}}
{}
 
% command for typesetting inline code
\newcommand{\code}[2][language=java]{%
\lstset{%
language=Java,
upquote=true,
basicstyle=\color{black}\codefont\codesize,
keywordstyle=\color{black}\codefont\codesize,
commentstyle=\color{black}\commentfont\normalsize,
stringstyle=\color{black}\codefont\codesize,
showstringspaces=false,
showtabs=false
}%
\mbox{\lstinline[#1]!#2!}}
 
% centre command that won't add any vertical space before or after
\newcommand{\centre}[1]{\hfill#1\hfill}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% figures %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% PDF tex graphics extensions
\DeclareGraphicsExtensions{.jpg,.jpeg,.pdf,.png}
 
% command for figures with captions - first param is scale.
\newcommand{\captionedfig}[3] {
\begin{figure}[H]
\begin{center}
\includegraphics[scale=#1,draft=false]{#2}
\\
#3
\vspace{-25pt}
\end{center}
\end{figure}
}
 
% command for figures - first param is scale.
\newcommand{\fig}[2] {
\begin{figure}[H]
\begin{center}
\includegraphics[scale=#1,draft=false]{#2}
\vspace{-25pt}
\end{center}
\end{figure}
}
 
% command for figures rotated 90 degrees right - first param is scale.
\newcommand{\rotatedfig}[2] {
\begin{figure}[H]
\begin{center}
\includegraphics[scale=#1,draft=false, angle=270]{#2}
\end{center}
\end{figure}
}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% lists %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% fix the extra spacing that itemize/enumerate has when you put have an blank
% line prior to the environment (paralist).
\setlength{\pltopsep}{0.2\baselineskip}
\setlength{\plpartopsep}{-0.2\baselineskip}
\setlength{\plitemsep}{0.2\baselineskip}
\setlength{\plparsep}{0.4\baselineskip}
 
% use paralist compact versions by default so that above tweaks are used
\renewenvironment{itemize}%
{\begin{compactitem}}%
{\end{compactitem}}
 
\renewenvironment{enumerate}%
{\begin{compactenum}}%
{\end{compactenum}}
 
% rationalise the bullet points
\def\labelitemi{\footnotesize$\bullet$}
\def\labelitemii{\footnotesize$\circ$}
\def\labelitemiii{\footnotesize$\diamond$}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to-do notes %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% fix todonotes 'wrong margin' issue
\reversemarginpar
\newcommand{\fix}{\todo[color=red!60,noline,size=\large]{Fix}}
\newcommand{\comment}[1]{\todo[color=yellow!60,inline,size=\large]{#1}}
\newcommand{\incomplete}{\todo[color=red!60,inline,size=\large]{Incomplete}}
\newcommand{\complete}{\todo[color=green!60,inline,size=\large]{Complete}}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% misc %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% a simpler way of getting a right arrow
\newcommand{\ra}[0]{$\rightarrow$~}
 
% a section header and counter for exercises
\newcounter{ExerciseCounter}
 
\newcommand{\exercise}[1]{%
\stepcounter{ExerciseCounter}%
\section{Exercise \arabic{ExerciseCounter}~--~#1}
}
View
63
latex/labs/Makefile 0 → 100644
# Makefile for latex documents.
 
# Author: Mark George <mgeorge@infoscience.otago.ac.nz>
 
# driver file (tries to automatically find the driver file)
SOURCE=$(basename $(or $(wildcard lab*.tex), $(wildcard test*.tex), $(wildcard outline.tex), $(wildcard project*.tex),$(wildcard *exercises.tex),$(wildcard *report.tex),$(wildcard lec*.tex)))
# if the driver file isn't one of the above then just set the value of the SOURCE variable to the name WITHOUT the extension
 
 
# preamble file
PREAMBLE=preamble
 
# files that will be deleted when we clean
RUBBISH=*.aux *.out *.dvi *.log *.ps *~ *.*~ auto *.toc *.fdb_latexmk *.fls
 
# latex command
LATEX=pdflatex
 
.PHONY: clean
 
default: texify clean-rubbish
 
pdf: default
 
2up: pdf
# spit out a 2up driver
echo "\documentclass{article}\usepackage{pdfpages}\usepackage[a4paper,landscape, pdftex,vmargin=0in,hmargin=0.0in]{geometry}\begin{document}\includepdf[nup=2x1,frame,pages=-,delta=0mm 0mm]{%" >| 2up.tex
echo ${SOURCE}.pdf% >> 2up.tex
echo "}\end{document}" >> 2up.tex
 
# texify it
${LATEX} 2up.tex
 
# clean up
rm 2up.tex
mv 2up.pdf ${SOURCE}_2up.pdf
 
# get rid of any additional generated rubbish
rm -rf $(RUBBISH)
 
# texify target
texify: ${SOURCE}.pdf
 
# compile as many times as needed (at least twice to get PDF bookmarks right) to sort out references and labels
${SOURCE}.pdf: ${SOURCE}.tex ${PREAMBLE}.tex
$(LATEX) ${SOURCE}.tex
$(LATEX) ${SOURCE}.tex
 
# once more if there are still undefined references
if [ -n "$(shell grep 'There were undefined references' ${SOURCE}.log)" ]; then $(LATEX) ${SOURCE}.tex ; fi
 
# once more if there are labels that have changed
if [ -n "$(shell grep 'Label(s) may have changed' ${SOURCE}.log)" ]; then $(LATEX) ${SOURCE}.tex ; fi
 
# delete unwanted generated files
clean-rubbish:
rm -rf $(RUBBISH)
 
# delete ALL generated files
clean: clean-rubbish
rm -rf ${SOURCE}.pdf ${SOURCE}_2up.pdf
 
View
247
latex/labs/preamble.tex 0 → 100644
\documentclass[a4paper, 12pt]{article}
 
\usepackage[a4paper, portrait, hmargin=20mm, vmargin=25mm]{geometry}
\usepackage[bookmarks, colorlinks]{hyperref}
\usepackage{paralist, float, tabularx, hhline, graphicx, xcolor, todonotes, hyperref}
 
\hypersetup{
bookmarks, colorlinks,
citecolor=black, linkcolor=black, % don't need colored links
urlcolor=blue!55!black % blue enough to see, but dark enough to print
}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% fonts %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\usepackage{cmap} % fix PDF searching (ligatures cause problems)
\usepackage{libertine} % default font set (looks good on both screen and paper)
\usepackage[scaled]{beramono} % code font
\usepackage[T1]{fontenc} % force type 1 fonts
\usepackage{microtype} % general improvements to typography
\usepackage{textcomp} % additional symbols (like the degrees symbol}
\usepackage{listings} % syntax highlighting
 
% make \emph do italics (just in case other environments change it)
\renewcommand{\emph}[1]{\textit{#1}}
 
% add a \strong command
\newcommand{\strong}[1]{\textbf{#1}}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% sections %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\usepackage[sf,bf]{titlesec}
\titlespacing{\section}{0pt}{0.75\parskip}{-0.25\parskip}
\titlespacing{\subsection}{0pt}{0.75\parskip}{-0.25\parskip}
\titlespacing{\subsubsection}{0pt}{0.75\parskip}{-0.25\parskip}
\titlespacing{\paragraph}{0pt}{0.75\parskip}{-0.25\parskip}
 
% repurpose \paragraph as \subsubsubsection (which it sort of is already)
\titleformat{\paragraph}{\normalfont\normalsize\sffamily\bfseries}{\theparagraph}{1em}{}
\titlespacing{\paragraph}{0pt}{0.75\parskip}{-0.25\parskip}
\newcommand{\subsubsubsection}[1]{\paragraph{#1}}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% headers/footers %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead[L]{\footnotesize\PaperCode~--~\PaperTitle}
\fancyhead[C]{}
\fancyhead[R]{\footnotesize\LabNum\LabTitle}
\fancyfoot[L]{}
\fancyfoot[C]{\thepage}
\fancyfoot[R]{}
\setlength{\headheight}{14pt}
\renewcommand{\footrulewidth}{0pt}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% general layout %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% relax the justification/hyphenation wrapping settings
\tolerance=800
\emergencystretch=5mm
 
% try to avoid widows and orphans
\clubpenalty = 10000
\widowpenalty = 10000
 
% kill the paragraph indenting
\setlength{\parindent}{0 mm}
\setlength{\parskip}{0.7\baselineskip}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% syntax highlighting %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% create the fonts for code highlighting
\newcommand\codesize{\fontsize{11}{8}\selectfont}
\newcommand{\codefont}{\fontfamily{fvm}\selectfont} % beramono
\newcommand{\commentfont}{\rmfamily\itshape} % standard roman
 
% define the colors for code highlighting (based on Eclipse colors)
%\definecolor{KeywordColor}{rgb}{0.5,0,0.33}
%\definecolor{CommentColor}{rgb}{0.25,0.5,0.37}
%\definecolor{StringColor}{rgb}{0.16,0,1}
 
% define the colors for code highlighting (based on NetBeans colors, although darker so that they are readable when printed on a black and white printer)
\definecolor{KeywordColor}{rgb}{0.0,0,0.6}
\definecolor{CommentColor}{rgb}{0.3,0.3,0.3}
\definecolor{StringColor}{rgb}{0.4,0.22.0}
 
\lstdefinelanguage{JavaScript}{
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break, this},
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]',
morestring=[b]"
}
 
\lstdefinelanguage{xml}
{
morestring=[b][\color{black}]",
moredelim=[s][\color{KeywordColor}]{<}{>},
morecomment=[s]{<?}{?>},
morecomment=[s]{<!--}{-->},
commentstyle=\color{CommentColor},
stringstyle=\color{StringColor},
identifierstyle=\color{black},
alsoletter=-:
}
 
% create a new environment for source code blocks
\lstnewenvironment{codeblock}[1][]
{
\lstset{
language=Java,
upquote=true,
basicstyle=\color{black}\codefont\codesize,
keywordstyle=\color{KeywordColor}\codefont\codesize,
commentstyle=\color{CommentColor}\commentfont\normalsize,
stringstyle=\color{StringColor}\codefont\codesize,
aboveskip=10pt,
belowskip=0pt,
showstringspaces=false,
tabsize=3,
showtabs=false,
columns=fullflexible,
flexiblecolumns=true,
breaklines=true
}\lstset{#1}}
{}
 
% command for typesetting inline code
\newcommand{\code}[2][language=java]{%
\lstset{%
language=Java,
upquote=true,
basicstyle=\color{black}\codefont\codesize,
keywordstyle=\color{black}\codefont\codesize,
commentstyle=\color{black}\commentfont\normalsize,
stringstyle=\color{black}\codefont\codesize,
showstringspaces=false,
showtabs=false
}%
\mbox{\lstinline[#1]!#2!}}
 
% centre command that won't add any vertical space before or after
\newcommand{\centre}[1]{\hfill#1\hfill}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% figures %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% PDF tex graphics extensions
\DeclareGraphicsExtensions{.jpg,.jpeg,.pdf,.png}
 
% command for figures with captions - first param is scale.
\newcommand{\captionedfig}[3] {
\begin{figure}[H]
\begin{center}
\includegraphics[scale=#1,draft=false]{#2}
\\
#3
\vspace{-25pt}
\end{center}
\end{figure}
}
 
% command for figures - first param is scale.
\newcommand{\fig}[2] {
\begin{figure}[H]
\makebox[\textwidth][c]{\includegraphics[scale=#1,draft=false]{#2}}%
\vspace{-5pt}
\end{figure}
}
 
% command for figures rotated 90 degrees right - first param is scale.
\newcommand{\rotatedfig}[2] {
\begin{figure}[H]
\begin{center}
\includegraphics[scale=#1,draft=false, angle=270]{#2}
\end{center}
\end{figure}
}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% lists %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% fix the extra spacing that itemize/enumerate has when you put have an blank
% line prior to the environment (paralist).
\setlength{\pltopsep}{0.2\baselineskip}
\setlength{\plpartopsep}{-0.2\baselineskip}
\setlength{\plitemsep}{0.2\baselineskip}
\setlength{\plparsep}{0.4\baselineskip}
 
% use paralist compact versions by default so that above tweaks are used
\renewenvironment{itemize}%
{\begin{compactitem}}%
{\end{compactitem}}
 
\renewenvironment{enumerate}%
{\begin{compactenum}}%
{\end{compactenum}}
 
% rationalise the bullet points
\def\labelitemi{\footnotesize$\bullet$}
\def\labelitemii{\footnotesize$\circ$}
\def\labelitemiii{\footnotesize$\diamond$}
 
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to-do notes %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% fix todonotes 'wrong margin' issue
\reversemarginpar
\newcommand{\fix}{\todo[color=red!60,noline,size=\large]{Fix}}
\newcommand{\comment}[1]{\todo[color=yellow!60,inline,size=\large]{#1}}
\newcommand{\incomplete}[1]{\todo[color=red!60,inline,size=\large]{Incomplete: #1}}
\newcommand{\complete}{\todo[color=green!60,inline,size=\large]{Complete}}
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% misc %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
% a simpler way of getting a right arrow
\newcommand{\ra}[0]{$\rightarrow$~}
 
% a section header and counter for exercises
\newcounter{ExerciseCounter}
 
\newcommand{\exercise}[1]{%
\stepcounter{ExerciseCounter}%
\section{Exercise \arabic{ExerciseCounter}~--~#1}
}
View
96
latex/lectures/Makefile 0 → 100644
######### Latex Command #########
 
LATEX=pdflatex
 
######### Source Files #########
 
# driver files
HANDOUT=handout
PRESENTATION=presentations
SLIDES=slides
 
######### Generated files to be deleted #########
 
RUBBISH=*.aux *.dvi *.log *.ps *~ *.*~ *.out *.bak *-driver.* *.nav *.snm *.toc *.tmp *.fdb_latexmk *.fls
 
 
######### Dependencies #########
 
DEPENDENCIES=Makefile content.tex lecturedetails.tex preamble.tex
 
 
######### Default Target #########
 
default: slides
pdf: default
 
######### Phony Targets #########
 
.PHONY: default viewpres viewhandout viewslides clean clean-rubbish
 
 
######### Main Targets #########
 
presentation: presentation.pdf clean-rubbish
 
slides: slides.pdf clean-rubbish
 
quick: quick_pres clean-rubbish
 
handout: handout.pdf clean-rubbish
 
all: clean presentation slides handout
 
######### Internal Targets #########
 
presentation.pdf: $(DEPENDENCIES) presentation.tex
 
slides.pdf: $(DEPENDENCIES) slides.tex
 
numbered-slides.pdf: slides.pdf
 
handout.pdf: numbered-slides.pdf
 
######### Driver Targets #########
 
presentation.pdf: $(DEPENDENCIES) presentation.tex
# run pdflatex as many times as needed to get references correct (at least twice to get PDF bookmarks right)
$(LATEX) presentation.tex
$(LATEX) presentation.tex
 
# once more if there are still undefined references
if [ -n "$(shell grep 'There were undefined references' presentation.log)" ]; then $(LATEX) presentation.tex ; fi
 
# once more if there are labels that have changed
if [ -n "$(shell grep 'Label(s) may have changed' presentation.log)" ]; then $(LATEX) presentation.tex ; fi
 
 
slides.pdf: $(DEPENDENCIES) slides.tex
# run pdflatex as many times as needed to get references correct (at least twice to get PDF bookmarks right)
$(LATEX) slides.tex
$(LATEX) slides.tex
 
# once more if there are still undefined references
if [ -n "$(shell grep 'There were undefined references' slides.log)" ]; then $(LATEX) slides.tex ; fi
 
# once more if there are labels that have changed
if [ -n "$(shell grep 'Label(s) may have changed' slides.log)" ]; then $(LATEX) slides.tex ; fi
 
handout.pdf: slides.pdf handout.tex
$(LATEX) handout.tex
 
numbered-slides.pdf: slides.pdf numbered-slides.tex
$(LATEX) numbered-slides.tex
 
# Only runs latex once - for quick (but not always correct) results
quick_pres: $(DEPENDENCIES) presentation.tex
$(LATEX) presentation.tex
 
######### Clean #########
 
clean-rubbish:
rm -f $(RUBBISH)
 
clean: clean-rubbish
rm -f slides.pdf handout.pdf presentation.pdf numbered-slides.pdf
View
latex/lectures/content.tex 0 → 100644
View
latex/lectures/handout.tex 0 → 100644
View
latex/lectures/lecturedetails.tex 0 → 100644
View
latex/lectures/numbered-slides.tex 0 → 100644
View
latex/lectures/preamble.tex 0 → 100644
View
latex/lectures/presentation.tex 0 → 100644
View
latex/lectures/slides.tex 0 → 100644
View
lectures/Makefile 100644 → 0
View
lectures/content.tex 100644 → 0
View
lectures/handout.tex 100644 → 0
View
lectures/lecturedetails.tex 100644 → 0
View
lectures/preamble.tex 100644 → 0
View
lectures/presentation.tex 100644 → 0
View
lectures/slides.tex 100644 → 0
View
plantuml/default-skin.ipu 0 → 100644
View
plantuml/info221-lecture-colours.ipu 0 → 100644
View
plantuml/lecture-style.pu 100644 → 0