diff --git a/.latexmkrc b/.latexmkrc index 2bd0f9a..dd297d6 100644 --- a/.latexmkrc +++ b/.latexmkrc @@ -1,5 +1,5 @@ -# @default_files = ('main-book.tex', 'main-presentation.tex'); -@default_files = ('a4.tex', 'a5.tex', 'main-presentation.tex'); +@default_files = ('main-book.tex', 'main-presentation.tex'); +#@default_files = ('a4.tex', 'a5.tex', 'main-presentation.tex'); # Output directly to PDF (5 = XeLaTeX) $pdf_mode = 1; diff --git a/READMDE.md b/READMDE.md new file mode 100644 index 0000000..3362e0d --- /dev/null +++ b/READMDE.md @@ -0,0 +1,22 @@ +# Computer networks + +## Course description and introduction + +## Source files + +The manuals as well as the slides are created using LaTeX. +The documents are split over quite a few differnet files. + + - **main.tex** contains links to all the chapters, inserts the glossary, index, et cetera. + - **tex/manual.tex** and **tex/slides.tex** contain some specific commands to either generate the manual or the slide deck. + - **manual-student.tex** defines the target audience to be a student and then includes the actual manual, whereas **tex/manual-teacher.tex** defines the audience to be the instructor. + - For instructors, there is an additional file, as he can chose which page format he wants for the manual (A5 or A4). + +Files that are not very interesting to look at, are hidden away in the _tex/_ folder. +The actual contents is stored in files in the _chapters/_ folder. + +## Main packages + + - **beamer** to generate the slides as well as the manual + - **exsheets** for the exercises in the manual + - **multiaudience** to create a different version of the manual for instructor and student \ No newline at end of file diff --git a/a4.tex b/a4.tex deleted file mode 100644 index 53b8733..0000000 --- a/a4.tex +++ /dev/null @@ -1,5 +0,0 @@ -\documentclass[a4paper,12pt,british]{memoir} -%\def\CurrentAudience{student} -\usepackage{graphicx} -\setkeys{Gin}{width=.75\textwidth} % from the graphicx package -\input{main-book} \ No newline at end of file diff --git a/a5.tex b/a5.tex deleted file mode 100644 index cf6e1be..0000000 --- a/a5.tex +++ /dev/null @@ -1,5 +0,0 @@ -\documentclass[a5paper,10pt,british]{memoir} -%\def\CurrentAudience{teacher} -\usepackage{graphicx} -\setkeys{Gin}{width=\textwidth} % from the graphicx package -\input{main-book} \ No newline at end of file diff --git a/main-book.tex b/main-book.tex index c45a3ff..ed4e4ad 100644 --- a/main-book.tex +++ b/main-book.tex @@ -1,3 +1,4 @@ +\documentclass[a4paper,12pt,british]{memoir} %\usepackage{multiaudience} %\SetNewAudience{teacher} %\SetNewAudience{student} diff --git a/main-new.tex b/main-new.tex new file mode 100644 index 0000000..9ece89a --- /dev/null +++ b/main-new.tex @@ -0,0 +1,34 @@ +\title{Computer networks} +\def\subtitle{A brief introduction} +\author{Tom Marcoen} +\date{2021--2024} + +\input{tex/preamble} + +\begin{document} + + % Change the default mode to 'article'. + \mode
+ + \input{tex/titlepages} + + \frontmatter + \clearforchapter + \tableofcontents* + \clearforchapter + \listoffigures + \clearforchapter + \listoftables + \input{chapters/preface} + \printglossary[type=abbreviations,style=mcolindexgroup] + + + \mainmatter + \chapter{test} + Hello world + + \mode{This is a test.} + + Here is another test. + +\end{document} \ No newline at end of file diff --git a/main.tex b/main.tex index 8981769..cae3109 100644 --- a/main.tex +++ b/main.tex @@ -85,7 +85,9 @@ \printglossary[type=abbreviations,style=mcolindexgroup] \mainmatter } -\titleslide[an introduction]{Computer networks} +%\makeatletter +\titleslide[\subtitle]{Computer networks} +%\makeatother \include{chapters/introduction} diff --git a/manual-teacher-a5.tex b/manual-teacher-a5.tex new file mode 100644 index 0000000..7e44e50 --- /dev/null +++ b/manual-teacher-a5.tex @@ -0,0 +1,11 @@ +% The teacher's manual - A5 format +\documentclass[a5paper,10pt,british]{memoir} + +% Set up the page and margins. +\isopage +\checkandfixthelayout + +\usepackage{graphicx} +\setkeys{Gin}{width=\textwidth} + +\input{tex/manual-teacher} \ No newline at end of file diff --git a/tex/manual-teacher.tex b/tex/manual-teacher.tex new file mode 100644 index 0000000..7660b4c --- /dev/null +++ b/tex/manual-teacher.tex @@ -0,0 +1,10 @@ +% The teacher's manual + +% The package 'multiaudience' lets you change the content based +% on the intended audience. I can use this in combination with +% the package 'exsheets' to print the solutions to the exercises +% only in the teacher's manual. +\def\CurrentAudience{teacher} + +% Include the actual manual. +\input{tex/manual} \ No newline at end of file diff --git a/tex/manual.tex b/tex/manual.tex new file mode 100644 index 0000000..698d4e3 --- /dev/null +++ b/tex/manual.tex @@ -0,0 +1,124 @@ +\usepackage[noamssymb,noamsthm,envcountsect]{beamerarticle} + +\pagestyle{ruled} + +% Italic chapter titles, non-bold, to the right of the page. +\chapterstyle{wilsondob} + +% Remove bold from section headers to better match the chapter style. +\setsecheadstyle{\Large\memRTLraggedright} + +% Figures and tables +\setfloatlocations{figure}{hbtp} +\setfloatlocations{table}{htbp} +\usepackage{caption} +\captionsetup{ + font={small,sf}, + labelfont={sc,color=labelcolor}, + labelsep=endash + } +\captionsetup[table]{position=above} +\captionsetup[figure]{position=below} +\usepackage{subcaption} + +% Lists +\usepackage{multicol} +\usepackage[inline]{enumitem} +\newlist{inlinelist}{enumerate*}{1} +\setlist[inlinelist]{label=(\roman*)} +\firmlists +\renewcommand*{\descriptionlabel}[1]{\hspace\labelsep\itshape #1 --} + +% Epigraphcs and quotes +\setlength{\epigraphwidth}{.6\textwidth} + +% Extra and background information boxes +\usepackage[most]{tcolorbox} +\usepackage{fontawesome} +\newtcolorbox{extrainfo}{ + title = {\faUniversity\quad Extra information}, + colframe = BorderColourExtraInfo, + colback = white, + breakable = true +} + +% RFCs +\newcommand{\rfc}[1]{\acs{RFC}~\cite{rfc#1}} + +% Small caps +\newcommand{\abbr}[1]{\textsc{\MakeLowercase{#1}}} % Old +\newcommand{\SC}[1]{\textsc{\MakeLowercase{#1}}} % New + +% Bibliography +\usepackage{csquotes} +\usepackage[backend=biber,style=reading,citestyle=authoryear,entrykey=false,sorting=tyn]{biblatex} +\DeclareFieldFormat{annotation}{\textsc{description}\addcolon\space #1} +\renewbibmacro*{entryhead:full}{% + \printfield{labeltitle}% + \hfill + \printfield{usera}} +\renewcommand{\bibannotationprefix}{annotation-} +\addbibresource{bib/bibliography.bib} +\addbibresource{bib/rfc.bib} +% Display the "annotation" field in the bibliography +\renewbibmacro*{finentry}{% + \iffieldundef{annotation} + {\finentry} + {\setunit{\finentrypunct\par\vspace{\bibitemsep}\nobreak} + \printfield{annotation}% + \finentry}} +% Sort by title +\DeclareSortingScheme{tyn}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort{ + \field{sorttitle} + \field{title} + } + \sort{ + \field{sortyear} + \field{year} + } + \sort{ + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{sorttitle} + \field{title} + } + \sort{ + \field{volume} + \literal{0} + } +} + +% Index +\usepackage[xindy]{imakeidx} +\makeindex[intoc,columns=2] +\newcommand{\iacs}[1]{\index{#1@\acs{#1}}} +\newcommand{\iacl}[1]{\index{\acl{#1}}} + +% Glossaries +\usepackage[abbreviations,automake,stylemods=mcols,shortcuts=ac,nonumberlist,indexcrossrefs=true]{glossaries-extra} +\setlength{\columnsep}{3em} +\setabbreviationstyle{long-short-sc} +\renewcommand*{\glsabbrvscfont}[1]{\abbr{#1}} +\makeglossaries +\loadglsentries{tex/abbreviations} +\loadglsentries{tex/glossary} +\glsdisablehyper + +% Links +\usepackage{varioref} +\usepackage{hyperref} +\usepackage{cleveref} +\urlstyle{rm} +\hypersetup{colorlinks=true,allcolors=linkcolor,linktocpage} +\creflabelformat{equation}{#2\textup{#1}#3} % remove the brackets from an equation reference, i.e. "eq. 2.1" instead of "eq. (2.1)" + +\input{main-new} \ No newline at end of file diff --git a/tex/preamble.tex b/tex/preamble.tex new file mode 100644 index 0000000..04dce37 --- /dev/null +++ b/tex/preamble.tex @@ -0,0 +1,42 @@ +% Fonts +\usepackage[T1]{fontenc} +\usepackage[supstfm=libertinesups]{superiors} +\usepackage[mono=false]{libertinus} +\usepackage{libertinust1math} +\usepackage{libertinehologopatch} +\usepackage{microtype} +\microtypesetup{tracking=smallcaps,letterspace=50} +\usepackage{textcomp} +\usepackage{fnpct} +\usepackage[scaled=1.05]{zlmtt} +\useosf + +% Listings +\usepackage{listings} +\lstset{ + basicstyle = \ttfamily\small, + numbers = left, + numberstyle = \tiny, + xleftmargin = 1em, + numbersep = .75em, + columns = fullflexible, + breaklines = true, + keepspaces = true, + breakindent = 1em, + frame = tb, + framerule = .8pt, + rulecolor = \color{listingrulecolor} +} +\usepackage[per-mode=symbol]{siunitx} +\usepackage{bm} +\usepackage{upgreek} +\usepackage{amsmath} + +% TikZ +\usepackage{tikz} +\usepackage{pgf-pie} +\usetikzlibrary{arrows} +\usetikzlibrary{calc} + +\input{tex/theme-syntra-bizz} +%\input{tex/headings} diff --git a/tex/slides.tex b/tex/slides.tex new file mode 100644 index 0000000..e69de29 diff --git a/tex/titlepages.tex b/tex/titlepages.tex index ed88129..4c28d2b 100644 --- a/tex/titlepages.tex +++ b/tex/titlepages.tex @@ -20,6 +20,7 @@ %\thispagestyle{empty} \pagenumbering{Alpha} +\makeatletter \begin{titlingpage} % Suppresses displaying the page number on the title page and the subsequent page counts as page 1 \thispagestyle{empty} \raggedleft % Right align the title page @@ -28,13 +29,14 @@ \hspace{0.05\textwidth} % Whitespace between the vertical line and title page text \parbox[b]{0.75\textwidth}{ % Paragraph box for holding the title page text, adjust the width to move the title page left or right on the page - {\Huge\bfseries Computer networks}\\[2\baselineskip] % Title - {\large\textit{A brief introduction}}\\[4\baselineskip] % Subtitle or further description - {\Large\textsc{tom marcoen}} % Author name, lower case for consistent small caps + {\Huge\bfseries\@title}\\[2\baselineskip] % Title + {\large\textit{\subtitle}}\\[4\baselineskip] % Subtitle or further description + {\Large\SC{\@author}} % Author name, lower case for consistent small caps \vspace{0.5\textheight} % Whitespace between the title block and the publisher {\noindent \includegraphics[width=6cm]{images/logo-cropped.pdf}}\\[\baselineskip] % Publisher and logo } -\end{titlingpage} \ No newline at end of file +\end{titlingpage} +\makeatother \ No newline at end of file