GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
1
mark.george
/
templates
Browse code
Minor tweaks.
master
1 parent
4c73f16
commit
a3f46a78fd997e87aae69f752aea134ec8a0229f
Mark
authored
on 22 May 2015
Patch
Showing
3 changed files
latex/labs/Makefile
latex/labs/preamble.tex
latex/lectures/preamble.tex
Ignore Space
Show notes
View
latex/labs/Makefile
# 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 phase*.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
# 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
Ignore Space
Show notes
View
latex/labs/preamble.tex
\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, needspace} \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} }
\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} }
Ignore Space
Show notes
View
latex/lectures/preamble.tex
\usepackage[pdftex]{hyperref} % options added via hypersetup below \usepackage{etex} % increase number of dimension registers, since we now load enough packages to full the default number \usepackage{fixseminar} \usepackage{soul} \usepackage{graphicx} \usepackage{paralist} \usepackage{multicol} \usepackage{tabularx} \usepackage{hhline} \usepackage{bbding} \usepackage{xargs} \usepackage{texpower} % options added via \PassOptionsToPackage in driver files \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{microtype} \usepackage{listings} \usepackage{todonotes} \usepackage[default]{gillius} \usepackage{enumitem} % used for nest %\usepackage{showframe} % for checking margins \definecolor{SectionColor}{rgb}{0.32,0.32,0.32} % % PDF tex graphics extensions {graphicx} \DeclareGraphicsExtensions{.jpg,.jpeg,.pdf,.png,.mps} % slidemargins {seminar,powersem} \renewcommand{\slidetopmargin}{15mm} \renewcommand{\slidebottommargin}{28mm} % 'correct' the bottom margin \renewcommand{\slideleftmargin}{15mm} \renewcommand{\sliderightmargin}{15mm} %%% source code highlighting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % first param is font size, second is baselineskip \newcommand\codesize{\fontsize{9}{1.1em}\selectfont} \newcommand\smallcodesize{\fontsize{8}{1.1em}\selectfont} % define the colors for code highlighting (based on Eclipse colors) \definecolor{KeywordColor}{rgb}{0.5,0,0.33} % violet \definecolor{CommentColor}{rgb}{0.25,0.5,0.37} % green \definecolor{StringColor}{rgb}{0.16,0,1} % blue % define the colors for code highlighting (based on NetBeans colors) %\definecolor{KeywordColor}{rgb}{0.0,0,0.9} %\definecolor{CommentColor}{rgb}{0.45,0.45,0.45} % a bit darker than NetBeans %\definecolor{StringColor}{rgb}{0.81,0.48,0.0} % create the fonts for code highlighting \newcommand{\codefont}{\fontfamily{fvm}\selectfont} % beramono \newcommand{\commentfont}{\sffamily\itshape} % 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\codesize, stringstyle=\color{StringColor}\codefont\codesize, aboveskip=5pt, belowskip=0pt, lineskip=-5pt, showstringspaces=false, tabsize=3, showtabs=false, columns=fullflexible, flexiblecolumns=true, xleftmargin=0pt, breaklines=true }\lstset{#1}} {} % create a new environment for source code blocks \lstnewenvironment{smallcodeblock}[1][] {% set up source code highlighting environment {listings} \lstset{ language=Java, upquote=true, basicstyle=\color{black}\codefont\smallcodesize, keywordstyle=\color{KeywordColor}\codefont\smallcodesize, commentstyle=\color{CommentColor}\commentfont\codesize, stringstyle=\color{StringColor}\codefont\smallcodesize, aboveskip=3pt, belowskip=-5pt, lineskip=-9pt, showstringspaces=false, tabsize=2, showtabs=false, columns=fullflexible, flexiblecolumns=true, xleftmargin=0pt, breaklines=true }\lstset{#1}} {} \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]" } % command for typesetting inline code \renewcommand{\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!}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % command for figures - first param is scale, second is file \newcommand{\fig}[2] { \begin{figure}[H] \begin{center} \includegraphics[scale=#1,draft=false]{#2} \end{center} \end{figure} \vspace{-0.75\baselineskip} } % command for figures rotated 90 degrees left - first param is scale. \newcommand{\rotatedfig}[2] { \begin{figure}[H] \begin{center} \includegraphics[scale=#1,draft=false, angle=90]{#2} \end{center} \end{figure} } % command for figures - first param is scale, second is file \newcommand{\capfig}[3] { \begin{figure}[H]% \begin{center}% \includegraphics[scale=#1,draft=false]{#2}% \\ % {\footnotesize #3} % \end{center} % \end{figure} % \vspace{-0.75\baselineskip} } % suppress section numbers \setcounter{secnumdepth}{-2} % scale factors used by seminar/powersem package to make over/under full slides fit a bit better \renewcommand{\slideshrink}{1.0} \renewcommand{\slideskip}{0.25} \renewcommand{\slidestretch}{1.05} % increase paragraph spacing a little bit so slides don't look so crowded \renewcommand{\slideparskip}{1.5ex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% sections %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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} \newcommand\mysectionstyle{\huge\sffamily} \newcommand\mysubsectionstyle{\LARGE\sffamily} \newcommand\mysubsubsectionstyle{\Large\sffamily} \newcommand\mysubsubsubsectionstyle{\sffamily\bfseries} \titleformat{\section}{\mysectionstyle\filcenter}{\theparagraph}{1em}{} \titleformat{\subsection}{\mysubsubsubsectionstyle}{\theparagraph}{1em}{} \titleformat{\subsubsection}{\mysubsubsectionstyle}{\theparagraph}{1em}{} \titleformat{\paragraph}{\mysubsubsubsectionstyle}{\theparagraph}{1em}{} % repurpose \paragraph as \subsubsubsection (which it sort of is already) \newcommand{\subsubsubsection}[1]{\paragraph{#1}} %%%% % shrinkable sections - shrink to \textwidth if too long %%%% %section \let\oldsection\section \newsavebox{\secbox} \newlength{\secboxlength} \renewcommand{\section}[1]{% \sbox{\secbox}{\mbox{\mysectionstyle#1}}\settowidth{\secboxlength}{\usebox{\secbox}}% \oldsection{\ifdim\secboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\secbox}}\else{\usebox{\secbox}}\fi}} %subsection \let\oldsubsection\subsection \newsavebox{\subsecbox} \newlength{\subsecboxlength} \renewcommand{\subsection}[1]{% \sbox{\subsecbox}{\mbox{\mysubsectionstyle#1}}\settowidth{\subsecboxlength}{\usebox{\subsecbox}}% \oldsubsection{\ifdim\subsecboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\subsecbox}}\else{\usebox{\subsecbox}}\fi}} %subsubsection \let\oldsubsubsection\subsubsection \newsavebox{\subsubsecbox} \newlength{\subsubsecboxlength} \renewcommand{\subsubsection}[1]{% \sbox{\subsubsecbox}{\mbox{\mysubsubsectionstyle#1}}\settowidth{\subsubsecboxlength}{\usebox{\subsubsecbox}}% \oldsubsubsection{\ifdim\subsubsecboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\subsubsecbox}}\else{\usebox{\subsubsecbox}}\fi}} %subsubsubsection \let\oldsubsubsubsection\subsubsubsection \newsavebox{\subsubsubsecbox} \newlength{\subsubsubsecboxlength} \renewcommand{\subsubsubsection}[1]{% \sbox{\subsubsubsecbox}{\mbox{\mysubsubsubsectionstyle#1}}\settowidth{\subsubsubsecboxlength}{\usebox{\subsubsubsecbox}}% \oldsubsubsubsection{\ifdim\subsubsubsecboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\subsubsubsecbox}}\else{\usebox{\subsubsubsecbox}}\fi}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% miscellaneous stuff %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % suppress built in slide centering (which buggers up incremental uncovering, % and makes things jump around a lot) \centerslidesfalse % options for hyperef \hypersetup{ final={true}, colorlinks={true}, urlcolor={blue}, filecolor={blue}, linkcolor={blue}, bookmarks={true}, bookmarksopen={true}, pdfpagemode={None} } % title/subject/author attributes are set in lecturedetails.tex % command for continuing slides - moves the content down a bit \newcommand{\continued}{\null\smallskip} \newcommand{\ra}[0]{$\rightarrow$~} \slidepagestyle{empty} \slideframe[\setlength{}{}]{none} % environment for generating first page content \newenvironment{lecturecontent}% {% \null\vfill\maketitle\vfill\vfill\null% \newslide \section{Topics covered}% \begin{itemize} }% {% \end{itemize}% } \newcommand{\point}[2]{\textbf{#1}\\#2} \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\raisebox{0.2em}{$\bullet$}\normalsize} \def\labelitemii{\footnotesize\raisebox{0.2em}{$\circ$}\normalsize} \def\labelitemiii{\footnotesize\raisebox{0.2em}{$\diamond$}\normalsize} \def\labelitemiv{\footnotesize\raisebox{0.2em}{$\triangleright$}\normalsize} \def\labelitemv{\footnotesize\raisebox{0.2em}{$\star$}\normalsize} % my attempt at creating a flat nested list environment \usepackage{calc} % allows more complex calculations \newenvironment{nest}[1][1]% {\setlength{\parskip}{#1\baselineskip*\real{0.4}}}% {\setlength{\leftskip}{0pt}\vspace{-2pt}\setlength{\parskip}{\slideparskip}} \def\liUndent{-10pt} \def\liVgap{-4pt} \def\liSkip{20pt} \def\liiSkip{35pt} \def\liiiSkip{46pt} \def\liiiiSkip{57pt} \def\liiiiiSkip{68pt} \newcommand{\li}{\smallskip\hspace{\liUndent}\labelitemi\hspace{5pt}\setlength{\leftskip}{\liSkip}} \newcommand{\lii}{\hspace{\liUndent}\labelitemii\hspace{5pt}\setlength{\leftskip}{\liiSkip}} \newcommand{\liii}{\hspace{\liUndent}\labelitemiii\hspace{5pt}\setlength{\leftskip}{\liiiSkip}} \newcommand{\liiii}{\hspace{\liUndent}\labelitemiv\hspace{5pt}\setlength{\leftskip}{\liiiiSkip}} \newcommand{\liiiii}{\hspace{\liUndent}\labelitemv\hspace{5pt}\setlength{\leftskip}{\liiiiiSkip}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% to-do notes %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\fix}[1]{\todo[color=red!60,noline,size=\large,inline]{Fix: #1}} \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}} \newcommand{\complete}{{\color{green}\Checkmark}~} \newcommand{\incomplete}{{\color{red}\XSolidBrush}~} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% slide environment %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % redefine texpower slide \let\oldslide\slide \let\endoldslide\endslide % new slide env that centers vertically \renewenvironment{slide}% {\oldslide\topskip0pt\minipage[c][\textheight][c]{\textwidth}}% {\endminipage\endoldslide}
\usepackage[pdftex]{hyperref} % options added via hypersetup below \usepackage{etex} % increase number of dimension registers, since we now load enough packages to full the default number \usepackage{fixseminar} \usepackage{soul} \usepackage{graphicx} \usepackage{paralist} \usepackage{multicol} \usepackage{tabularx} \usepackage{hhline} \usepackage{texpower} % options added via \PassOptionsToPackage in driver files \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{microtype} \usepackage{listings} \usepackage{todonotes} \usepackage[default]{gillius} \usepackage{enumitem} % used for nest %\usepackage{showframe} % for checking margins \definecolor{SectionColor}{rgb}{0.32,0.32,0.32} % % PDF tex graphics extensions {graphicx} \DeclareGraphicsExtensions{.jpg,.jpeg,.pdf,.png,.mps} % slidemargins {seminar,powersem} \renewcommand{\slidetopmargin}{15mm} \renewcommand{\slidebottommargin}{28mm} % 'correct' the bottom margin \renewcommand{\slideleftmargin}{15mm} \renewcommand{\sliderightmargin}{15mm} %%% source code highlighting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % first param is font size, second is baselineskip \newcommand\codesize{\fontsize{9}{1.1em}\selectfont} \newcommand\smallcodesize{\fontsize{8}{1.1em}\selectfont} % define the colors for code highlighting (based on Eclipse colors) \definecolor{KeywordColor}{rgb}{0.5,0,0.33} % violet \definecolor{CommentColor}{rgb}{0.25,0.5,0.37} % green \definecolor{StringColor}{rgb}{0.16,0,1} % blue % define the colors for code highlighting (based on NetBeans colors) %\definecolor{KeywordColor}{rgb}{0.0,0,0.9} %\definecolor{CommentColor}{rgb}{0.45,0.45,0.45} % a bit darker than NetBeans %\definecolor{StringColor}{rgb}{0.81,0.48,0.0} % create the fonts for code highlighting \newcommand{\codefont}{\fontfamily{fvm}\selectfont} % beramono \newcommand{\commentfont}{\sffamily\itshape} % 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\codesize, stringstyle=\color{StringColor}\codefont\codesize, aboveskip=5pt, belowskip=0pt, lineskip=-5pt, showstringspaces=false, tabsize=3, showtabs=false, columns=fullflexible, flexiblecolumns=true, xleftmargin=0pt, breaklines=true }\lstset{#1}} {} % create a new environment for source code blocks \lstnewenvironment{smallcodeblock}[1][] {% set up source code highlighting environment {listings} \lstset{ language=Java, upquote=true, basicstyle=\color{black}\codefont\smallcodesize, keywordstyle=\color{KeywordColor}\codefont\smallcodesize, commentstyle=\color{CommentColor}\commentfont\codesize, stringstyle=\color{StringColor}\codefont\smallcodesize, aboveskip=3pt, belowskip=-5pt, lineskip=-9pt, showstringspaces=false, tabsize=2, showtabs=false, columns=fullflexible, flexiblecolumns=true, xleftmargin=0pt, breaklines=true }\lstset{#1}} {} \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]" } % command for typesetting inline code \renewcommand{\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!}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % command for figures - first param is scale, second is file \newcommand{\fig}[2] { \begin{figure}[H] \begin{center} \includegraphics[scale=#1,draft=false]{#2} \end{center} \end{figure} \vspace{-0.75\baselineskip} } % command for figures rotated 90 degrees left - first param is scale. \newcommand{\rotatedfig}[2] { \begin{figure}[H] \begin{center} \includegraphics[scale=#1,draft=false, angle=90]{#2} \end{center} \end{figure} } % command for figures - first param is scale, second is file \newcommand{\capfig}[3] { \begin{figure}[H]% \begin{center}% \includegraphics[scale=#1,draft=false]{#2}% \\ % {\footnotesize #3} % \end{center} % \end{figure} % \vspace{-0.75\baselineskip} } % suppress section numbers \setcounter{secnumdepth}{-2} % scale factors used by seminar/powersem package to make over/under full slides fit a bit better \renewcommand{\slideshrink}{1.0} \renewcommand{\slideskip}{0.25} \renewcommand{\slidestretch}{1.05} % increase paragraph spacing a little bit so slides don't look so crowded \renewcommand{\slideparskip}{1.5ex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% sections %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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} \newcommand\mysectionstyle{\huge\sffamily} \newcommand\mysubsectionstyle{\LARGE\sffamily} \newcommand\mysubsubsectionstyle{\Large\sffamily} \newcommand\mysubsubsubsectionstyle{\sffamily\bfseries} \titleformat{\section}{\mysectionstyle\filcenter}{\theparagraph}{1em}{} \titleformat{\subsection}{\mysubsubsubsectionstyle}{\theparagraph}{1em}{} \titleformat{\subsubsection}{\mysubsubsectionstyle}{\theparagraph}{1em}{} \titleformat{\paragraph}{\mysubsubsubsectionstyle}{\theparagraph}{1em}{} % repurpose \paragraph as \subsubsubsection (which it sort of is already) \newcommand{\subsubsubsection}[1]{\paragraph{#1}} %%%% % shrinkable sections - shrink to \textwidth if too long %%%% %section \let\oldsection\section \newsavebox{\secbox} \newlength{\secboxlength} \renewcommand{\section}[1]{% \sbox{\secbox}{\mbox{\mysectionstyle#1}}\settowidth{\secboxlength}{\usebox{\secbox}}% \oldsection{\ifdim\secboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\secbox}}\else{\usebox{\secbox}}\fi}} %subsection \let\oldsubsection\subsection \newsavebox{\subsecbox} \newlength{\subsecboxlength} \renewcommand{\subsection}[1]{% \sbox{\subsecbox}{\mbox{\mysubsectionstyle#1}}\settowidth{\subsecboxlength}{\usebox{\subsecbox}}% \oldsubsection{\ifdim\subsecboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\subsecbox}}\else{\usebox{\subsecbox}}\fi}} %subsubsection \let\oldsubsubsection\subsubsection \newsavebox{\subsubsecbox} \newlength{\subsubsecboxlength} \renewcommand{\subsubsection}[1]{% \sbox{\subsubsecbox}{\mbox{\mysubsubsectionstyle#1}}\settowidth{\subsubsecboxlength}{\usebox{\subsubsecbox}}% \oldsubsubsection{\ifdim\subsubsecboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\subsubsecbox}}\else{\usebox{\subsubsecbox}}\fi}} %subsubsubsection \let\oldsubsubsubsection\subsubsubsection \newsavebox{\subsubsubsecbox} \newlength{\subsubsubsecboxlength} \renewcommand{\subsubsubsection}[1]{% \sbox{\subsubsubsecbox}{\mbox{\mysubsubsubsectionstyle#1}}\settowidth{\subsubsubsecboxlength}{\usebox{\subsubsubsecbox}}% \oldsubsubsubsection{\ifdim\subsubsubsecboxlength>\textwidth\protect\resizebox{\textwidth}{!}{\usebox{\subsubsubsecbox}}\else{\usebox{\subsubsubsecbox}}\fi}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% miscellaneous stuff %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % suppress built in slide centering (which buggers up incremental uncovering, % and makes things jump around a lot) \centerslidesfalse % options for hyperef \hypersetup{ final={true}, colorlinks={true}, urlcolor={blue}, filecolor={blue}, linkcolor={blue}, bookmarks={true}, bookmarksopen={true}, pdfpagemode={None} } % title/subject/author attributes are set in lecturedetails.tex % command for continuing slides - moves the content down a bit \newcommand{\continued}{\null\smallskip} \newcommand{\ra}[0]{$\rightarrow$~} \slidepagestyle{empty} \slideframe[\setlength{}{}]{none} % environment for generating first page content \newenvironment{lecturecontent}% {% \null\vfill\maketitle\vfill\vfill\null% \newslide \section{Topics covered}% \begin{itemize} }% {% \end{itemize}% } \newcommand{\point}[2]{\textbf{#1}\\#2} \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\raisebox{0.2em}{$\bullet$}\normalsize} \def\labelitemii{\footnotesize\raisebox{0.2em}{$\circ$}\normalsize} \def\labelitemiii{\footnotesize\raisebox{0.2em}{$\diamond$}\normalsize} \def\labelitemiv{\footnotesize\raisebox{0.2em}{$\triangleright$}\normalsize} \def\labelitemv{\footnotesize\raisebox{0.2em}{$\star$}\normalsize} % my attempt at creating a flat nested list environment \usepackage{calc} % allows more complex calculations \newenvironment{nest}[1][1]% {\setlength{\parskip}{#1\baselineskip*\real{0.4}}}% {\setlength{\leftskip}{0pt}\vspace{-2pt}\setlength{\parskip}{\slideparskip}} \def\liUndent{-10pt} \def\liVgap{-4pt} \def\liSkip{20pt} \def\liiSkip{35pt} \def\liiiSkip{46pt} \def\liiiiSkip{57pt} \def\liiiiiSkip{68pt} \newcommand{\li}{\smallskip\hspace{\liUndent}\labelitemi\hspace{5pt}\setlength{\leftskip}{\liSkip}} \newcommand{\lii}{\hspace{\liUndent}\labelitemii\hspace{5pt}\setlength{\leftskip}{\liiSkip}} \newcommand{\liii}{\hspace{\liUndent}\labelitemiii\hspace{5pt}\setlength{\leftskip}{\liiiSkip}} \newcommand{\liiii}{\hspace{\liUndent}\labelitemiv\hspace{5pt}\setlength{\leftskip}{\liiiiSkip}} \newcommand{\liiiii}{\hspace{\liUndent}\labelitemv\hspace{5pt}\setlength{\leftskip}{\liiiiiSkip}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% to-do notes %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\fix}[1]{\todo[color=red!60,noline,size=\large,inline]{Fix: #1}} \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}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% slide environment %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % redefine texpower slide \let\oldslide\slide \let\endoldslide\endslide % new slide env that centers vertically \renewenvironment{slide}% {\oldslide\topskip0pt\minipage[c][\textheight][c]{\textwidth}}% {\endminipage\endoldslide}
Show line notes below