| | \documentclass[a4paper, 11pt]{article} |
---|
| | |
---|
| | \RequirePackage[l2tabu, orthodox]{nag} |
---|
| | |
---|
| | \usepackage[a4paper, portrait, hmargin=20mm, vmargin=25mm]{geometry} |
---|
| | \usepackage[bookmarks, colorlinks]{hyperref} |
---|
| | \usepackage{paralist, float, tabularx, hhline, graphicx, xcolor, todonotes, |
---|
| | bbding, hyperref, needspace, booktabs, changepage} |
---|
| | \usepackage{enumitem, float, tabularx, hhline, graphicx, xcolor, |
---|
| | hyperref, booktabs} |
---|
| | |
---|
| | \usepackage[most]{tcolorbox} |
---|
| | |
---|
| | \hypersetup{ |
---|
| | citecolor=black, linkcolor=black, % don't need colored links |
---|
| | urlcolor=blue!55!black % blue enough to see, but dark enough to print |
---|
| |
---|
| | \setmonofont[Scale=MatchLowercase]{Inconsolata} |
---|
| | |
---|
| | \usepackage{microtype} % general improvements to typography |
---|
| | |
---|
| | |
---|
| | % 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{fancyhdr} |
---|
| | \pagestyle{fancyplain} |
---|
| | \fancyhead[L]{\footnotesize\textsf{\PaperCode~--~\PaperTitle}} |
---|
| | \fancyhead[L]{\footnotesize\textsf{\PaperCode~---~\PaperTitle}} |
---|
| | \fancyhead[C]{} |
---|
| | \fancyhead[R]{\footnotesize\textsf{\LabNum\LabTitle}} |
---|
| | \fancyfoot[L]{} |
---|
| | \fancyfoot[C]{\footnotesize\textsf{\thepage}} |
---|
| |
---|
| | |
---|
| | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| | %% syntax highlighting %% |
---|
| | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| | \usepackage{listings} % syntax highlighting |
---|
| | \usepackage{lstautogobble} % add-on for listings that auto-gobbles leading spaces in code |
---|
| | \usepackage{listings, lstautogobble} % syntax highlighting |
---|
| | |
---|
| | % create the fonts for code highlighting |
---|
| | \newcommand\codesize{\fontsize{11}{10}\selectfont} |
---|
| | \newcommand{\codefont}{\ttfamily} |
---|
| | |
---|
| | % 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} |
---|
| |
---|
| | alsoletter=-: |
---|
| | } |
---|
| | |
---|
| | % create a new environment for source code blocks |
---|
| | \lstnewenvironment{codeblock}[1][] |
---|
| | { |
---|
| | \lstset{ |
---|
| | \lstnewenvironment{codeblock}[1][]{% |
---|
| | \lstset{% |
---|
| | language=Java, |
---|
| | upquote=true, |
---|
| | autogobble=true, |
---|
| | xleftmargin=1em, |
---|
| | xleftmargin=0pt, |
---|
| | basicstyle=\color{black}\codefont\codesize, |
---|
| | keywordstyle=\color{KeywordColor}\codefont\codesize, |
---|
| | commentstyle=\color{CommentColor}\codefont\codesize, |
---|
| | stringstyle=\color{StringColor}\codefont\codesize, |
---|
| | aboveskip=10pt, |
---|
| | aboveskip=0pt, |
---|
| | belowskip=0pt, |
---|
| | showstringspaces=false, |
---|
| | tabsize=3, |
---|
| | showtabs=false, |
---|
| | columns=fullflexible, |
---|
| | flexiblecolumns=true, |
---|
| | breaklines=true |
---|
| | }\lstset{#1}} |
---|
| | }\lstset{#1}}% |
---|
| | {} |
---|
| | |
---|
| | |
---|
| | % command for typesetting inline code |
---|
| | \newcommand{\code}[1]{% |
---|
| | \lstset{% |
---|
| |
---|
| | showtabs=false |
---|
| | }% |
---|
| | \mbox{\lstinline!#1!}} |
---|
| | |
---|
| | % centre command that won't add any vertical space before or after |
---|
| | \newcommand{\centre}[1]{\hfill#1\hfill} |
---|
| | |
---|
| | |
---|
| | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| | %% figures %% |
---|
| | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| |
---|
| | %% lists %% |
---|
| | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| | |
---|
| | % fix the extra spacing that itemize/enumerate has when you put have an blank |
---|
| | % line prior to the environment (enumitem). |
---|
| | |
---|
| | \setlist*{topsep=0.2\baselineskip} |
---|
| | \setlist*{partopsep=-0.5\baselineskip} |
---|
| | \setlist*{itemsep=0.2\baselineskip} |
---|
| | \setlist*{parsep=0.4\baselineskip} |
---|
| | |
---|
| | % 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}} |
---|
| | |
---|
| | %\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}} |
---|
| | |
---|
| | \newcommand{\complete}{{\color{green}\Checkmark}~} |
---|
| | \newcommand{\incomplete}{{\color{red}\XSolidBrush}~} |
---|
| | |
---|
| | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| | %% 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} |
---|
| | } |
---|
| | |
---|
| | % menus, key strokes, paths |
---|
| | \usepackage[os=win]{menukeys} |
---|
| | \renewmenumacro{\menu}[>]{roundedmenus} |
---|
| |
---|
| | \changemenucolortheme{roundedmenus}{blacknwhite} |
---|
| | \changemenucolortheme{pathswithfolder}{blacknwhite} |
---|
| | \changemenucolortheme{roundedkeys}{blacknwhite} |
---|
| | |
---|
| | % centre command that won't add any vertical space before or after |
---|
| | \newcommand{\centre}[1]{\hfill#1\hfill} |
---|
| | |
---|
|