diff --git a/lectures/preamble.tex b/lectures/preamble.tex index 7e7346d..46aada4 100644 --- a/lectures/preamble.tex +++ b/lectures/preamble.tex @@ -2,9 +2,7 @@ \usepackage{fixseminar} \usepackage{soul} \usepackage{graphicx} -\usepackage{pslatex} \usepackage{paralist} -\usepackage{tplists} \usepackage{multicol} \usepackage{tabularx} \usepackage{hhline} @@ -12,8 +10,9 @@ \usepackage[T1]{fontenc} % needed for getting rid of smart quotes in code \usepackage[scaled]{beramono} % code font \usepackage{textcomp} % needed for getting rid of smart quotes in code -\usepackage[protrusion=true,expansion=true]{microtype} +\usepackage{microtype} \usepackage{listings} +\usepackage{todonotes} \usepackage[default]{gillius} \definecolor{SectionColor}{rgb}{0.32,0.32,0.32} @@ -22,19 +21,18 @@ % PDF tex graphics extensions {graphicx} \DeclareGraphicsExtensions{.jpg,.jpeg,.pdf,.png,.mps} - % slidemargins {seminar,powersem} -\renewcommand{\slidetopmargin}{11mm} -\renewcommand{\slidebottommargin}{7mm} -\renewcommand{\slideleftmargin}{5mm} -\renewcommand{\sliderightmargin}{5mm} +\renewcommand{\slidetopmargin}{15mm} +\renewcommand{\slidebottommargin}{15mm} +\renewcommand{\slideleftmargin}{15mm} +\renewcommand{\sliderightmargin}{15mm} %%% source code highlighting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % first param is font size, second is baselineskip -\newcommand\codesize{\fontsize{9}{1.3\parskip}\selectfont} -\newcommand\smallcodesize{\fontsize{8}{1.2\parskip}\selectfont} +\newcommand\codesize{\fontsize{9}{1.1em}\selectfont} +\newcommand\smallcodesize{\fontsize{8}{1.1em}\selectfont} % define the colors for code highlighting (based on Eclipse colors) @@ -49,7 +47,7 @@ % create the fonts for code highlighting \newcommand{\codefont}{\fontfamily{fvm}\selectfont} % beramono -\newcommand{\commentfont}{\rmfamily\itshape} +\newcommand{\commentfont}{\sffamily\itshape} % create a new environment for source code blocks \lstnewenvironment{codeblock}[1][] @@ -59,17 +57,17 @@ upquote=true, basicstyle=\color{black}\codefont\codesize, keywordstyle=\color{KeywordColor}\codefont\codesize, - commentstyle=\color{CommentColor}\commentfont\normalsize, + commentstyle=\color{CommentColor}\commentfont\codesize, stringstyle=\color{StringColor}\codefont\codesize, - gobble=2, - aboveskip=10pt, + aboveskip=5pt, belowskip=0pt, + lineskip=-5pt, showstringspaces=false, tabsize=3, showtabs=false, columns=fullflexible, flexiblecolumns=true, - xleftmargin=\slideleftmargin, + xleftmargin=0pt, breaklines=true }\lstset{#1}} {} @@ -84,15 +82,15 @@ keywordstyle=\color{KeywordColor}\codefont\smallcodesize, commentstyle=\color{CommentColor}\commentfont\codesize, stringstyle=\color{StringColor}\codefont\smallcodesize, - gobble=2, - aboveskip=5pt, + aboveskip=3pt, belowskip=-5pt, + lineskip=-9pt, showstringspaces=false, tabsize=2, showtabs=false, columns=fullflexible, flexiblecolumns=true, - xleftmargin=\slideleftmargin, + xleftmargin=0pt, breaklines=true }\lstset{#1}} {} @@ -162,28 +160,30 @@ \renewcommand{\slidestretch}{1.05} % increase paragraph spacing a little bit so slides don't look so crowded -\renewcommand{\slideparskip}{1.1ex} +\renewcommand{\slideparskip}{1.5ex} -% tweak section spacing and fonts -\makeatletter -\renewcommand\section{\@startsection{section}{1} % - {0ex} % indent - {-0.1ex} % above - {0.1ex} % below - {\huge\color{SectionColor}}} -\renewcommand\subsection{\@startsection{subsection}{2} % - {0ex} % indent - {-0.1ex} % above - {0.1ex} % below - {\Large\color{SectionColor}}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% sections %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\renewcommand\subsubsection{\@startsection{subsubsection}{3} % - {0ex} % indent - {-0.1ex} % above - {0.1ex} % below - {\large\color{SectionColor}}} -\makeatother +\usepackage[sf,bf]{titlesec} + +\titlespacing{\section}{0pt}{0pt}{0pt} +\titlespacing{\subsection}{0pt}{0pt}{0pt} +\titlespacing{\subsubsection}{0pt}{0pt}{0pt} +\titlespacing{\paragraph}{0pt}{0pt}{-0.5\parskip} + +\titleformat{\section}{\normalfont\Huge\sffamily\bfseries\filcenter}{\theparagraph}{1em}{} +\titleformat{\subsection}{\normalfont\Large\sffamily\bfseries\filcenter}{\theparagraph}{1em}{} +\titleformat{\subsubsection}{\normalfont\large\sffamily\bfseries\filcenter}{\theparagraph}{1em}{} +\titleformat{\paragraph}{\normalfont\normalsize\sffamily\bfseries\filcenter}{\theparagraph}{1em}{} + +% 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}} + % suppress slide centering (which buggers up incremental uncovering, and makes % things jump around a lot) @@ -206,21 +206,6 @@ \newcommand{\ra}[0]{$\rightarrow$~} -%\definecolor{oublue}{cmyk}{1,0.85,0.1,0} % RGB 0, 15, 90 -%\definecolor{oured}{cmyk}{0,0.9,0.85,0} % RGB 100, 10, 15 -%\definecolor{ougold}{cmyk}{0,0.25,1,0} % RGB 100, 75, 0 -%\definecolor{darkred}{cmyk}{0,1,1,0.1} - -%\newpagestyle{oupagestyle}% -%{\color{ougold}\hspace{-\slideleftmargin}\rule[2mm]{0.1\textwidth}{\baselineskip}\color{oublue}\rule[2mm]{0.87\textwidth}{\baselineskip}\color{oured}\rule[2mm]{0.1\textwidth}{\baselineskip}}% -%{\color{ougold}\hspace{-\slideleftmargin}\rule{0.97\textwidth}{\baselineskip}\color{oured}\rule{0.1\textwidth}{\baselineskip}% bottom band -%\tiny\hspace{-\textwidth}\hspace{-\slideleftmargin}\color{black}% reset to start of band -%\hspace{5pt}\raisebox{3.5pt}\PaperCode\hfill\raisebox{3.5pt}{\textsc{\LectureTitle}} % footer content -%\hfill\raisebox{3.5pt}{\thepage}\hspace{3pt}% page number -%} -% -%\slidepagestyle{oupagestyle} - \slidepagestyle{empty} @@ -229,14 +214,44 @@ % environment for generating first page content \newenvironment{lecturecontent}% {% - \null\vfill\maketitle\vfill% - \section{Topics covered in this lecture}% - \begin{compactitem} + \null\vfill\maketitle\vfill\vfill\null% + \newslide + \section{Topics covered}% + \begin{itemize} }% {% - \end{compactitem}\vfill\null% + \end{itemize}% } \newcommand{\point}[2]{\textbf{#1}\\#2} -\renewcommand{\emph}[1]{\color{emcolor}\textbf{#1}} +\renewcommand{\emph}[1]{\color{emcolor}\textit{#1}} +\newcommand{\strong}[1]{\color{emcolor}\textbf{#1}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 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.2\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$} +\def\labelitemiv{\footnotesize$\triangleright$} +