[FE training-materials-updates] Integrate kernel agenda to the build system

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Jun 27 19:21:49 CEST 2013


Repository : git://git.free-electrons.com/training-materials.git

On branch  : master
Link       : http://git.free-electrons.com/training-materials/commit/?id=9644884ab5db80f8284fd854abdcaf65aa8f2673

>---------------------------------------------------------------

commit 9644884ab5db80f8284fd854abdcaf65aa8f2673
Author: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Date:   Thu Jun 27 18:57:28 2013 +0200

    Integrate kernel agenda to the build system
    
    This commit fully integrates the build of the kernel agenda into the
    training materials build system. Until now, it was using its own
    Makefile, which depended on the 'latex' Free Electrons internal
    repository. Now, everything needed to build the agendas is within the
    training-materials repository. Doing 'make kernel-agenda.pdf' is
    enough to build the agenda.
    
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>


>---------------------------------------------------------------

9644884ab5db80f8284fd854abdcaf65aa8f2673
 Makefile                                           |   19 ++++
 ...da-kernel-and-drivers.tex => kernel-agenda.tex} |   57 +---------
 agenda/kernel/Makefile                             |    3 -
 common/agenda.sty                                  |  115 ++++++++++++++++++++
 common/header.png                                  |  Bin 0 -> 334530 bytes
 5 files changed, 137 insertions(+), 57 deletions(-)

diff --git a/Makefile b/Makefile
index b96dcee..0cb685f 100644
--- a/Makefile
+++ b/Makefile
@@ -419,6 +419,24 @@ FORCE:
 endif
 
 #
+# === Compilation of agendas ===
+#
+ifdef AGENDA
+AGENDA_TEX = agenda/$(AGENDA)-agenda.tex
+AGENDA_PICTURES = $(COMMON_PICTURES)
+
+%-agenda.pdf: common/agenda.sty $(AGENDA_TEX) $(AGENDA_PICTURES)
+	rm -f $(OUTDIR)/$(basename $@).tex
+	cp $(filter %.tex,$^) $(OUTDIR)/$(basename $@).tex
+	(cd $(OUTDIR); $(PDFLATEX_ENV) $(PDFLATEX) $(basename $@).tex)
+	cat $(OUTDIR)/$@ > $@
+else
+FORCE:
+%-agenda.pdf: FORCE
+	@$(MAKE) $@ AGENDA=$*
+endif
+
+#
 # === Picture generation ===
 #
 
@@ -478,6 +496,7 @@ help:
 	@echo " full-sysdev-slides.pdf		Complete slides for the 'sysdev' course"
 	@echo " full-kernel-slides.pdf		Complete slides for the 'kernel' course"
 	@echo " full-android-slides.pdf		Complete slides for the 'android' course"
+	@echo " kernel-agenda.pdf		Agenda for the 'kernel' course"
 	@echo " <some-chapter>-slides.pdf	Slides for a particular chapter in slides/"
 	@echo
 	@echo " <some-chapter>-labs.pdf		Labs for a particular chapter in labs/"
diff --git a/agenda/kernel/agenda-kernel-and-drivers.tex b/agenda/kernel-agenda.tex
similarity index 87%
rename from agenda/kernel/agenda-kernel-and-drivers.tex
rename to agenda/kernel-agenda.tex
index dc045ba..9cbfb0b 100644
--- a/agenda/kernel/agenda-kernel-and-drivers.tex
+++ b/agenda/kernel-agenda.tex
@@ -1,72 +1,21 @@
-\include{document-header}
+\documentclass[a4paper,12pt,obeyspaces,spaces,hyphens]{article}
 
+\usepackage{agenda}
 \usepackage{colortbl}
 \usepackage{xcolor}
 \usepackage{palatino}
 \usepackage{calc}
 \usepackage{tabularx}
-%\usepackage[table]{xcolor}
 
 \hypersetup{pdftitle={Embedded Linux kernel and driver development training},
   pdfauthor={Free Electrons}}
 
-\definecolor{fedarkblue}{RGB}{204,204,255}
-\definecolor{felightblue}{RGB}{230,230,255}
+\fedefinelengths
 
 \begin{document}
 
 \thispagestyle{fancy}
 
-%% With tabular environments, we cannot use the normal 'l', 'c' or 'r'
-%% column specifications because those do not create paragraphs, so it
-%% is not possible to insert an itemize environment in such
-%% columns. Therefore, we have to use the 'm' column specifier, which
-%% needs a column width specification. Below, we compute the width of
-%% the columns in the case of two columns, and we must take into
-%% account the inter-column spacing so that the final array is really
-%% \textwidth in width. This is needed so that the two column arrays
-%% have exactly the same width as the one column arrays/
-\newlength\fetwocolumnwidth
-\setlength\fetwocolumnwidth{(\textwidth - \tabcolsep - \tabcolsep)/2}
-
-%% Define a one column array. Two arguments are needed:
-%%  first argument: the title of the section
-%%  second argument: the contents of the section
-\newcommand\feagendaonecolumn[2]{
-\begin{tabular*}{\textwidth}{m{\textwidth}}
-  \rowcolor{fedarkblue}
-  \vspace{.1cm}
-  {\bf #1}
-  \vspace{.1cm}
-  \\
-  \rowcolor{felightblue}
-  #2 \\
-\end{tabular*}
-\vspace{0.5cm}
-}
-
-%% Define a two column array. Four arguments are needed:
-%%  first argument: The title of the section in the left column
-%%  second argument: The contents of the section in the left column
-%%  third argument: The title of the section in the right column
-%%  fourth argument: The contents of the section in the right column
-\newcommand\feagendatwocolumn[4]{
-\begin{tabular*}{\textwidth}{m{\fetwocolumnwidth} m{\fetwocolumnwidth}}
-  \rowcolor{fedarkblue}
-  \vspace{.1cm}
-  {\bf #1}
-  \vspace{.1cm}
-  &
-  \vspace{.1cm}
-  {\bf #3}
-  \vspace{.1cm}
-  \\
-  \rowcolor{felightblue}
-  #2 & #4 \\
-\end{tabular*}
-\vspace{0.5cm}
-}
-
 \setlength{\arrayrulewidth}{0.8pt}
 
 \begin{center}
diff --git a/agenda/kernel/Makefile b/agenda/kernel/Makefile
deleted file mode 100644
index b587393..0000000
--- a/agenda/kernel/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-TOPDIR = ../../../..
-DOCS   = agenda-kernel-and-drivers.pdf
-include $(TOPDIR)/latex/document.mk
diff --git a/common/agenda.sty b/common/agenda.sty
new file mode 100644
index 0000000..202ab9d
--- /dev/null
+++ b/common/agenda.sty
@@ -0,0 +1,115 @@
+
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[normalem]{ulem}
+\usepackage[vmargin=2cm, hmargin=1.5cm]{geometry}
+\usepackage{hyperref}
+\usepackage[all]{hypcap}
+\usepackage{fancyhdr}      % Used for customization of header/foter
+\pagestyle{fancy}
+\usepackage{graphicx}
+\usepackage{titlesec}      % Used for \titleformat
+\usepackage[htt]{hyphenat} % I want hyphenation in {\tt ...} blocks
+\usepackage{xcolor}
+\usepackage{titling}
+\usepackage{eurosym}
+\usepackage{ifthen}
+
+% A nicer font
+\usepackage{palatino}
+
+%% Remove indentation on the first line of each paragraph, and add
+%% some space between each paragraph.
+\usepackage{parskip}
+
+\hypersetup{colorlinks=true,linkcolor=gray,urlcolor=gray}
+
+\fancyhead{}
+\fancyfoot{}
+
+\fancyhead[CO, CE]{\includegraphics[width=\textwidth]{header.png}}
+\fancyfoot[RO, LE] {\thepage}
+
+\definecolor{fedarkblue}{RGB}{204,204,255}
+\definecolor{felightblue}{RGB}{230,230,255}
+
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0.5pt}
+
+\setlength{\headheight}{60pt}
+\setlength{\textheight}{650px}
+
+\definecolor{textcolor}{HTML}{4B6FA9}
+
+% Header style
+\titleformat{\section}{\color{textcolor}\normalfont\Large\sffamily\bfseries}{}{1em}{}[\vspace{2pt}\titlerule]
+\titleformat{\subsection}[display]{\normalfont\large\sffamily}{}{0pt}{}[\vspace{2pt}\titlerule]
+\titleformat{\subsubsection}[display]{\normalfont\sffamily}{}{0pt}{}
+
+% No section numbering
+\setcounter{secnumdepth}{0}
+
+% Customization of title and author style
+\pretitle{\begin{center}\Huge\sffamily}
+\preauthor{\begin{center}
+\large \sffamily \lineskip 0.2em%
+\begin{tabular}[t]{c}}
+\postauthor{\end{tabular}\par\end{center}}
+\predate{\begin{center}\large\sffamily}
+
+% Useful definitions
+
+\newcommand{\code}[1]
+{\path{#1}}
+
+%% With tabular environments, we cannot use the normal 'l', 'c' or 'r'
+%% column specifications because those do not create paragraphs, so it
+%% is not possible to insert an itemize environment in such
+%% columns. Therefore, we have to use the 'm' column specifier, which
+%% needs a column width specification. Below, we compute the width of
+%% the columns in the case of two columns, and we must take into
+%% account the inter-column spacing so that the final array is really
+%% \textwidth in width. This is needed so that the two column arrays
+%% have exactly the same width as the one column arrays/
+\newcommand\fedefinelengths{
+\newlength\fetwocolumnwidth
+\setlength\fetwocolumnwidth{(\textwidth - \tabcolsep - \tabcolsep)/2}
+}
+
+%% Define a one column array. Two arguments are needed:
+%%  first argument: the title of the section
+%%  second argument: the contents of the section
+\newcommand\feagendaonecolumn[2]{
+\begin{tabular*}{\textwidth}{m{\textwidth}}
+  \rowcolor{fedarkblue}
+  \vspace{.1cm}
+  {\bf #1}
+  \vspace{.1cm}
+  \\
+  \rowcolor{felightblue}
+  #2 \\
+\end{tabular*}
+\vspace{0.5cm}
+}
+
+%% Define a two column array. Four arguments are needed:
+%%  first argument: The title of the section in the left column
+%%  second argument: The contents of the section in the left column
+%%  third argument: The title of the section in the right column
+%%  fourth argument: The contents of the section in the right column
+\newcommand\feagendatwocolumn[4]{
+\begin{tabular*}{\textwidth}{m{\fetwocolumnwidth} m{\fetwocolumnwidth}}
+  \rowcolor{fedarkblue}
+  \vspace{.1cm}
+  {\bf #1}
+  \vspace{.1cm}
+  &
+  \vspace{.1cm}
+  {\bf #3}
+  \vspace{.1cm}
+  \\
+  \rowcolor{felightblue}
+  #2 & #4 \\
+\end{tabular*}
+\vspace{0.5cm}
+}
diff --git a/common/header.png b/common/header.png
new file mode 100644
index 0000000..c0503f4
Binary files /dev/null and b/common/header.png differ



More information about the training-materials-updates mailing list