\documentclass[a4paper, 12pt, pdftex]{article} \usepackage{cmap} % attempt to fix search with ligatures problem. \usepackage[pdftex]{graphicx} \usepackage[pdftex, a4paper, portrait, left=20mm, right=20mm, top=30mm, bottom=25mm]{geometry} \usepackage[pdftex, bookmarks, colorlinks=false]{hyperref} \usepackage{paralist} \usepackage{pslatex} \usepackage{float} \usepackage{tabularx} \usepackage{hhline} \usepackage[usenames]{xcolor} \usepackage{pdfpages} % font stuff \usepackage[scaled]{beramono} % code font \usepackage[T1]{fontenc} % might fix copy-pasting issues \usepackage[protrusion=true,expansion=true]{microtype} \usepackage{textcomp} \usepackage{listings} \usepackage{sectsty} % easily change section style \allsectionsfont{\raggedright\sffamily\bfseries} \usepackage{titlesec} % allows adjustment of section spacing \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 is 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}} \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} % PDF tex graphics extensions \DeclareGraphicsExtensions{.jpg,.jpeg,.pdf,.png,.mps} % font size for code \def\thesize{11truept} % relax the justification/hyphenation wrapping settings \tolerance=800 \emergencystretch=15mm % kill the paragraph indenting \setlength{\parindent}{0 mm} \setlength{\parskip}{0.7\baselineskip} % create the fonts for code highlighting \newcommand\codesize{\fontsize{11}{8}\selectfont} \newcommand{\codefont}{\fontfamily{fvm}\selectfont} \newcommand{\commentfont}{\rmfamily\itshape} % 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) \definecolor{KeywordColor}{rgb}{0.0,0,0.9} \definecolor{CommentColor}{rgb}{0.39,0.39,0.39} \definecolor{StringColor}{rgb}{0.41,0.24.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\normalsize, keywordstyle=\color{KeywordColor}\codefont\normalsize, commentstyle=\color{CommentColor}\commentfont\normalsize, stringstyle=\color{StringColor}\codefont\normalsize, 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} % 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} } % new indent command that doesn't rely on \parindent \renewcommand{\indent}{\hspace*{5 mm}} % make \emph do italics (just in case other environments make it do something else) \renewcommand{\emph}[1]{\textit{#1}} % a simpler way of getting a right arrow \newcommand{\ra}[0]{$\rightarrow$~} % a command for padding out a page \newcommand{\pad}[0]{\vspace{\stretch{1}}} % command for adding a placeholder for information to be entered at a later date \newcommand{\fixme}[1]{\textcolor{red}{\textbf{TO DO:~ }#1}} \newcommand{\todo}[1]{\fixme{#1}} % fix the extra spacing that itemize/enumerate has when you put have an blank % line prior to the environment. \setlength{\pltopsep}{0.2\baselineskip} \setlength{\plpartopsep}{-0.2\baselineskip} \setlength{\plitemsep}{0.2\baselineskip} \setlength{\plparsep}{0.4\baselineskip} \renewenvironment{itemize}% {\begin{compactitem}}% {\end{compactitem}} \renewenvironment{enumerate}% {\begin{compactenum}}% {\end{compactenum}}