Paralist -> enumitem. Added Makefile.
1 parent fecc767 commit d9938560d6af4fdd414726e5d1033d2c094b330e
Mark George authored on 8 Sep 2017
Showing 3 changed files
View
39
xelatex/labs/Makefile 0 → 100644
## Quick usage ##
 
# Generate everything:
# >make
 
# Generate just the raw presentation (no page numbers)
# >make quick
 
# Clean rubbish (leaving PDFs)
# >make clean
 
# Clean everything (including PDFs)
# >make nuke
 
# Compile in continuous mode
# >make continuous
 
SOURCE=$(basename $(or $(wildcard lab*.tex), $(wildcard test*.tex), $(wildcard outline.tex), $(wildcard project*.tex),$(wildcard *exercises.tex),$(wildcard *report.tex),$(wildcard phase*.tex),$(wildcard lec*.tex)))
RUBBISH=*.tmp *.xdv *.log *.up*
.PHONY=clean nuke continuous quick presentation slides handout all
 
default: ${SOURCE}.pdf
 
${SOURCE}.pdf: ${SOURCE}.tex
latexmk -xelatex ${SOURCE}.tex
 
continuous:
latexmk -xelatex -pvc -pv- -interaction=nonstopmode ${SOURCE}.tex
 
2up: ${SOURCE}.pdf
pdfnup --frame true --a4paper --suffix 2up ${SOURCE}.pdf
 
clean:
latexmk -c
rm -f $(RUBBISH)
 
nuke: clean
latexmk -C
View
106
xelatex/labs/preamble.tex
\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}
View
2
■■■
xelatex/lectures/preamble.tex
\usepackage{microtype}
 
\setmainfont[Ligatures=NoCommon, Scale=0.95]{Open Sans Light}
\setsansfont[Ligatures=NoCommon, Scale=MatchLowercase]{Roboto Condensed}
\setmonofont[Scale=MatchLowercase]{Inconsolata}
\setmonofont[Ligatures=NoCommon, Scale=MatchLowercase]{Inconsolata}
 
% make \emph do italics (just in case other environments change it)
\renewcommand{\emph}[1]{\textit{#1}}