Ajouter un modèle pour des diapositives de corrigés

This commit is contained in:
Benjamin Bohard 2022-03-11 12:38:34 +01:00
parent 68a3d73368
commit b2f942cd43
4 changed files with 20 additions and 1 deletions

View File

@ -16,12 +16,15 @@ LICENSES = {'CC-by-sa-2.0': 'license-cc-by-sa-2.0',
TEMPLATES = {
'beamer': {'fragment': 'frame.tex',
'fragment_pratique': 'frame-pratique.tex',
'fragment_corrige': 'frame-corrige.tex',
'master': 'main-beamer.tex'},
'article': {'fragment': 'fragment.tex',
'fragment_pratique': 'fragment-pratique.tex',
'fragment_corrige': 'fragment-corrige.tex',
'master': 'main-article.tex'},
'questionnaire': {'fragment': 'fragment.tex',
'fragment_pratique': 'fragment-pratique.tex',
'fragment_corrige': 'fragment-corrige.tex',
'master': 'main-questionnaire.tex'}
}
@ -256,6 +259,7 @@ def main():
tex_skbinputs = SKBINPUT_RE.finditer(tex_master)
fragment = TEMPLATES[tex_class.group('document_class')]['fragment']
fragment_pratique = TEMPLATES[tex_class.group('document_class')]['fragment_pratique']
fragment_corrige = TEMPLATES[tex_class.group('document_class')]['fragment_corrige']
for skbinput in tex_skbinputs:
rep = path.dirname(skbinput.group('tex'))
@ -267,7 +271,12 @@ def main():
print(dest)
if not path.isdir(rep):
makedirs(rep)
template = jinja_env.get_template(fragment_pratique if tex_name.endswith('-pratique') else fragment)
if tex_name.endswith('-pratique'):
template = jinja_env.get_template(fragment_pratique)
elif tex_name.endswith('-corrige'):
template = jinja_env.get_template(fragment_corrige)
else:
template = jinja_env.get_template(fragment)
env = {'title': basename, 'subtitle': '',
'name': dest}
rendered_template = template.render(**env)

View File

@ -32,6 +32,7 @@
\definecolor{UniBlue}{RGB}{83,121,180}
\definecolor{CleanWhite}{RGB}{255,255,255}
\definecolor{TravauxPratiques}{RGB}{230,230,230}
\definecolor{Corrige}{RGB}{255,239,0}
\definecolor{Repos}{RGB}{0,0,0}
\setbeamercolor{title}{fg=UniBlue}
\setbeamercolor{frametitle}{fg=UniBlue}

View File

@ -0,0 +1,2 @@
\skbheading{(((title|escape_tex)))}
fichier (((name|escape_tex))) à éditer

View File

@ -0,0 +1,7 @@
{\setbeamercolor{background canvas}{bg=Corrige}
\begin{frame}
\frametitle{(((title|escape_tex)))}
fichier (((name|escape_tex))) à éditer
% contenu (pas trop long) de la diapositive
\end{frame}
}