From 5f9b7f408512052059bb4cecffc77946de36e634 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 7 Aug 2020 18:04:18 +0200 Subject: [PATCH] =?UTF-8?q?Feat:=20D=C3=A9but=20de=20l'ann=C3=A9e!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 22 +++ README.md | 33 ++++ config.fish | 13 ++ index.rst | 10 ++ tools/README.rst | 20 +++ tools/git/hooks/pre-commit | 143 ++++++++++++++++ tools/style/base.sty | 74 +++++++++ tools/style/code.sty | 47 ++++++ tools/style/colorscheme.sty | 51 ++++++ tools/style/myXsim.sty | 139 ++++++++++++++++ tools/style/myhdr.sty | 102 ++++++++++++ tools/style/none_beamer.sty | 8 + tools/style/shortcuts.sty | 317 ++++++++++++++++++++++++++++++++++++ 13 files changed, 979 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100755 config.fish create mode 100644 index.rst create mode 100644 tools/README.rst create mode 100755 tools/git/hooks/pre-commit create mode 100755 tools/style/base.sty create mode 100755 tools/style/code.sty create mode 100755 tools/style/colorscheme.sty create mode 100644 tools/style/myXsim.sty create mode 100644 tools/style/myhdr.sty create mode 100755 tools/style/none_beamer.sty create mode 100755 tools/style/shortcuts.sty diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f4cd15e --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +CLEUSB=Cle8G + +COMMON_EXCLUDE=--exclude "__pycache__" --exclude "venv/" --exclude ".git" --exclude ".gitignore" --exclude ".*" + +install: + git config core.hooksPath ./tools/git/hooks/ + python -m venv ~/.venv/enseignements/ + source ~/.venv/enseignements/bin/activate.fish + pip install -r requirements.txt + +clean: + git clean -idx -e venv/ -e video/ + +rsync_cleUSB: clean + #rsync --progress --modify-window=1 --update --recursive --times --del ./ $(GIT_EXCLUDE) /run/media/lafrite/K1 + rsync -av --del --exclude "venv" ./ $(COMMON_EXCLUDE) /run/media/lafrite/$(CLEUSB)/Enseignements + rsync -av ../../Divers/ /run/media/lafrite/$(CLEUSB)/Divers + rsync -av ../../Production\ eleves/ /run/media/lafrite/$(CLEUSB)/Productions/ + + # rsync -av /run/media/lafrite/$(CLEUSB)/Productions/$(YEAR) ../../Production\ eleves/ + +.PHONY: diff --git a/README.md b/README.md new file mode 100644 index 0000000..f18e47c --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# Cours pour l'année 2019-2020 + +[![Build Status](https://drone.opytex.org/api/badges/lafrite/2020-2021/status.svg)](https://drone.opytex.org/lafrite/2020-2021) + +## Quand on arrive + +- Avec fish +``` console +source venv/bin/activate.fish +``` + +- Avec un autre shell +``` console +source venv/bin/activate +``` + + +## Mise en place + +- Python + +``` console +python -v venv venv +pip install -r requirements.txt +``` + +- Git + +Changement du répertoire des hameçons de git pour écrire de plus propres fichiers rst! + +``` console +git config core.hooksPath ./tools/git/hooks/ +``` diff --git a/config.fish b/config.fish new file mode 100755 index 0000000..82c81c0 --- /dev/null +++ b/config.fish @@ -0,0 +1,13 @@ +#!/bin/bash + +set -x ROOT (pwd) + +set -x TEXINPUTS ".:$ROOT/tools/style//::" + +function goroot + cd $ROOT +end + +# activate virtual env +. ~/.venv/enseignements/bin/activate.fish + diff --git a/index.rst b/index.rst new file mode 100644 index 0000000..a9bcb81 --- /dev/null +++ b/index.rst @@ -0,0 +1,10 @@ +Année 2020-2021 au Lycée de Bellegarde sur Valserhône +##################################################### + +:date: 2020-08-07 +:modified: 2020-08-07 +:authors: Bertrand Benjamin +:category: Autres +:summary: Deuxième année au lycée Saint Exupery de Bellegarde + + diff --git a/tools/README.rst b/tools/README.rst new file mode 100644 index 0000000..02c6287 --- /dev/null +++ b/tools/README.rst @@ -0,0 +1,20 @@ +Logique et organisation des styles Latex +######################################## + +:date: 2020-08-07 +:modified: 2020-08-07 +:tags: Outils +:category: Autres +:authors: Bertrand Benjamin +:summary: Explications autour des classes latex utilisées. + + +Pour profiter des classes +------------------------- + + export TEXINPUTS=".:/chemin/vers/fichiers/tools/style//::" + + + + + diff --git a/tools/git/hooks/pre-commit b/tools/git/hooks/pre-commit new file mode 100755 index 0000000..699652b --- /dev/null +++ b/tools/git/hooks/pre-commit @@ -0,0 +1,143 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 +# +# Copyright © 2017 lafrite +# +# Distributed under terms of the MIT license. + +""" +Git hook to ensure validity of all rst files +""" + +from git import Repo +from path 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] + +# 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) + 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 diff --git a/tools/style/base.sty b/tools/style/base.sty new file mode 100755 index 0000000..e5ca1c4 --- /dev/null +++ b/tools/style/base.sty @@ -0,0 +1,74 @@ +\NeedsTeXFormat{LaTeX2e} + +% extensions +\RequirePackage[utf8x]{inputenc} +\RequirePackage[french]{babel} +\RequirePackage[T1]{fontenc} +\RequirePackage{amssymb} +\RequirePackage{amsmath} +\RequirePackage{amsfonts} +\PassOptionsToPackage{table,usenames,dvipsnames}{xcolor} +%\RequirePackage{subfig} +\RequirePackage{graphicx} +\graphicspath{{./}{\string~/.Clipart/}} + +\RequirePackage{gensymb} +\RequirePackage{ifthen, calc} +\RequirePackage{tabularx} + +% Marges des pages +\RequirePackage{geometry} +\geometry{left=10mm,right=10mm, top=10mm} + +% Symbole euro +\RequirePackage{eurosym} + +% Faire des boites +\RequirePackage{fancybox} + +% 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{scratch} + +% Pour gérer les todo +% \RequirePackage[french, textsize=small]{todonotes} + +% 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 +%% l'option nomath fait que la police du mode mathématique n'est pas affectée +\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} + + diff --git a/tools/style/code.sty b/tools/style/code.sty new file mode 100755 index 0000000..7d1f85f --- /dev/null +++ b/tools/style/code.sty @@ -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{green}, % 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{blue}, % keyword style + language=Octave, % 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{mygray}, % 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{blue}, + 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 +} diff --git a/tools/style/colorscheme.sty b/tools/style/colorscheme.sty new file mode 100755 index 0000000..1951b9a --- /dev/null +++ b/tools/style/colorscheme.sty @@ -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} diff --git a/tools/style/myXsim.sty b/tools/style/myXsim.sty new file mode 100644 index 0000000..436dcd3 --- /dev/null +++ b/tools/style/myXsim.sty @@ -0,0 +1,139 @@ +\NeedsTeXFormat{LaTeX2e} +% extensions + +\RequirePackage{colorscheme} +\RequirePackage{base} +\RequirePackage{myhdr} +\RequirePackage{hyperref} + +\RequirePackage{enumitem} +\setlist[itemize,1]{label=$\bullet$} + +% 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}% + {% + %\setstretczh{0.7}% spacing + \todo[inline,backgroundcolor=green,#1]{% + \textbf{Voir la vidéo}~\href{#2}{#3}}% +}} +\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}% +}} + +\RequirePackage{geometry} +%\geometry{landscape} +\geometry{left=15mm,right=15mm, bottom= 15mm, top=15mm} + +%\firstpageheader{\op@boiteentete\small\scshape\op@entete}{}{\small\op@typedoc \op@titre} % Header de la première page + + +%\setlength{\oddsidemargin}{0in} % default=0in +%\setlength{\textwidth}{9in} % default=9in + +\setlength{\columnsep}{30pt} % default=10pt +\setlength{\columnseprule}{1pt} % default=0pt (no line) + +%\setlength{\textheight}{5.85in} % default=5.15in +%\setlength{\topmargin}{-0.40in} % default=0.20in +%\setlength{\headsep}{0.35in} % default=0.35in + + +%\renewcommand{\op@entete}{\op@classe} + + +%\RequirePackage{xsim} +\RequirePackage[no-files]{xsim} + +\DeclareExerciseTagging{step} + +\DeclareExerciseTranslations{total}{ + French = total , +} + +\DeclareExerciseEnvironmentTemplate{exo}{% + \subsection* + {% + \color{exercise}{\XSIMmixedcase{\GetExerciseName}}\nobreakspace + \GetExerciseProperty{counter}% + \hspace{0.5cm} \color{line}\hrulefill \hspace{0.5cm} + \color{exercise} + \IfInsideSolutionF + {% + \GetExercisePropertyT{subtitle} + {{\PropertyValue}}% + \GetExercisePropertyT{points} + {{(/\PropertyValue})}% + }% + \noindent + } +}{} +\xsimsetup{exercise/template=exo} + +\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}% + }% +} + diff --git a/tools/style/myhdr.sty b/tools/style/myhdr.sty new file mode 100644 index 0000000..fa74559 --- /dev/null +++ b/tools/style/myhdr.sty @@ -0,0 +1,102 @@ +\NeedsTeXFormat{LaTeX2e} +% extensions + +\RequirePackage{colorscheme} +\RequirePackage{lastpage} + +\RequirePackage{fancyhdr} + +% Definition etc +\RequirePackage{amsthm} +\newtheorem*{definition}{Définition} +\newtheorem*{Remarque}{Remarque} + +\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}} +} diff --git a/tools/style/none_beamer.sty b/tools/style/none_beamer.sty new file mode 100755 index 0000000..4baa28a --- /dev/null +++ b/tools/style/none_beamer.sty @@ -0,0 +1,8 @@ +\NeedsTeXFormat{LaTeX2e} + +% Les listes +\RequirePackage{enumerate} +\RequirePackage{enumitem} +\setlist[itemize,1]{label=$\bullet$} + + diff --git a/tools/style/shortcuts.sty b/tools/style/shortcuts.sty new file mode 100755 index 0000000..a94a01b --- /dev/null +++ b/tools/style/shortcuts.sty @@ -0,0 +1,317 @@ +\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 +\renewcommand{\vec}[1]{\overrightarrow{#1}} +% Norme d'un vecteur +\newcommand{\norme}[1]{||\vec{#1}||} +% Produit scalaire +\newcommand{\scal}[2]{\vec{#1} \cdot \vec{#2}} +\newcommand{\vectCoord}[2]{% + {\renewcommand{\arraystretch}{1}% + \left(\begin{array}{c} #1 \\ #2 \end{array} \right)% + }% +} + +% Les complexes +\def\Ouv{$\left(\text{O}~;~\vec{u},~\vec{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)}} + +%% Poser des opérations +% \RequirePackage[letterspace=500]{microtype} +% \newcommand{\poseOP}[3]{% +% \textls{ +% $\begin{array}{cr} +% & #1 \\[-0.3cm] +% #2 & #3 \\ +% \hline +% & +% \end{array}$} +% } + +% 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} + +\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 [->] (0,0) -- (0,1) node[left] {$J$}; + \draw [->] (0,0) -- (1,0) node[below] {$I$}; + %\draw (1,0) node[rotate=90] {-} node[below] {$I$}; + } +\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, +} +