Feat: Initialise le depot pour l'année 2022-2023

This commit is contained in:
Bertrand Benjamin 2022-07-25 16:25:38 +02:00
commit 17730aac5a
36 changed files with 8562 additions and 0 deletions

37
Makefile Normal file
View File

@ -0,0 +1,37 @@
CLEUSB=Cle8G
COMMON_EXCLUDE=--exclude "__pycache__" --exclude "venv/" --exclude ".git" --exclude ".gitignore" --exclude ".*" --exclude "**/*.ppm"
VENV="enseignements"
install:
git config core.hooksPath ./tools/git/hooks/
python -m venv ~/.venv/$(VENV)
( \
. ~/.venv/$(VENV)/bin/activate;\
pip install -r requirements.txt;\
)
update:
( \
. ~/.venv/$(VENV)/bin/activate;\
pip install --ignore-installed -r requirements.txt
)
clean:
git clean -idx -e venv/ -e video/
sequence:
sh ./tools/scripts/new_sequence.sh
eval:
sh ./tools/scripts/new_eval.sh
rsync_cleUSB: clean
rsync -rtv -u --del --exclude "venv" ./ $(COMMON_EXCLUDE) /run/media/lafrite/$(CLEUSB)/Enseignements
rsync -rtv -u $(COMMON_EXCLUDE) ../Divers/ /run/media/lafrite/$(CLEUSB)/Divers
rsync -rtv -u $(COMMON_EXCLUDE) ../Notes/ /run/media/lafrite/$(CLEUSB)/Notes
rsync -rtv -u $(COMMON_EXCLUDE) ../Productions\ Eleves/ /run/media/lafrite/$(CLEUSB)/Productions
.PHONY:

13
config.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
export ROOT=`pwd`
export TEXINPUTS=".:${ROOT}/tools/style//::"
# activate virtual env
source ~/.venv/enseignements/bin/activate
goroot(){
cd $ROOT
}

17
requirements.txt Normal file
View File

@ -0,0 +1,17 @@
docutils==0.18.1
gitdb==4.0.9
GitPython==3.1.24
greenlet==1.1.2
invoke==1.6.0
jedi==0.18.1
Jinja2==2.11.2
MarkupSafe==1.1.1
msgpack==1.0.0
mypytex==0.4
parso==0.8.3
prompt-toolkit==3.0.24
pynvim==0.4.3
restructuredtext-lint==1.3.2
smmap==3.0.4
Unidecode==1.3.2
wcwidth==0.2.5

View File

@ -0,0 +1,71 @@
\documentclass[a4paper,12pt]{article}
\usepackage{myXsim}
\title{Étude de la fonction logarithme}
\tribe{Terminale TESL}
\date{Mai 2020}
\begin{document}
\maketitle
\section{Représentation graphique}
La \textbf{fonction logarithme} notée $\ln$ est définie sur $\R^{+*}=\intOO{0}{+\infty}$ par $\ln :x \mapsto ln(x)$.
\begin{minipage}{0.5\textwidth}
\begin{itemize}
\item Elle est continue et dérivable sur $\R^{+*}$
\item Elle est négative sur $\intOO{0}{1}$
\item Elle est positive sur $\intOO{1}{+\infty}$
\item $\ln(1) = 0$ et $\ln(e) = 1$
\end{itemize}
\begin{tikzpicture}
\tkzTabInit[lgt=2,espcl=5]{$x$/1,$f(x)$/2}%
{$0$, $+\infty$}%
\tkzTabVar{D-/$-\infty$, +/$+\infty$}%
\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[yscale=0.8, xscale=1]
\tkzInit[xmin=0,xmax=6,xstep=1,
ymin=-3,ymax=3,ystep=1]
\tkzGrid
\tkzAxeXY[up space=0.5,right space=.5]
\tkzFct[domain = 0.01:6, line width=1pt]{log(x)}
\tkzText[draw,fill = brown!20](5,-2.5){$f(x)=\ln(x)$}
\end{tikzpicture}
\end{minipage}
\section{Dérivée de $\ln$}
\subsection*{Propriété}
La dérivée de la fonction logarithme est la fonction inverse
\[
\forall x \in \intOO{0}{+\infty} \qquad \ln'(x) = \frac{1}{x}
\]
On en déduit, pour tout $x > 0$:
\begin{itemize}
\item $\ln'(x) = \dfrac{1}{x}$ et $\dfrac{1}{x} > 0$ alors la fonction logarithme est \dotfill
\item $\ln''(x) = \makebox[2cm]{\dotfill}$ et $\makebox[2cm]{\dotfill}$ alors la fonction logarithme est \dotfill
\end{itemize}
\subsection*{Exemples de calculs}
Calcul de la dérivée de $f(x) = 2x + 1 - 4\ln(x)$
\afaire{}
Calcul de la dérivée de $f(x) = (2x+1)\ln(x)$
\afaire{}
Calcul de la dérivée de $f(x) = \dfrac{2x+1}{\ln(x)}$
\afaire{}
\end{document}

Binary file not shown.

View File

@ -0,0 +1,21 @@
\documentclass[a4paper,10pt]{article}
\usepackage{myXsim}
\title{Lorem lorem}
\tribe{Lorem}
\date{Mai 2020}
\pagestyle{empty}
\geometry{left=10mm,right=10mm, top=10mm}
\DeclareExerciseCollection{banque}
\xsimsetup{
step=1,
}
\begin{document}
\input{exercises.tex}
\printcollection{banque}
\end{document}

View File

@ -0,0 +1,12 @@
\collectexercises{banque}
\begin{exercise}[subtitle={lorem - cours}, step={1}, topics={lorem}]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{exercise}
\begin{exercise}[subtitle={lorem lorem - cours}, step={2}, topics={lorem}]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{exercise}
\collectexercisesstop{banque}

View File

@ -0,0 +1,33 @@
\collectexercises{banque}
\begin{exercise}[subtitle={lorem}, step={1}, topics={Logarithme}, origin={Inspiré de 23p201}]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{exercise}
\begin{solution}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{solution}
\begin{exercise}[subtitle={lorem lorem}, step={1}, topics={Logarithme}, origin={Création}]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{exercise}
\begin{solution}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{solution}
\begin{exercise}[subtitle={lorem lorem lorem}, step={2}, topics={Logarithme}, origin={BAC ES 2017 AN sept EX3}]
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{exercise}
\begin{solution}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{solution}
\collectexercisesstop{banque}

Binary file not shown.

49
tools/examples/presentation.tex Executable file
View File

@ -0,0 +1,49 @@
\documentclass[14pt]{classPres}
\author{}
\title{}
\date{}
\begin{document}
\begin{frame}{Questions flashs}
\begin{center}
\vfill
Terminale ES-L
\vfill
30 secondes par calcul
\vfill
\tiny \jobname
\end{center}
\end{frame}
\begin{frame}{Calcul 1}
Un ordinateur coûte 400\euro. On a une remise de 5\%. \\
Combien va-t-il nous coûter?
\end{frame}
\begin{frame}{Calcul 2}
Sur une totale de recette de \np{2400}\euro, 40\% ont été réalisée par des paiement en espèce. \\
Quelle est le montant des paiements réalisé en espèce?
\end{frame}
\begin{frame}{Calcul 3}
\[
4x + 5 = 25
\]
\end{frame}
\begin{frame}{Calcul 4}
\[
f(x) = 3x^2 + 4x - 10
\]
Calculer $f(3)$
\end{frame}
\begin{frame}{Fin}
\begin{center}
On retourne son papier.
\end{center}
\end{frame}
\end{document}

Binary file not shown.

View File

@ -0,0 +1,260 @@
\documentclass[a4paper,10pt]{article}
\usepackage{myXsim}
\usepackage{qrcode}
\title{TITRE}
\tribe{TRIBU}
\date{DATE}
\begin{document}
\maketitle
\section{Raccourcis}%
\begin{itemize}
\item \verb+\ds+ $\ds \frac{1}{2}$
\item \verb+\N+ $\N$
\item \verb+\Z+ $\Z$
\item \verb+\Q+ $\Q$
\item \verb+\R+ $\R$
\item \verb+\C+ $\C$
\item \verb+\intOO+ $\intOO{\#1}{\#2}$
\item \verb+\intFO+ $\intOO{\#1}{\#2}$
\item \verb+\intOF+ $\intOO{\#1}{\#2}$
\item \verb+\intFF+ $\intOO{\#1}{\#2}$
\item \verb+\vect+ $\vect{\#1}$
\item \verb+\norme+ $\norme{\#1}$
\item \verb+\scal+ $\scal{\#1}{\#2}$
\item \verb+\vectCoord+ $\vectCoord{\#1}{\#2}$
\item \verb+\e+ $\e$
% \item \verb+\i+ $\i$
\item \verb+\coefBino+ $\coefBino{\#1}{\#2}$
\item \verb+\equiv+ $\equiv$
\item \verb+\calc+ $\calc{\#1}$
\end{itemize}
\section{Compétences}
\begin{itemize}
\item \verb+\Cher+ \Cher
\item \verb+\Mod+ \Mod
\item \verb+\Rep+ \Rep
\item \verb+\Rai+ \Rai
\item \verb+\Cal+ \Cal
\item \verb+\Com+ \Com
\item \verb+\Con+ \Con
\item \verb+\RepLevel+ \RepLevel{.}\RepLevel{0}\RepLevel{1}\RepLevel{2}\RepLevel{3}
\item \verb+\SignalBar+ \SignalBar{2}
\item \verb+\Assesment+ \Assesment{3}
\item \verb+\competencesStatement+ \competencesStatement
\end{itemize}
\section{tikzpicture}
\begin{verbatim}
\begin{tikzpicture}[scale=1]
...
\end{tikzpicture}
\end{verbatim}
\begin{itemize}
\item \verb+\cercleTrigo+
\begin{tikzpicture}[scale=1]
\cercleTrigo
\end{tikzpicture}
\item \verb+\cercleTrigoNoOIJ+
\begin{tikzpicture}[scale=1]
\cercleTrigoNoOIJ
\end{tikzpicture}
\item \verb+\repere+
\begin{tikzpicture}[scale=1]
\repere{-2}{2}{-2}{2}
\end{tikzpicture}
\item \verb+\repereNoGrid+
\begin{tikzpicture}[scale=1]
\repereNoGrid{-2}{2}{-2}{2}
\end{tikzpicture}
\item \verb+\boxplot+
\begin{tikzpicture}[scale=1]
\boxplot{2}{0}{1}{2}{3}{4}{5}
\end{tikzpicture}
\item \verb+\boxplotNoNames+
\begin{tikzpicture}[scale=1]
\boxplotNoNames{2}{0}{1}{2}{3}{4}{5}
\end{tikzpicture}
\end{itemize}
\section{Mise en avant}
\begin{itemize}
\item \verb+\afaire+
\afaire{\#1}
\item \verb+\envideo+
\envideo{\#linktaget}{\#linkname}
\item \verb+\enclasse+
\enclasse{\#1}
\item \verb+\arediger+
\arediger{\#1}
\end{itemize}
\section{Algo}
\begin{multicols}{2}
\begin{verbatim}
\begin{algorithm}[H]
\SetAlgoLined
\Entree{n}
\Deb{
$u \leftarrow 3$ \;
\Pour{$i$ de 1 à 3}{
$u \leftarrow u+2$ \;
}
}
\Sortie{u}
\end{algorithm}
\end{verbatim}
\columnbreak
\begin{algorithm}[H]
\SetAlgoLined
\Entree{n}
\Deb{
$u \leftarrow 3$ \;
\Pour{$i$ de 1 à 3}{
$u \leftarrow u+2$ \;
}
}
\Sortie{u}
\end{algorithm}
\end{multicols}
\section{Programmation}
\begin{multicols}{2}
\begin{verbatim}
\begin{lstlisting}[language=Python, basicstyle=\small, frame=]
x = ("Nombre de tirage?")
if x < 200:
print("Le tarif est ", x*0.11)
else:
print("Le tarif est ", x*0.8)
\end{lstlisting}
\end{verbatim}
\columnbreak
\begin{lstlisting}[language=Python, basicstyle=\small, frame=]
x = ("Nombre de tirage?")
if x < 200:
print("Le tarif est ", x*0.11)
else:
print("Le tarif est ", x*0.8)
\end{lstlisting}
\end{multicols}
\section{QRcode}
\verb+\usepackage{qrcode}+
\qrcode{phrase à coder}
\section{Graphique et tableaux}
\subsection{Grahique}
\begin{multicols}{2}
\begin{verbatim}
\begin{tikzpicture}[baseline=(current bounding box.south),
xscale=1, yscale=0.5]
\tkzInit[xmin=-5,xmax=5,xstep=1,
ymin=-5,ymax=5,ystep=1]
\tkzGrid
\tkzAxeXY
\tkzFct[domain=-5:5,color=red,very thick]%
{ 0.4*x*x - 3 };
\end{tikzpicture}
\end{verbatim}
\columnbreak
\begin{tikzpicture}[baseline=(current bounding box.south),
xscale=1, yscale=0.5]
\tkzInit[xmin=-5,xmax=5,xstep=1,
ymin=-5,ymax=5,ystep=1]
\tkzGrid
\tkzAxeXY
\tkzFct[domain=-5:5,color=red,very thick]%
{ 0.4*x*x - 3 };
\end{tikzpicture}
\end{multicols}
Quand on change la valeur de \verb+xstep+, il faut replacer \verb+x+ par \verb+\x+.
\begin{multicols}{2}
\begin{verbatim}
\begin{tikzpicture}[baseline=(current bounding box.south),
xscale=0.5, yscale=0.4]
\tkzInit[xmin=-5,xmax=5,xstep=0.5,
ymin=-5,ymax=5,ystep=1]
\tkzGrid
\tkzAxeXY
\tkzFct[domain=-5:5,color=red,very thick]%
{ 0.4*\x*\x - 3 };
\end{tikzpicture}
\end{verbatim}
\columnbreak
\begin{tikzpicture}[baseline=(current bounding box.south),
xscale=0.5, yscale=0.4]
\tkzInit[xmin=-5,xmax=5,xstep=0.5,
ymin=-5,ymax=5,ystep=1]
\tkzGrid
\tkzAxeXY
\tkzFct[domain=-5:5,color=red,very thick]%
{ 0.4*\x*\x - 3 };
\end{tikzpicture}
\end{multicols}
\subsection{Tableau de signes et variations}
\begin{multicols}{2}
\begin{verbatim}
\begin{tikzpicture}[baseline=(current bounding box.south)]
\tkzTabInit[lgt=2,espcl=2]
{$ x $/1,$ f(x) $/2}{-1, 2, 3, 5}
\tkzTabLine{, +, z, +, z, -, d, + , }
\end{tikzpicture}
\end{verbatim}
\columnbreak
\begin{tikzpicture}[baseline=(current bounding box.south)]
\tkzTabInit[lgt=2,espcl=2]
{$ x $/1,$ f(x) $/2}{-1, 2, 3, 5}
\tkzTabLine{, +, z, +, z, -, d, + , }
\end{tikzpicture}
\end{multicols}
\begin{multicols}{2}
\begin{verbatim}
\begin{tikzpicture}[baseline=(current bounding box.south)]
\tkzTabInit[lgt=2,espcl=2]
{$ x $/1, $ f(x) $/2}{-2, 0, 1 }
\tkzTabVar{ +/3, -/1, +/5}
\end{tikzpicture}
\end{verbatim}
\columnbreak
\begin{tikzpicture}[baseline=(current bounding box.south)]
\tkzTabInit[lgt=2,espcl=2]
{$ x $/1, $ f(x) $/2}{-2, 0, 1 }
\tkzTabVar{ +/3, -/1, +/5}
\end{tikzpicture}
\end{multicols}
\end{document}

Binary file not shown.

View File

@ -0,0 +1,63 @@
\documentclass[a4paper,10pt]{article}
\RequirePackage[utf8x]{inputenc}
\RequirePackage[french]{babel}
\RequirePackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat = newest}
\usepgfplotslibrary{external}
\RequirePackage{tkz-tab}
\RequirePackage{tkz-fct}
\title{Snippets pour tikzpicture}
\date{}
\author{Benjamin Bertrand}
\begin{document}
\section{La base}
\begin{tikzpicture}
% par défaut les unités sont en cm
% un segment
\draw (0, 0) -- (1, 0);
% Coordonnées relatives
\draw (0, 0) -- ++(0, 1);
% Coordonnées polaire (angle: rayon)
\draw (0, 0) -- (45: 1);
% une figure pleine
\fill (2, 2) -- (1, 1) -- (2, 3) -- cycle;
% Un cercle (centre et rayon)
\draw (4, 1) circle (1);
% rectangle
\draw (5, 0) rectangle (6, 6);
\end{tikzpicture}
\section{Graphiques de fonctions}
\begin{tikzpicture}
\begin{axis}[
axis lines = center,
%grid = both,
xlabel = {$x$},
xtick distance=1,
ylabel = {$y$},
ytick distance=1,
legend pos = north west,
legend entries={$f(x)$, $g(x)$}
]
\addplot[domain=-6:7,samples=40, color=red, very thick]{-0.1*(x+5)*(x-1)*(x-6)};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[axis x line=bottom,axis y line = left]
\addplot[ybar,fill=blue,draw=blue,bar width=1cm] coordinates { (1,194) (2,213) (3,251)(4,233) (5,194)}; \end{axis}
\end{tikzpicture}
\end{document}

146
tools/git/hooks/pre-commit Executable file
View File

@ -0,0 +1,146 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 lafrite <lafrite@Poivre>
#
# Distributed under terms of the MIT license.
"""
Git hook to ensure validity of all rst files
"""
from git import Repo
from pathlib import Path
import re
import time
import restructuredtext_lint
import sys
import logging
formatter = logging.Formatter('%(name)s :: %(levelname)s :: %(message)s')
steam_handler = logging.StreamHandler()
#steam_handler = logging.FileHandler('logging.conf')
steam_handler.setLevel(logging.DEBUG)
steam_handler.setFormatter(formatter)
# création de l'objet logger qui va nous servir à écrire dans les logs
logger = logging.getLogger("precommit")
# on met le niveau du logger à DEBUG, comme ça il écrit tout
logger.setLevel(logging.WARNING)
logger.addHandler(steam_handler)
# Files selection
def get_commited_files(repo):
hdiff = repo.head.commit.diff()
diff = {"A":[], "M":[]}
for f in hdiff.iter_change_type("A"):
diff["A"].append(f.b_path)
for f in hdiff.iter_change_type("M"):
diff["M"].append(f.b_path)
return diff
def select_by_extension(files, ext="rst"):
return [i for i in files if i.split(".")[-1] == ext and 'skeleton' not in i]
# Rst linter
def rst_lint(filename):
with open(filename, 'r') as f:
errors = restructuredtext_lint.lint(f.read())
for e in errors:
logger.warning(f"{filename} \n{e.full_message}\n")
return errors
# Rst parameters normalize
def normalize_file(filename, normalizers = {}):
logger.debug(f"Normalizing {filename}")
logger.debug(f"With {normalizers}")
new_file = ""
modified_lines = []
with open(filename, 'r') as f:
for l in f.readlines():
new_line = run_normalizers(l, normalizers)
if new_line != l:
modified_lines.append(f"{l}")
logger.warning(f"{filename}\n\t{l}\t{new_line}")
new_file += new_line
with open(filename, "w") as f:
f.write(new_file)
logger.debug(f"{filename} written")
return modified_lines
def run_normalizers(line, normalizers):
for c in normalizers:
obs = re.search(c, line)
if obs:
logger.debug(f"Find for {c}")
return normalizers[c](line)
return line
# Rst function tools
def update_date(line):
date = time.strftime("%Y-%m-%d")
logger.debug(f"Update Date to: {date}")
return f":date: {date}\n"
def update_modified(line):
modified = time.strftime("%Y-%m-%d")
logger.debug(f"Update modified to: {modified}")
return f":modified: {modified}\n"
def normalize_tags(line):
logger.debug(f"Normaizing tags")
tags = line.split(":")[-1]
tags = [i.strip().capitalize() for i in tags.split(",")]
tags_str = ", ".join(tags)
logger.debug(f"Update tags to: {tags_str}")
return f":tags: {tags_str}\n"
NORMALIZERS_MODIFIED = {
":modified:.*": update_modified,
":tags:.*": normalize_tags,
}
NORMALIZERS_NEW = {
":date:.*": update_date,
":modified:.*": update_modified,
":tags:.*": normalize_tags,
}
if __name__ == "__main__":
r = Repo()
diff = get_commited_files(r)
errors = []
modified = []
# New files
for f in select_by_extension(diff["A"], "rst"):
errors += rst_lint(f)
modified += normalize_file(f, NORMALIZERS_NEW)
r.index.add([f])
# Modified files
for f in select_by_extension(diff["M"], "rst"):
errors += rst_lint(f)
modified += normalize_file(f, NORMALIZERS_MODIFIED)
r.index.add([f])
if len(errors) > 0:
logger.warning("Errors in rst formating, commit aborted")
sys.exit(1)
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del

66
tools/scripts/new_eval.sh Normal file
View File

@ -0,0 +1,66 @@
#!/bin/bash
display_result() {
dialog --title "$1" \
--no-collapse \
--msgbox "$result" 0 0
}
exec 3>&1
selection=$(dialog \
--backtitle "Création d'une nouvelle évaluation: Classe" \
--title "Menu" \
--clear \
--cancel-label "Exit" \
--menu "Choisir un niveau:" 0 0 4 \
"1" "2nd" \
"2" "Enseignements Scientifique" \
"3" "4e" \
"4" "Technologique" \
2>&1 1>&3)
exec 3>&-
case $selection in
1 )
tribe="2nd"
;;
2 )
tribe="EnseignementsScientifique"
;;
3 )
tribe="4e"
;;
4 )
tribe="Technologique"
;;
esac
exec 3>&1
date=$(dialog --calendar "Date" 0 0 2>&1 1>&3 | awk -F "/" '{print $3"-"$2"-"$1}')
exec 3>&-
exec 3>&1
name=$(dialog \
--inputbox "Nom de l'évaluation" \
0 0 \
2>&1 1>&3)
exec 3>&-
exec 3>&1
duration=$(dialog \
--inputbox "Temps pour le travailler" \
0 0 \
2>&1 1>&3)
exec 3>&-
mkdir -p $tribe/Evaluations/
sequence_path=$tribe/Evaluations/DS_${date}/
mkdir -p $sequence_path
export name=$name
export date=$date
export tribe=$tribe
export duration=$duration
envsubst < ./tools/skeleton/eval/exercises.tex > $sequence_path/exercises.tex
envsubst < ./tools/skeleton/eval/sujet.tex > $sequence_path/sujet.tex

View File

@ -0,0 +1,112 @@
#!/bin/bash
display_result() {
dialog --title "$1" \
--no-collapse \
--msgbox "$result" 0 0
}
exec 3>&1
date=$(dialog --calendar "Date" 0 0 2>&1 1>&3 | awk -F "/" '{print $3"-"$2"-"$1}')
exec 3>&-
exec 3>&1
selection=$(dialog \
--backtitle "Création d'une nouvelle séquence: Classe" \
--title "Menu" \
--clear \
--cancel-label "Exit" \
--menu "Choisir un niveau:" 0 0 4 \
"1" "2nd" \
"2" "Enseignements Scientifique" \
"3" "4e" \
"4" "Technologique" \
2>&1 1>&3)
exec 3>&-
case $selection in
1 )
tribe="2nd"
;;
2 )
tribe="EnseignementsScientifique"
;;
3 )
tribe="4e"
;;
4 )
tribe="Technologique"
;;
esac
exec 3>&1
cd $tribe
existing_seq=$(ls -d */)
nbr_seq=$(echo $existing_seq | wc -w)
next_seq_number=$(expr $nbr_seq)
title=$(dialog \
--inputbox "Séquences trouvée\n${existing_seq/ /\n} \nNom de la nouvelle sequence (n°$next_seq_number)" \
0 0 \
2>&1 1>&3)
exec 3>&-
cd ..
exec 3>&1
summary=$(dialog \
--inputbox "Résumé de la séquence" \
0 0 \
2>&1 1>&3)
exec 3>&-
## ajouter les tags
exec 3>&1
tags=$(dialog \
--inputbox "Liste des tags séparés par une virgule" \
0 0 \
2>&1 1>&3)
exec 3>&-
## Plan de travail ou classique
exec 3>&1
selection=$(dialog \
--backtitle "Création d'une nouvelle séquence: Type" \
--title "Menu" \
--clear \
--cancel-label "Exit" \
--menu "Type de séquence:" 0 0 4 \
"1" "Classique" \
"2" "Plan de travail" \
2>&1 1>&3)
exec 3>&-
case $selection in
1 )
sequence_type="classique"
;;
2 )
sequence_type="plan_de_travail"
;;
esac
sequence_path=$tribe/$(printf "%02d" $next_seq_number)_${title// /_}/
mkdir -p $sequence_path
export title=$title
export title_under=${title//?/#}
export author='Benjamin Bertrand'
export date=`date --date="$date 00:00" "+%B %Y"`
export tribe=$tribe
export tags=$tags
export summary=$summary
SKELETONPATH=./tools/skeleton/sequence
for i in `ls $SKELETONPATH/common/`
do
envsubst < $SKELETONPATH/common/$i > $sequence_path/$i
done
for i in `ls $SKELETONPATH/$sequence_type`
do
envsubst < $SKELETONPATH/$sequence_type/$i > $sequence_path/$i
done

View File

@ -0,0 +1,7 @@
\begin{exercise}[subtitle={<++>}, step={1}, origin={<++>}, topics={ ${title} }, tags={ ${tags} }]
<++>
\end{exercise}
\begin{solution}
<++>
\end{solution}

View File

@ -0,0 +1,27 @@
\documentclass[a4paper,12pt]{article}
\usepackage{myXsim}
% Title Page
\title{ ${name} \hfill ${subname}}
\tribe{${tribe}}
\date{${date}}
\duree{${duration}}
\DeclareExerciseCollection[step=1]{banque}
\xsimsetup{collect}
\begin{document}
\maketitle
Le barème est donné à titre indicatif, il pourra être modifié.
\input{exercises.tex}
\printcollection{banque}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End:

View File

@ -0,0 +1,14 @@
\documentclass[a4paper,10pt]{article}
\usepackage{myXsim}
\author{${author}}
\title{${title} - Cours}
\date{${date}}
\pagestyle{empty}
\begin{document}
\maketitle
\end{document}

View File

@ -0,0 +1,17 @@
\documentclass[a4paper,10pt]{article}
\usepackage{myXsim}
\author{${author}}
\title{${title} - Exercices}
\date{${date}}
\DeclareExerciseCollection[step=1]{banque}
\xsimsetup{collect}
\begin{document}
\input{exercises.tex}
\printcollection{banque}
\end{document}

View File

@ -0,0 +1,7 @@
\begin{exercise}[subtitle={<++>}, step={1}, origin={<++>}, topics={ ${title} }, tags={ ${tags} }]
<++>
\end{exercise}
\begin{solution}
<++>
\end{solution}

View File

@ -0,0 +1,12 @@
${title}
${title_under}
:date: ${date}
:modified: ${date}
:authors: ${author}
:tags: ${tags}
:category: ${tribe}
:summary: ${summary}
Étape 1:
========

View File

@ -0,0 +1,44 @@
\documentclass[a4paper,12pt]{article}
\usepackage{myXsim}
\author{${author}}
\title{${title} - Plan de travail}
\tribe{${tribe}}
\date{${date}}
\pagestyle{empty}
\DeclareExerciseCollection{banque}
\xsimsetup{
}
\begin{document}
\maketitle
% Résumé
\bigskip
Savoir-faire de la séquence
\begin{itemize}
\item
\end{itemize}
\bigskip
Ordre des étapes à respecter
\section{}
\listsectionexercises
\pagebreak
\input{exercises.tex}
\printcollection{banque}
\end{document}

View File

@ -0,0 +1,28 @@
\documentclass[a4paper,10pt]{article}
\usepackage{myXsim}
\usetikzlibrary{shapes.geometric}
\author{${author}}
\title{${title} - Solutions}
\tribe{${tribe}}
\date{${date}}
\DeclareExerciseCollection{banque}
\xsimsetup{
exercise/print=false,
solution/print=true,
}
\pagestyle{empty}
\begin{document}
\maketitle
\input{exercises.tex}
%\printcollection{banque}
%\printsolutions{exercises}
\end{document}

89
tools/style/base.sty Executable file
View File

@ -0,0 +1,89 @@
\NeedsTeXFormat{LaTeX2e}
% extensions
%\RequirePackage[utf8x]{inputenc}
\RequirePackage[french]{babel}
%\usepackage[babel=true,kerning=true]{microtype}
%\RequirePackage{amssymb}
%\RequirePackage{amsmath}
%\RequirePackage{amsfonts}
\PassOptionsToPackage{table,usenames,dvipsnames}{xcolor}
\RequirePackage{hyperref}
%\RequirePackage{subfig}
\RequirePackage{fancybox}
\RequirePackage{graphicx}
\graphicspath{{./}{\string~/.Clipart/}}
\RequirePackage{textcomp}
\RequirePackage{gensymb}
\RequirePackage{ifthen, calc}
\RequirePackage{tabularx}
\RequirePackage{tasks}
% Géométrie
\RequirePackage{geometry}
\geometry{left=10mm,
right=10mm,
top=5mm,
bottom=5mm,
includeheadfoot,
headsep=0pt,
footskip=1em,
}
\setlength{\columnsep}{30pt} % default=10pt
\setlength{\columnseprule}{1pt} % default=0pt (no line)
% Symbole euro
\RequirePackage{eurosym}
% Espaces pour écrire les grands nombres
\RequirePackage[np]{numprint}
% Outils pour les tableaux et les fonctions
\RequirePackage{tkz-tab}
\RequirePackage{tkz-fct}
% Pour les block scratch
\RequirePackage{scratch3}
% Plusieurs colonnes
\RequirePackage{multicol}
% inteligent import (see https://codeyarns.com/2010/05/27/latex-import-subimport-for-document-organization/)
\RequirePackage{import}
% Lecture des fichiers csv et affichage des csv en table
\RequirePackage{csvsimple}
% Mes racourcis
\RequirePackage{shortcuts}
%Polices
\RequirePackage{kpfonts-otf}
\RequirePackage{fontspec}
\setmainfont{KpSans}
\setsansfont{KpSans}
\setmonofont{KpMono}
% \RequirePackage[nomath]{kpfonts}
% \renewcommand*\familydefault{\sfdefault}
% \RequirePackage[T1]{fontenc}
% Les tableaux
\renewcommand{\arraystretch}{1.5}
\newcolumntype{C}[1]{>{\centering\arraybackslash }b{#1}}
% Figure qui se fondent dans le texte
\RequirePackage{wrapfig}
% Code formating with listing
\RequirePackage{code}
% Write algorithm
\usepackage[linesnumbered, boxed, french]{algorithm2e}
\RequirePackage{enumitem}
\setlist[itemize,1]{label=$\bullet$}

22
tools/style/classPres.cls Executable file
View File

@ -0,0 +1,22 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{classPres}
% Classe de base - Beamer
%\pdfminorversion=4
\LoadClassWithOptions{beamer}
\usetheme{Singapore}
%\usepackage[defaultsans]{droidsans}
%\usepackage[T1]{fontenc}
%\usefonttheme[onlymath]{serif}
% extensions
\RequirePackage{colorscheme}
\RequirePackage{base}
\geometry{left=10mm,right=10mm, top=0mm}
% Les tableaux
\renewcommand{\arraystretch}{1.5}

47
tools/style/code.sty Executable file
View File

@ -0,0 +1,47 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{listings}
\lstset{literate=
{á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1
{Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1
{à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1
{À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1
{ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
{Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
{â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1
{Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1
{Ã}{{\~A}}1 {ã}{{\~a}}1 {Õ}{{\~O}}1 {õ}{{\~o}}1
{œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1
{ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 {ő}{{\H{o}}}1 {Ő}{{\H{O}}}1
{ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1
{€}{{\euro}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1
{»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1
}
\lstset{
backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}; should come as last argument
%basicstyle=\tiny, % the size of the fonts that are used for the code
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
breaklines=true, % sets automatic line breaking
captionpos=b, % sets the caption-position to bottom
commentstyle=\color{gray}, % comment style
deletekeywords={...}, % if you want to delete keywords from the given language
escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=single, % adds a frame around the coden,
keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
keywordstyle=\color{green}, % keyword style
language=Python, % the language of the code
morekeywords={*,...}, % if you want to add more keywords to the set
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
% numbersep=5pt, % how far the line-numbers are from the code
numberstyle=\tiny\color{gray}, % the style that is used for the line-numbers
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
%stepnumber=2, % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\color{purple},
tabsize=2, % sets default tabsize to 2 spaces
%title=\tiny\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title
}

51
tools/style/colorscheme.sty Executable file
View File

@ -0,0 +1,51 @@
\NeedsTeXFormat{LaTeX2e}
% Couleurs,
\RequirePackage{xcolor}
\RequirePackage{colortbl}
% Couleurs éléments
% \definecolor{coulpied}{couleur3}
% \definecolor{coulnumexos}{couleur5}
% \definecolor{coulrule}{couleur5}
% \definecolor{coulsection}{couleur1}
% \definecolor{coultable1}{couleur4}
% \definecolor{coultable2}{couleur3}
% \definecolor{coultheo}{couleur4}
% \definecolor{couldef}{couleur3}
% Solarized theme
\definecolor{base03}{HTML}{002b36}
\definecolor{base02}{HTML}{073642}
\definecolor{base01}{HTML}{586e75}
\definecolor{base00}{HTML}{657b83}
\definecolor{base0}{HTML}{839496}
\definecolor{base1}{HTML}{93a1a1}
\definecolor{base2}{HTML}{eee8d5}
\definecolor{base3}{HTML}{FDF6E3}
\definecolor{yellow}{HTML}{B58900}
\definecolor{orange}{HTML}{cb4b16}
\definecolor{red}{HTML}{DC322F}
\definecolor{magenta}{HTML}{d33682}
\definecolor{violet}{HTML}{6c71c4}
\definecolor{blue}{HTML}{268bd2}
\definecolor{cyan}{HTML}{2aa198}
\definecolor{green}{HTML}{859900}
% My theme
\colorlet{text}{base03}
\colorlet{footer}{base02}
\colorlet{bgentete}{base2}
\colorlet{title}{blue}
\colorlet{subtitle}{base02}
\colorlet{line}{base1}
\colorlet{comments}{base01}
\colorlet{exercise}{blue}
\colorlet{note}{red}
\colorlet{highlightbg}{base2}
\colorlet{tabular}{base3}

150
tools/style/myXsim.sty Normal file
View File

@ -0,0 +1,150 @@
\NeedsTeXFormat{LaTeX2e}
% extensions
\RequirePackage{colorscheme}
\RequirePackage{base}
\RequirePackage{myhdr}
\RequirePackage{notbeamer}
\RequirePackage{xsim}
\DeclareExerciseTagging{step}
\DeclareExerciseTagging{type}
\DeclareExerciseTagging{tribe}
\DeclareExerciseTagging{difficulty}
\DeclareExerciseTagging{origin}
\DeclareExerciseTagging{mode}
\DeclareExerciseTranslations{total}{
French = total,
}
\DeclareExerciseEnvironmentTemplate{exo}{%
\subsection*
{%
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}\nobreakspace
\GetExerciseProperty{counter}%
\hspace{0.5cm} \GetExercisePropertyT{mode}
{{\PropertyValue}}%
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
\color{exercise}
\GetExercisePropertyT{subtitle}
{{\PropertyValue}}%
\GetExercisePropertyT{points}
{{(/\PropertyValue})}%
\noindent
}
}{}
\xsimsetup{exercise/template=exo}
\DeclareExerciseEnvironmentTemplate{sol}{%
\subsection*
{%
\color{exercise}\nobreakspace
Exercice \GetExerciseProperty{counter}%
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
\color{exercise}{\XSIMmixedcase{\GetExerciseName}}
\hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm}
\color{exercise}
\GetExercisePropertyT{subtitle}
{{\PropertyValue}}%
\noindent
}
}{}
\xsimsetup{solution/template=sol}
\DeclareExerciseTableTemplate{DNB}{%
\XSIMputright\ExerciseTableCode{%
\hline
\XSIMifblankTF{\ExerciseType}
{}
{\XSIMmixedcase{\GetExerciseParameter{exercise-name}}}
&
\XSIMmixedcase{\XSIMtranslate{points}} \\
\hline
}%
\ForEachUsedExerciseByType{%
\XSIMifeqTF{#1}{\ExerciseTableType{#1}}
{%
\XSIMifblankTF{\ExerciseType}
{%
\XSIMputright\ExerciseTableCode{%
\XSIMmixedcase{\ExerciseParameterGet{#1}{exercise-name} }%
}%
}
{}%
\XSIMputright\ExerciseTableCode
{#3 & \XSIMifblankTF{#5}{\printgoal{0}}{\printgoal{#5}}\\ }%
}
{}%
}
\XSIMputright\ExerciseTableCode{%
\hline
\XSIMmixedcase{\XSIMtranslate{total}} &
\XSIMifblankTF{\ExerciseType}
{\TotalExerciseGoal{points}{}{}}
{\TotalExerciseTypeGoal{\ExerciseType}{points}{}{}} \\
\hline
}%
\XSIMexpandcode{%
\noexpand\begin{tabular}{|\XSIMifblankTF{\ExerciseType}{l}{c}|c|}
\noexpand\ExerciseTableCode
\noexpand\end{tabular}%
}%
}
\newcommand\printsectionexercises{%
\ForEachUsedExerciseByType{%
\ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section}
\printexercise{exercise}{##2}
\fi
}%
}
\newcommand\listsectionexercises{%
\begin{itemize}[label={$\square$}]
\ForEachUsedExerciseByType{%
\ifnum\ExercisePropertyGet{##1}{##2}{step}=\value{section}%
\item %
\GetExerciseProperty{mode}%
{{\PropertyValue}}\;%
\XSIMmixedcase{\GetExerciseName}\nobreakspace
\GetExerciseProperty{counter}%
{{\PropertyValue}}%
: %
\GetExerciseProperty{subtitle}%
{{\PropertyValue}}%
\dotfill
%Auto-évaluation
\begin{tikzpicture}
\foreach \k in {0,1,...,4}{
\draw (\k*0.5, 0) node[draw, star, star points=5, star point ratio=0.5]{};
}
\end{tikzpicture}
\fi
}%
\end{itemize}
}
\xsimsetup{
exercise/within = section,
exercise/the-counter = \arabic{exercise},
}
\newcommand\searchMode{\faIcon{search}}
\newcommand\groupMode{\faIcon{users}}
\newcommand\trainMode{\faIcon{tools}}
\newcommand\projectMode{\faIcon{sitemap}}
\newcommand\legendMode{%
\textbf{Légende:} \hfill
\searchMode: pour découvrir quelque chose
\hfill
\groupMode: à faire en groupe
\hfill
\trainMode: pour s'entrainer
}

97
tools/style/myhdr.sty Normal file
View File

@ -0,0 +1,97 @@
\NeedsTeXFormat{LaTeX2e}
% extensions
\RequirePackage{colorscheme}
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\newcommand{\op@entete}{}
\newcommand{\op@typedoctmp}{}
\newcommand{\op@tribe}{}
\newcommand{\op@duree}{}
\newcommand{\op@sujet}{}
\newcommand{\op@subtitle}{\op@tribe{} -- \@date{}}
\newcommand{\tribe}[1]{\renewcommand{\op@tribe}{#1}}
\newcommand{\duree}[1]{\renewcommand{\op@duree}{#1}}
\newcommand{\sujet}[1]{\renewcommand{\op@sujet}{Sujet #1}}
%% Redéfinition de maketitle
\renewcommand{\maketitle}{%
\noindent{\huge \color{title}\bfseries \@title}\par
\noindent{\color{line}\rule{\linewidth}{1ex}}\par
\noindent{\color{subtitle}\bfseries \op@subtitle \hfill \large\op@sujet}\par
%\vspace{2.5\baselineskip}
%\thispagestyle{plain}
}
%%% Page de garde
\renewcommand{\titlepage}{%
\pagestyle{plain}
\begin{center}
{\Huge \@title} \\
\vfill
{\Huge \op@tribe} \\
\vfill
\fbox{
\parbox{0.7\textwidth}{\large Épreuve de :
\begin{center}
\Huge MATHÉMATIQUES
\\[1cm]
{\Large \@date} \\[1cm]
\end{center}
\Large Durée de l'épreuve : \op@duree
\\[1cm]
}
}
\vfill
~\\[1cm]
\normalsize
Ce sujet comporte \pageref{LastPage}\, pages, numérotées de 1 / \pageref{LastPage}\; à \pageref{LastPage} / \pageref{LastPage}\\
Dès qu'il vous est remis, assurez-vous qu'il est complet.
~\\[0.5cm]
L'utilisation de la calculatrice en mode \textbf{examen} est autorisée.
\medskip
L'échange de calculatrice entre les élèves est strictement interdit.\\
L'usage du dictionnaire n'est pas autorisé. \\[1cm]
%\textbf{10 points} sont réservés à l'orthographe et à la présentation.
\gradingtable[type=exercise,template=DNB]
\vfill
\end{center}
\clearpage
}
% Header et Footer
\pagestyle{fancy}
%\setlength{\headheight}{10pt}
%\fancyheadoffset{\textwidth}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\newcommand{\op@boiteentete}{\makebox[0pt][l]{\hspace*{-3ex}%
\color{bgentete}\rule[-0.8ex]{\textwidth-5ex}{3ex}%
}}
\lhead{\scriptsize\op@boiteentete \@title}
\chead{}
\rhead{\scriptsize\@date}
\lfoot{\scriptsize\op@boiteentete \op@subtitle}
\cfoot{}
\rfoot{\scriptsize\thepage\ / \pageref{LastPage}}
\fancypagestyle{plain}{ %
\fancyhf{} % remove everything
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}
\lfoot{\scriptsize\op@boiteentete \op@subtitle}
\cfoot{}
\rfoot{\scriptsize\thepage\ / \pageref{LastPage}}
}

82
tools/style/notbeamer.sty Executable file
View File

@ -0,0 +1,82 @@
\NeedsTeXFormat{LaTeX2e}
% Pour gérer les todo
\RequirePackage[french]{todonotes}
\newcounter{afaire}
\newcommand{\afaire}[2][]{%
% initials of the author (optional) + note in the margin
\refstepcounter{afaire}%
{%
%\setstretch{0.7}% spacing
\todo[inline,#1]{%
\textbf{À faire au crayon à papier:}~#2}%
}}
\newcounter{envideo}
\newcommand{\envideo}[3][]{%
% initials of the author (optional) + note in the margin
\refstepcounter{envideo}%
{%
%\setstretch{0.7}% spacing
\todo[inline,backgroundcolor=green,#1]{%
\textbf{Voir la vidéo}~ #3
\begin{minipage}{0.2\linewidth}
\qrcode{#2}
\end{minipage}
\begin{minipage}{0.8\linewidth}
\url{#2}
\end{minipage}
}%
}}
\newcounter{enclasse}
\newcommand{\enclasse}[2][]{%
% initials of the author (optional) + note in the margin
\refstepcounter{enclasse}%
{%
%\setstretch{0.7}% spacing
\todo[inline,backgroundcolor=green,#1]{%
\textbf{Sera complété en classe}~#2}%
}}
\newcounter{arediger}
\newcommand{\arediger}[2][]{%
% initials of the author (optional) + note in the margin
\refstepcounter{afaire}%
{%
%\setstretch{0.7}% spacing
\todo[inline,#1]{%
\textbf{À rédiger et m'envoyer par mail:}~#2}%
}}
\usepackage[tikz]{bclogo}
% Environnements théoreme, définition ...
\newenvironment{encadre}[1]
{
\begin{bclogo}[barre=none, arrondi=0.1, logo=]{#1}
}{
\end{bclogo}
}
\newcounter{doc}
\newenvironment{doc}[1]
{\refstepcounter{doc}
\begin{encadre}{Document \thedoc: #1}
}{
\end{encadre}
}
\newenvironment{definition}[1][]
{
\begin{encadre}{Définition: #1}
}{
\end{encadre}
}
\newenvironment{propriete}[1][]
{
\begin{encadre}{Propriété: #1}
}{
\end{encadre}
}

3542
tools/style/qrcode.dtx Normal file

File diff suppressed because it is too large Load Diff

57
tools/style/qrcode.ins Normal file
View File

@ -0,0 +1,57 @@
%% qrcode.ins
%% Copyright 2015 by Anders O.F. Hendrickson
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Anders O.F. Hendrickson.
%%
%% This work consists of the files qrcode.dtx and qrcode.ins
%% and the derived file qrcode.sty.
\input docstrip.tex
\keepsilent
\usedir{tex/latex/qrcode}
\preamble
This is a generated file.
Copyright (C) 2015 by Anders Hendrickson <ahendric@cord.edu>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of LaTeX
version 2005/12/01 or later.
\endpreamble
\generate{\file{qrcode.sty}{\from{qrcode.dtx}{package}}}
\obeyspaces
\Msg{*************************************************************}
\Msg{* *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* file into a directory searched by TeX: *}
\Msg{* *}
\Msg{* qrcode.sty *}
\Msg{* *}
\Msg{* To produce the documentation run the file qrcode.dtx *}
\Msg{* through LaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
\Msg{*************************************************************}
\endbatchfile

3051
tools/style/qrcode.sty Normal file

File diff suppressed because it is too large Load Diff

318
tools/style/shortcuts.sty Executable file
View File

@ -0,0 +1,318 @@
\NeedsTeXFormat{LaTeX2e}
%%%%%%%%%%%%%%%%%
% Raccourcis %
%%%%%%%%%%%%%%%%%
% Displaystyle
\newcommand{\ds}{\displaystyle}
% Ensembles
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
%\newcommand{\D}{\mathbb{D}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
% intervalles ouvert ouvert
\newcommand{\intOO}[2]{\left]{#1}\,{;}\,{#2}\right[}
% intervalles ouvert fermé
\newcommand{\intOF}[2]{\left]{#1}\,{;}\,{#2}\right]}
% intervalles fermé ouvert
\newcommand{\intFO}[2]{\left[{#1}\,{;}\,{#2}\right[}
% intervalles fermé fermé
\newcommand{\intFF}[2]{\left[{#1}\,{;}\,{#2}\right]}
%% Vecteurs
% représentation d'un vecteur
\newcommand{\vect}[1]{\overrightarrow{#1}}
% Norme d'un vecteur
\newcommand{\norme}[1]{||\vect{#1}||}
% Produit scalaire
\newcommand{\scal}[2]{\vect{#1} \cdot \vect{#2}}
\newcommand{\vectCoord}[2]{%
{\renewcommand{\arraystretch}{1}%
\left(\begin{array}{c} #1 \\ #2 \end{array} \right)%
}%
}
% Les complexes
\def\Ouv{$\left(\text{O}~;~\vect{u},~\vect{v}\right)$}
\newcommand{\e}{\mathrm{\,e\,}}% le e de l'exponentielle
%\renewcommand{\i}{\mathrm{\,i\,}}% le i des complexes
%% Proba
\newcommand{\coefBino}[2]{\vectCoord{#1}{#2}}
%% Logique
\renewcommand{\equiv}{\Leftrightarrow}
%% Calculatrice
\usepackage{listings}
\newcommand{\calc}[1]{\Ovalbox{\lstinline|#1|}}
%\newcommand{\calc}[1]{\verb!#1!}
%% Autres
\newcommand{\TODO}[1]{\textcolor{red}{note(#1)}}
% Difficulté
\usepackage{fontawesome5}
\newcommand{\dure}{(\faBolt) }
\newcommand{\superDure}{(\faBioHazard) }
% Icones
\newcommand{\icon}[2][scale=0.4]{%
\includegraphics[#1]{icons/#2.png}%
}
% Icones des compétences
\newcommand{\iconScale}{0.3}
\newcommand{\Cher}[1][scale=\iconScale]{%
\icon[#1]{card-pick}
}
\newcommand{\Mod}[1][scale=\iconScale]{%
\icon[#1]{processor}
}
\newcommand{\Rep}[1][scale=\iconScale]{%
\icon[#1]{chart}
}
\newcommand{\Rai}[1][scale=\iconScale]{%
\icon[#1]{brain}
%\icon[#1]{gears}
}
\newcommand{\Cal}[1][scale=\iconScale]{%
\icon[#1]{computing}
}
\newcommand{\Com}[1][scale=\iconScale]{%
\icon[#1]{conversation}
}
\newcommand{\Con}[1][scale=\iconScale]{%
\icon[#1]{book-cover}
}
% Pour l'évaluation par compétence
\usepackage{tikzsymbols}
\usetikzlibrary{babel, shapes, snakes}
\RequirePackage{xstring}
\newcommand{\RepLevel}[1]{%
\IfEqCase{#1}{%
{.}{\Xey[2]}%
{0}{\Changey[2]{-1}}%
{1}{\Changey[2][black!20]{0}}%
{2}{\Changey[2][black!40]{1}}%
{3}{\Cooley[2][black!60]}%
}[\PackageError{Rep}{Undefinded type of answer: #1}{}]%
}
\newcommand{\RepT}{\Cooley[2][black!70]}
\newcommand{\RepD}{\Changey[2][black!40]{1}}
\newcommand{\RepU}{\Changey[2][black!10]{0}}
\newcommand{\RepZ}{\Changey[2]{-1}}
\newcommand{\NoRep}{\Xey[2]}
\newcommand{\EmptySignalBar}{%
\draw (0, 0) rectangle ++(0.8, 1);
\draw (1, 0) rectangle ++(0.8, 2);
\draw (2, 0) rectangle ++(0.8, 3);
\draw (3, 0) rectangle ++(0.8, 4);
}
\newcommand{\filledSignalBar}[1]{%
\IfEqCase{#1}{%
{}{%
}
{e}{%
\EmptySignalBar
}
{3}{%
\EmptySignalBar
\filldraw[fill=green] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=green] (1, 0) rectangle ++(0.8, 2);
\filldraw[fill=green] (2, 0) rectangle ++(0.8, 3);
\filldraw[fill=green] (3, 0) rectangle ++(0.8, 4);
}
{2}{%
\EmptySignalBar
\filldraw[fill=green] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=green] (1, 0) rectangle ++(0.8, 2);
\filldraw[fill=green] (2, 0) rectangle ++(0.8, 3);
}
{1}{%
\EmptySignalBar
\filldraw[fill=yellow] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=yellow] (1, 0) rectangle ++(0.8, 2);
}
{0}{%
\EmptySignalBar
\filldraw[fill=red] (0, 0) rectangle ++(0.8, 1);
}
}[\PackageError{Assesment}{Undefinded type of answer: #1}{}]%
}
\newcommand{\SignalBar}[1]{%
\begin{tikzpicture}[scale=0.15]
\filledSignalBar{#1}
\end{tikzpicture}
}
\newcommand{\Assesment}[1]{%
\SignalBar{#1}
\IfEqCase{#1}{%
{3}{%
Très bonne maîtrise%
}%
{2}{%
Maîtrise satisfaisante
}%
{1}{%
Maîtrise fragile%
}%
{0}{%
Maîtrise insufisante%
}%
}[\PackageError{Assesment}{Undefinded type of answer: #1}{}]%
}
\newcommand{\competencesStatement}{%
\begin{multicols}{3}
\noindent
Nom: \dotfill \\[0.5cm]
Prénom: \dotfill \\
\vfill\none
\columnbreak
\noindent
\Cher Chercher \hfill \SignalBar{e}\\
\Mod Modélser \hfill \SignalBar{e}\\
\Rep Représenter \hfill \SignalBar{e}\\
\vfill\none
\columnbreak
\noindent
\Rai Raisonner \hfill \SignalBar{e}\\
\Cal Calculer \hfill \SignalBar{e}\\
\Com Communiquer \hfill \SignalBar{e}\\
\end{multicols}
}
% ##########################
% Tikz shortcuts
% ##########################
% Les dessins
\RequirePackage{tikz}
%% le cercle trigo
\newcommand{\cercleTrigo}%
{%
\draw[->, very thick] (-1.1,0) -- (1.1, 0);
\draw[->, very thick] (0,-1.1) -- (0,1.1);
\draw[very thick] (0,0) circle (1);
\draw (0,0) node[below left] {$O$};
\draw (1,0) node[below right] {$I$};
\draw (0,1) node[above left] {$J$};
}
\newcommand{\cercleTrigoNoOIJ}%
{%
\draw[->, very thick] (-1.1,0) -- (1.1, 0);
\draw[->, very thick] (0,-1.1) -- (0,1.1);
\draw[very thick] (0,0) circle (1);
}
%% Le repère orthonormé avec la grille
%%% \repere{xmin}{xmax}{ymin}{ymax}
\newcommand{\repere}[4]%
{%
\draw[very thin, gray] (#1,#3) grid (#2,#4);
\draw[->, very thick] (#1,0) -- (#2,0);
\draw[->, very thick] (0,#3) -- (0,#4);
\draw (0,0) node[below left] {$O$};
\draw (1, 0) node [below left] {1};
\draw (0, 1) node [below left] {1};
}
\newcommand{\repereOIJ}[4]%
{%
\draw[very thin, gray] (#1,#3) grid (#2,#4);
\draw[->, very thick] (#1,0) -- (#2,0);
\draw[->, very thick] (0,#3) -- (0,#4);
\draw (0,0) node[below left] {$O$};
\draw[->, very thick] (0, 0) -- node [below, midway] {$\vect{i}$} (1, 0);
\draw[->, very thick] (0, 0) -- node [left, midway] {$\vect{j}$} (0, 1);
}
\newcommand{\repereNoGrid}[4]%
{%
\draw[->, very thick] (#1,0) -- (#2,0);
\draw[->, very thick] (0,#3) -- (0,#4);
}
%% Diagramme boite
%%% \boxplot{Vertical Center}{min}{Q1}{Me}{Q3}{Max}
\newcommand{\boxplot}[6]%
{%
\filldraw[color=highlightbg, draw=text] (#3, {#1 - 0.5}) rectangle (#5, {#1 + 0.5});
\draw (#2, {#1 - 0.5}) -- (#2, {#1 + 0.5}) node[above] {$Min$};
\draw (#3, {#1 - 0.5}) -- (#3, {#1 + 0.5}) node[above] {$Q_1$};
\draw (#4, {#1 - 0.5}) -- (#4, {#1 + 0.5}) node[above] {$Me$};
\draw (#5, {#1 - 0.5}) -- (#5, {#1 + 0.5}) node[above] {$Q_3$};
\draw (#6, {#1 - 0.5}) -- (#6, {#1 + 0.5}) node[above] {$Max$};
\draw (#2, #1) -- (#3, #1);
\draw (#5, #1) -- (#6, #1);
%\draw ({(#2 +#3)/2}, #1) node[above] {25\%};
%\draw ({(#3 +#4)/2}, #1) node[above] {25\%};
%\draw ({(#4 +#5)/2}, #1) node[above] {25\%};
%\draw ({(#5 +#6)/2}, #1) node[above] {25\%};
}
\newcommand{\boxplotNoNames}[6]%
{%
\filldraw[color=highlightbg, draw=text] (#3, {#1 - 0.5}) rectangle (#5, {#1 + 0.5});
\draw (#2, {#1 - 0.5}) -- (#2, {#1 + 0.5});
\draw (#3, {#1 - 0.5}) -- (#3, {#1 + 0.5});
\draw (#4, {#1 - 0.5}) -- (#4, {#1 + 0.5});
\draw (#5, {#1 - 0.5}) -- (#5, {#1 + 0.5});
\draw (#6, {#1 - 0.5}) -- (#6, {#1 + 0.5});
\draw (#2, #1) -- (#3, #1);
\draw (#5, #1) -- (#6, #1);
}
\usetikzlibrary{quotes,arrows.meta}
\tikzset{
% drawing parallelepipoid
annotated cuboid/.pic={
\tikzset{%
every edge quotes/.append style={midway, auto},
/cuboid/.cd,
#1
}
\draw [every edge/.append style={pic actions, densely dashed, opacity=.5}, pic actions]
(0,0,0) coordinate (o) -- ++(-\cubescale*\cubex,0,0) coordinate (a) -- ++(0,-\cubescale*\cubey,0) coordinate (b) edge coordinate [pos=1] (g) ++(0,0,-\cubescale*\cubez) -- ++(\cubescale*\cubex,0,0) coordinate (c) -- cycle
(o) -- ++(0,0,-\cubescale*\cubez) coordinate (d) -- ++(0,-\cubescale*\cubey,0) coordinate (e) edge (g) -- (c) -- cycle
(o) -- (a) -- ++(0,0,-\cubescale*\cubez) coordinate (f) edge (g) -- (d) -- cycle;
\path [every edge/.append style={pic actions, |-|}]
(b) +(0,-5pt) coordinate (b1) edge ["\cubex \cubeunits"'] (b1 -| c)
(b) +(-5pt,0) coordinate (b2) edge ["\cubey \cubeunits"] (b2 |- a)
(c) +(3.5pt,-3.5pt) coordinate (c2) edge ["\cubez \cubeunits"'] ([xshift=3.5pt,yshift=-3.5pt]e)
;
},
/cuboid/.search also={/tikz},
/cuboid/.cd,
width/.store in=\cubex,
height/.store in=\cubey,
depth/.store in=\cubez,
units/.store in=\cubeunits,
scale/.store in=\cubescale,
width=10,
height=10,
depth=10,
units=cm,
scale=.1,
}