Skip to content

Commit

Permalink
Complete haul-over
Browse files Browse the repository at this point in the history
  • Loading branch information
tommarcoen committed Sep 4, 2023
1 parent e697b51 commit 9d0e696
Show file tree
Hide file tree
Showing 13 changed files with 255 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .latexmkrc
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
22 changes: 22 additions & 0 deletions READMDE.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 0 additions & 5 deletions a4.tex

This file was deleted.

5 changes: 0 additions & 5 deletions a5.tex

This file was deleted.

1 change: 1 addition & 0 deletions main-book.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
\documentclass[a4paper,12pt,british]{memoir}
%\usepackage{multiaudience}
%\SetNewAudience{teacher}
%\SetNewAudience{student}
Expand Down
34 changes: 34 additions & 0 deletions main-new.tex
Original file line number Diff line number Diff line change
@@ -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<article>

\input{tex/titlepages}

\frontmatter
\clearforchapter
\tableofcontents*
\clearforchapter
\listoffigures
\clearforchapter
\listoftables
\input{chapters/preface}
\printglossary[type=abbreviations,style=mcolindexgroup]


\mainmatter
\chapter{test}
Hello world

\mode<presentation>{This is a test.}

Here is another test.

\end{document}
4 changes: 3 additions & 1 deletion main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
\printglossary[type=abbreviations,style=mcolindexgroup]
\mainmatter
}
\titleslide[an introduction]{Computer networks}
%\makeatletter
\titleslide[\subtitle]{Computer networks}
%\makeatother


\include{chapters/introduction}
Expand Down
11 changes: 11 additions & 0 deletions manual-teacher-a5.tex
Original file line number Diff line number Diff line change
@@ -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}
10 changes: 10 additions & 0 deletions tex/manual-teacher.tex
Original file line number Diff line number Diff line change
@@ -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}
124 changes: 124 additions & 0 deletions tex/manual.tex
Original file line number Diff line number Diff line change
@@ -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}
42 changes: 42 additions & 0 deletions tex/preamble.tex
Original file line number Diff line number Diff line change
@@ -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}
Empty file added tex/slides.tex
Empty file.
10 changes: 6 additions & 4 deletions tex/titlepages.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
\end{titlingpage}
\makeatother

0 comments on commit 9d0e696

Please sign in to comment.