From f0a29d0a9f885feeb1a5420a8cc8fbbd4409dcf3 Mon Sep 17 00:00:00 2001 From: Thomas Bonnefille Date: Tue, 29 Oct 2024 18:29:09 +0100 Subject: [PATCH] agenda: create commmand to refactor agendas This commits adds commands to refactro the agendas. It adds respectively commands to : - Define and show a specific section (lecture or lab) - Define and show a supported board - Show a specified part of a specified day Signed-off-by: Thomas Bonnefille --- agenda/common.inc | 84 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 agenda/common.inc diff --git a/agenda/common.inc b/agenda/common.inc new file mode 100644 index 0000000000..d15bf5274b --- /dev/null +++ b/agenda/common.inc @@ -0,0 +1,84 @@ +\newcommand\defagendaitem[6]{ + \ifthenelse{\equal{\agendalanguage}{french}}{ + \expandafter\def\csname #1@#2@title\endcsname {#5} + \expandafter\def\csname #1@#2@contents\endcsname {#6} + }{ + \expandafter\def\csname #1@#2@title\endcsname {#3} + \expandafter\def\csname #1@#2@contents\endcsname {#4} + } +} + +\newcommand\showagendaitem[2]{ + \feagendaonecolumn{ + \ifthenelse{\equal{\agendalanguage}{french}}{ + \ifthenelse{\equal{#2}{lecture}} + {Cours -} + { + \ifthenelse{\equal{#2}{lab}}{ + \ifthenelse{\equal{\trainingtype}{online}}{Démo -}{TP -} + } + {} + } + }{ + \ifthenelse{\equal{#2}{lecture}} + {Lecture -} + { + \ifthenelse{\equal{#2}{lab}}{ + \ifthenelse{\equal{\trainingtype}{online}}{Demo -}{Lab -} + } + {} + } + } + \csname #1@#2@title\endcsname + }{ + \csname #1@#2@contents\endcsname + } +} + +\newcommand\defboard[6]{ + \ifthenelse{\equal{\agendalanguage}{french}}{ + \expandafter\def\csname #1@title\endcsname {#4} + \expandafter\def\csname #1@contents\endcsname {#5} + }{ + \expandafter\def\csname #1@title\endcsname {#2} + \expandafter\def\csname #1@contents\endcsname {#3} + } + \expandafter\def\csname #1@image\endcsname {#6} +} + +\newcommand\showboarditem[1]{ + \feagendatwocolumn{ + \csname #1@title\endcsname + }{ + \csname #1@contents\endcsname + } + {} + { + \csname #1@image\endcsname + } +} + + +\newcommand\showonlineagendaday[1]{ + \ifthenelse{\equal{\agendalanguage}{french}}{ + \section{#1 demi-journée} + }{ + \section{Half day #1} + } +} + +\newcommand\showonsiteagendaday[2]{ + \ifthenelse{\equal{\agendalanguage}{french}}{ + \ifthenelse{\equal{#2}{morning}}{ + \section{Jour #1 - Matin} + }{ + \section{Jour #1 - Après-midi} + } + }{ + \ifthenelse{\equal{#2}{morning}}{ + \section{Day #1 - Morning} + }{ + \section{Day #1 - Afternoon} + } + } +}