parent
97ffa1ba43
commit
45f3b32036
@ -1,11 +1,14 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
|
||||
Everyone is permitted to copy and distribute verbatim or modified copies of
|
||||
this license document, and changing it is allowed as long as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
@ -0,0 +1 @@
|
||||
graft documentex/templates
|
@ -1,2 +1,10 @@
|
||||
# documentex
|
||||
# Documentex
|
||||
|
||||
Permet de créer facilement des répertoires latex
|
||||
|
||||
## Contributions
|
||||
|
||||
Toute contribution est la bienvenue, et peut m'être adressée à l'adresse <math@denoncin.fr>
|
||||
|
||||
## Licence
|
||||
[WTFPL](http://www.wtfpl.net/)
|
||||
|
@ -0,0 +1,14 @@
|
||||
## TODO
|
||||
|
||||
Passer en options toutes les chaînes de caractères naturellement initialisées à ""
|
||||
|
||||
Faire une documentation correcte...
|
||||
|
||||
Types de documents :
|
||||
- Document classique : demander les en-têtes
|
||||
- Compte-rendu de kholle
|
||||
- Compte-rendu d'oral blanc
|
||||
- Document classique pédagogique : remplir les en-têtes
|
||||
- Problème : remplir les en-têtes et le fichier
|
||||
- DS : remplir les en-têtes et le fichier
|
||||
- Interro de cours
|
@ -0,0 +1,20 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = .
|
||||
BUILDDIR = _build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@ -0,0 +1,70 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
# import os
|
||||
# import sys
|
||||
# sys.path.insert(0, '/home/david/dev/dev_python_packaging/documentex/documentex')
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'documentex'
|
||||
copyright = '2020, Author'
|
||||
author = 'Author'
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinx.ext.todo',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = 'en'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'alabaster'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
|
||||
# -- Extension configuration -------------------------------------------------
|
||||
|
||||
# -- Options for todo extension ----------------------------------------------
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
@ -0,0 +1,46 @@
|
||||
documentex package
|
||||
==================
|
||||
|
||||
Submodules
|
||||
----------
|
||||
|
||||
documentex.constantes\_document\_latex module
|
||||
---------------------------------------------
|
||||
|
||||
.. automodule:: documentex.constantes_document_latex
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
documentex.documentex module
|
||||
----------------------------
|
||||
|
||||
.. automodule:: documentex.documentex
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
documentex.lib\_annee\_scolaire module
|
||||
--------------------------------------
|
||||
|
||||
.. automodule:: documentex.lib_annee_scolaire
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
documentex.lib\_nettoyage\_argv module
|
||||
--------------------------------------
|
||||
|
||||
.. automodule:: documentex.lib_nettoyage_argv
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
|
||||
Module contents
|
||||
---------------
|
||||
|
||||
.. automodule:: documentex
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
@ -0,0 +1,21 @@
|
||||
.. documentex documentation master file, created by
|
||||
sphinx-quickstart on Mon May 25 20:36:48 2020.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to documentex's documentation!
|
||||
======================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
:caption: Contents:
|
||||
|
||||
documentex
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
@ -0,0 +1,35 @@
|
||||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set SOURCEDIR=.
|
||||
set BUILDDIR=_build
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
|
||||
:end
|
||||
popd
|
@ -0,0 +1 @@
|
||||
from documentex.documentex import *
|
@ -0,0 +1,136 @@
|
||||
"""
|
||||
Ce fichier initialise les variables utilisées ailleurs dans le programme
|
||||
et en permet la personnalisation simple
|
||||
"""
|
||||
|
||||
import os
|
||||
import jinja2
|
||||
|
||||
"""
|
||||
Nom du programme
|
||||
"""
|
||||
softname = 'documentex'
|
||||
|
||||
"""
|
||||
Version du programme
|
||||
"""
|
||||
version = '2.0'
|
||||
|
||||
"""
|
||||
Variable de debuggage
|
||||
"""
|
||||
debug = False
|
||||
|
||||
"""
|
||||
Constantes customisant l'en-tête des fichiers LaTeX et remplies automatiquement
|
||||
"""
|
||||
classe_appartenance = "PT"
|
||||
lycee_appartenance = "Lycée Langevin Wallon"
|
||||
institution = "Lycée"
|
||||
nom_institution = "Langevin Wallon"
|
||||
lycee_adresse = "126 avenue Roger Salengro"
|
||||
lycee_complement_adresse = "Champigny-sur-Marne, 94240"
|
||||
auteur = "D. Denoncin" # est mise d'office sur tout type de document
|
||||
auteur_lettre = "Dr. David Denoncin"
|
||||
auteur_titre = "Professeur Agrégé"
|
||||
auteur_adresse_mail = "math@denoncin.fr"
|
||||
|
||||
"""Dictionnaire paramétrant les types de documents de la façon suivante :
|
||||
dictionnaire_type_document[type_document] = [contenu : affiche-t-on un contenu ? (True ou False),
|
||||
td : numérote-t-on les exercices ? ('' ou '*'),
|
||||
fancyhead : doit-on afficher un header avec un titre court ? (True ou False),
|
||||
appartenance : doit-on afficher l'appartenance classe/lycée ? (True ou False),
|
||||
]
|
||||
"""
|
||||
dictionnaire_type_document = {'ds': [False, '', True, True],
|
||||
'td': [False, '', True, True],
|
||||
'dm': [False, '*', True, True],
|
||||
'pb': [False, '*', True, True],
|
||||
'te': [False, '*', True, True],
|
||||
'kh': [False, '', False, True],
|
||||
'cours': [True, '*', True, True],
|
||||
'in': [False, '*', True, True],
|
||||
'cr': [False, '*', False, True],
|
||||
'ob': [False, '*', False, True],
|
||||
'doc': [False, '', False, False],
|
||||
'let': [False, '', False, True], # Lettre de motivation
|
||||
}
|
||||
|
||||
|
||||
"""
|
||||
Types de documents pour lesquels il faut créer un sous-dossier pour la correction
|
||||
"""
|
||||
type_document_correction = ['ds', 'dm', 'pb']
|
||||
|
||||
"""
|
||||
Dictionnaire paramétrant les abréviations pour les numéros de DS (limité à 10 DS)
|
||||
"""
|
||||
dictionnaire_numero_ds = {'01': 'Première',
|
||||
'02': 'Deuxième',
|
||||
'03': 'Troisième',
|
||||
'04': 'Quatrième',
|
||||
'05': 'Cinquième',
|
||||
'06': 'Sixième',
|
||||
'07': 'Septième',
|
||||
'08': 'Huitième',
|
||||
'09': 'Neuvième',
|
||||
'10': 'Dixième',
|
||||
}
|
||||
|
||||
"""
|
||||
Paramétrage des templates jinja
|
||||
"""
|
||||
latex_jinja_env = jinja2.Environment(
|
||||
block_start_string="\BLOCK{",
|
||||
block_end_string="}",
|
||||
variable_start_string="\VAR{",
|
||||
variable_end_string="}",
|
||||
comment_start_string="\#{",
|
||||
comment_end_string="}",
|
||||
line_statement_prefix="%%",
|
||||
line_comment_prefix="%#",
|
||||
trim_blocks=True,
|
||||
autoescape=False,
|
||||
loader=jinja2.FileSystemLoader("/")
|
||||
)
|
||||
jinja_template_dir = "templates"
|
||||
tex_file = "example.tex"
|
||||
|
||||
|
||||
"""
|
||||
Pour mémoire : les variables à initialiser pour un compte rendu de colle
|
||||
"""
|
||||
|
||||
|
||||
def initialiser_variables():
|
||||
title = ''
|
||||
semaine = ''
|
||||
nom1 = ''
|
||||
nom2 = ''
|
||||
nom3 = ''
|
||||
return [title, semaine, nom1, nom2, nom3]
|
||||
|
||||
|
||||
"""
|
||||
Numéro de fichiers admissibles (est-ce vraiment utile ??)
|
||||
"""
|
||||
numeros_admissibles = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'] + [str(i) for i in range(10, 200)]
|
||||
|
||||
"""
|
||||
Ces variables permettent de déterminer quelle est l'année scolaire en cours pour lequel le fichier est généré, expire en 2070 (?)
|
||||
"""
|
||||
annee_scolaire = ['09', '10', '11', '12', '01', '02', '03', '04', '05', '06'] # mois d'une année scolaire donnée
|
||||
annee_scolaire_plus_un = ['01', '02', '03', '04', '05', '06']
|
||||
annee_scolaire_en_cours = ['07', '08', '09', '10', '11', '12']
|
||||
annees_valables = [str(i) for i in range(2018, 2070)]
|
||||
|
||||
|
||||
"""
|
||||
Fonctions de validations génériques
|
||||
"""
|
||||
def entier(x):
|
||||
try:
|
||||
int(x)
|
||||
return True
|
||||
except:
|
||||
return "Doit être un entier"
|
@ -0,0 +1,229 @@
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
import glob
|
||||
from jinja2 import Template
|
||||
import shutil
|
||||
from . import constantes_document_latex as constantes
|
||||
from . import lib_annee_scolaire as annee_scolaire
|
||||
import click
|
||||
from PyInquirer.prompt import prompt
|
||||
|
||||
template_dir = constantes.jinja_template_dir
|
||||
|
||||
def validate_dossier(ctx, param, value):
|
||||
if os.path.exists(value):
|
||||
raise click.BadParameter("Le dossier existe déjà !")
|
||||
|
||||
try:
|
||||
if len(value.split("_")) == 2:
|
||||
numero, nom = value.split("_")
|
||||
int(numero)
|
||||
return numero, f"{numero}_{nom}"
|
||||
if len(value.split("_")) == 1:
|
||||
try:
|
||||
int(value)
|
||||
return value, value
|
||||
except:
|
||||
return "", value
|
||||
else:
|
||||
raise click.BadParameter("Le dossion doit être au format numéro_nom ou nom")
|
||||
|
||||
except ValueError:
|
||||
raise click.BadParameter("Le dossier doit être au format nom ou numéro_nom")
|
||||
|
||||
@click.command()
|
||||
@click.argument("dossier", type=click.UNPROCESSED, callback=validate_dossier)
|
||||
@click.argument("type_document", type=click.Choice([key for key in constantes.dictionnaire_type_document]))
|
||||
def documentex(dossier: str, type_document: str):
|
||||
"""
|
||||
Entrée:
|
||||
|
||||
-------
|
||||
|
||||
dossier : chaîne de caractère spécifiant le nom du dossier à créer
|
||||
type_document : chaîne de caractère spécifiant le type de document à créer
|
||||
|
||||
Sortie :
|
||||
|
||||
--------
|
||||
|
||||
Aucune. On crée dans le dossier $dossier tous les fichiers d'en-tête LaTeX nécessaire en fonction du type de document à créer.
|
||||
|
||||
Exemple :
|
||||
|
||||
---------
|
||||
|
||||
documentex 01_algebre-lineaire td
|
||||
"""
|
||||
|
||||
# Initialisation des variables
|
||||
# contenu,tex_file,fancyhead,type_document,short_title,lycee,classe,title,auteur,semaine,liste_noms,td,ds_numero,annee
|
||||
date = datetime.now().strftime("%Y-%m-%d")
|
||||
title = ""
|
||||
semaine = ""
|
||||
nom1 = ""
|
||||
nom2 = ""
|
||||
nom3 = ""
|
||||
classe = ""
|
||||
lycee = ""
|
||||
ds_numero = ""
|
||||
|
||||
numero, nom_fichier = dossier
|
||||
tex_file = constantes.tex_file # nom du fichier dans lequel on écrit du LaTeX
|
||||
contenu, td, fancyhead, appartenance = constantes.dictionnaire_type_document[type_document]
|
||||
short_title = type_document.upper()+' '+numero
|
||||
auteur = constantes.auteur
|
||||
annee = annee_scolaire.annee_scolaire()
|
||||
institution = constantes.institution
|
||||
nom_institution = constantes.nom_institution
|
||||
lycee_adresse = constantes.lycee_adresse
|
||||
lycee_complement_adresse = constantes.lycee_complement_adresse
|
||||
auteur_lettre = constantes.auteur_lettre
|
||||
auteur_titre = constantes.auteur_titre
|
||||
auteur_adresse_mail = constantes.auteur_adresse_mail
|
||||
|
||||
|
||||
if appartenance:
|
||||
classe = constantes.classe_appartenance
|
||||
lycee = constantes.lycee_appartenance
|
||||
|
||||
# Initialisation des variables suivant le type d'écrit
|
||||
if contenu:
|
||||
questions = [
|
||||
{
|
||||
"type": "input",
|
||||
"name": "title",
|
||||
"message": "Titre LONG du document",
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"name": "short_title",
|
||||
"message": "Titre COURT du document",
|
||||
}
|
||||
]
|
||||
answers = prompt(questions)
|
||||
title = answers["title"]
|
||||
short_title = answers["short_title"]
|
||||
if type_document == 'dm':
|
||||
questions = [
|
||||
{
|
||||
"type": "input",
|
||||
"name": "date",
|
||||
"message": "À rendre pour le : ",
|
||||
}
|
||||
]
|
||||
|
||||
short_title += ' : à rendre pour le '
|
||||
answers = prompt(questions)
|
||||
short_title += answers["date"]
|
||||
if type_document == 'cr':
|
||||
questions = [
|
||||
{
|
||||
"type": "list",
|
||||
"name": "lycee",
|
||||
"message": "Nom du lycée",
|
||||
"choices": [
|
||||
"LLW",
|
||||
"Lycée de Cachan",
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "list",
|
||||
"name": "classe",
|
||||
"message": "Nom de la classe",
|
||||
"choices": [
|
||||
"PTSI",
|
||||
"PT*",
|
||||
"PT",
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"name": "semaine",
|
||||
"message": "Numéro de la semaine",
|
||||
"validate": constantes.entier,
|
||||
},
|
||||
|
||||
{
|
||||
"type": "input",
|
||||
"name": "nom1",
|
||||
"message": "Nom du premier candidat",
|
||||
"default": "",
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"name": "nom2",
|
||||
"message": "Nom du deuxième candidat",
|
||||
"default": "",
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"name": "nom3",
|
||||
"message": "Nom du troisième candidat",
|
||||
"default": "",
|
||||
},
|
||||
]
|
||||
answers = prompt(questions)
|
||||
|
||||
lycee = answers["lycee"]
|
||||
classe = answers["classe"]
|
||||
semaine = answers["semaine"]
|
||||
nom1 = answers["nom1"]
|
||||
nom2 = answers["nom2"]
|
||||
nom3 = answers["nom3"]
|
||||
if type_document == 'ob':
|
||||
questions = [
|
||||
{
|
||||
"type": "input",
|
||||
"name": "nom1",
|
||||
"message": "Nom du candidat ",
|
||||
}
|
||||
]
|
||||
answers = prompt(questions)
|
||||
nom1 = answers["nom1"]
|
||||
|
||||
os.mkdir(nom_fichier)
|
||||
os.mkdir(os.path.join(nom_fichier, "Utils"))
|
||||
|
||||
liste_noms = [nom1,
|
||||
nom2,
|
||||
nom3,
|
||||
]
|
||||
tex_file_path = nom_fichier
|
||||
ressource_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)),template_dir) # dossier des templates
|
||||
fichiers = glob.glob(os.path.join(ressource_dir,'*'))
|
||||
fichiers = [fichier for fichier in fichiers if 'Utils' not in fichier ]
|
||||
image = [fichier for fichier in fichiers if 'LW.png' in fichier][0]
|
||||
fichiers.remove(image) #on enlève l'image LW.png des fichiers
|
||||
fichiers_utils = glob.glob(os.path.join(os.path.join(ressource_dir,'Utils'),'*'))
|
||||
|
||||
if type_document in ['ds','let']:
|
||||
shutil.copy(image,os.path.join(tex_file_path,'LW.png'))
|
||||
if type_document == 'ds':
|
||||
ds_numero = constantes.dictionnaire_numero_ds[numero]
|
||||
## attention mettre numéro épreuve (?)
|
||||
|
||||
# Génération des fichiers de base
|
||||
for fichier in fichiers:
|
||||
nom_fichier_a_copier = os.path.basename(fichier)
|
||||
with open(os.path.join(tex_file_path,nom_fichier_a_copier),'w') as outfile:
|
||||
template = constantes.latex_jinja_env.get_template(os.path.abspath(fichier))
|
||||
outfile.write(template.render(date=date,contenu=contenu,tex_file=tex_file,fancyhead=fancyhead,type_ecrit=type_document,short_title=short_title,lycee=lycee,classe=classe,title=title,auteur=auteur,semaine=semaine,liste_noms=liste_noms,td=td,ds_numero=ds_numero,annee=annee,institution=institution,nom_institution=nom_institution,lycee_adresse=lycee_adresse,lycee_complement_adresse=lycee_complement_adresse,auteur_lettre=auteur_lettre,auteur_titre=auteur_titre,auteur_adresse_mail=auteur_adresse_mail))
|
||||
|
||||
# Génération des fichiers Utils
|
||||
for fichier in fichiers_utils:
|
||||
nom_fichier_a_copier = os.path.basename(fichier)
|
||||
with open(os.path.join(os.path.join(tex_file_path,'Utils'),nom_fichier_a_copier),'w') as outfile:
|
||||
template = constantes.latex_jinja_env.get_template(os.path.abspath(fichier))
|
||||
outfile.write(template.render(date=date,contenu=contenu,tex_file=tex_file,fancyhead=fancyhead,type_ecrit=type_document,short_title=short_title,lycee=lycee,classe=classe,title=title,auteur=auteur,semaine=semaine,liste_noms=liste_noms,td=td,ds_numero=ds_numero,annee=annee,institution=institution,nom_institution=nom_institution,lycee_adresse=lycee_adresse,lycee_complement_adresse=lycee_complement_adresse,auteur_lettre=auteur_lettre,auteur_titre=auteur_titre,auteur_adresse_mail=auteur_adresse_mail))
|
||||
# Création du dossier de correction avec les fichiers pré-remplis
|
||||
fichiers = glob.glob(os.path.join(nom_fichier,'*'))
|
||||
fichiers = [fichier for fichier in fichiers if 'Utils' not in fichier ]
|
||||
if type_document in constantes.type_document_correction:
|
||||
os.makedirs(os.path.join(nom_fichier,'Correction'))
|
||||
shutil.copytree(os.path.join(nom_fichier,'Utils'),os.path.join(os.path.join(nom_fichier,'Correction'),'Utils'))
|
||||
for fichier in fichiers:
|
||||
shutil.copy(fichier,os.path.join(nom_fichier,'Correction'))
|
||||
|
||||
click.secho(f"Le dossier LaTeX {nom_fichier} a été crée !", fg="red")
|
@ -0,0 +1,30 @@
|
||||
import datetime
|
||||
from . import constantes_document_latex as constantes
|
||||
|
||||
def annee_scolaire_admissible(annee_scolaire: str) -> bool:
|
||||
"""
|
||||
Entrée :
|
||||
--------
|
||||
annee_scolaire : chaîne de caractère
|
||||
|
||||
Sortie :
|
||||
--------
|
||||
bool : booléen décrivant si la chaîne de caractère est au format aaaa-aaaa+1 avec aaaa une année admissible, et False sinon
|
||||
"""
|
||||
if len(annee_scolaire.split('-')) != 2:
|
||||
return False
|
||||
else:
|
||||
annee_n, annee_n_plus_un = annee_scolaire.split('-')
|
||||
return (int(annee_n) == (int(annee_n_plus_un)-1)) and (annee_n in constantes.annees_valables)
|
||||
|
||||
def annee_scolaire() -> str:
|
||||
"""
|
||||
Sortie :
|
||||
--------
|
||||
str : Retourne l'année scolaire en cours, une nouvelle année démarre en juillet
|
||||
"""
|
||||
year, month = [element for element in datetime.datetime.now().strftime("%Y-%m").split('-')]
|
||||
if month in constantes.annee_scolaire_en_cours:
|
||||
return f"{year}-{int(year)+1}"
|
||||
if month in constantes.annee_scolaire_plus_un:
|
||||
return f"{int(year)-1}-{year}"
|
@ -0,0 +1,14 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified copies of
|
||||
this license document, and changing it is allowed as long as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
@ -0,0 +1,19 @@
|
||||
ifdef utf
|
||||
compilateur = xelatex
|
||||
else
|
||||
compilateur = pdflatex
|
||||
endif
|
||||
|
||||
ifdef sol
|
||||
string = "\def\SOL{}\input{main.tex}"
|
||||
else
|
||||
string = ""
|
||||
endif
|
||||
|
||||
main.pdf: main.tex \VAR{ tex_file } Utils/*
|
||||
$(compilateur) -interaction batchmode $(string) main.tex && $(compilateur) -interaction batchmode $(string) main.tex
|
||||
|
||||
.PHONY : clean
|
||||
|
||||
clean:
|
||||
rm -rf *.log *.aux *.toc *.pdf
|
@ -0,0 +1,19 @@
|
||||
ifdef utf
|
||||
compilateur = xelatex
|
||||
else
|
||||
compilateur = pdflatex
|
||||
endif
|
||||
|
||||
ifdef sol
|
||||
string = "\def\SOL{}\input{main.tex}"
|
||||
else
|
||||
string = ""
|
||||
endif
|
||||
|
||||
main.pdf: main.tex \VAR{ tex_file } Utils/*
|
||||
$(compilateur) $(string) main.tex && $(compilateur) $(string) main.tex
|
||||
|
||||
.PHONY : clean
|
||||
|
||||
clean:
|
||||
rm -rf *.log *.aux *.toc *.pdf
|
@ -0,0 +1,28 @@
|
||||
# Document LaTeX
|
||||
|
||||
Ceci est un dossier comprenant des documents écrits en LaTeX.
|
||||
|
||||
## Compilation
|
||||
|
||||
Pour générer un fichier PDF, il suffit de compiler le fichier main.tex. Ceci se fait de l'une des façons suivantes :
|
||||
|
||||
```bash
|
||||
$pdflatex main.tex
|
||||
```
|
||||
|
||||
ou
|
||||
|
||||
```bash
|
||||
$make
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Les textes LaTeX bruts se trouvent dans le fichier example.tex.
|
||||
|
||||
## Contributions
|
||||
|
||||
Toute contribution est la bienvenue, et peut m'être adressée à l'adresse <math@denoncin.fr>
|
||||
|
||||
## Licence
|
||||
[WTFPL](http://www.wtfpl.net/)
|
@ -0,0 +1,51 @@
|
||||
\BLOCK{ if type_ecrit == 'let' }
|
||||
\documentclass[11pt, a4paper,french]{letter}
|
||||
\usepackage{babel}
|
||||
\BLOCK{ else }
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
\BLOCK{ endif }
|
||||
|
||||
\usepackage{geometry} %zones de texte
|
||||
\usepackage[utf8]{inputenc} %encodage
|
||||
\usepackage[T1]{fontenc} %encodage
|
||||
\usepackage{amsmath, amsfonts, amssymb,amsthm,mathrsfs} %maths
|
||||
\usepackage{ulem} %souligner avec passage à la ligne
|
||||
\usepackage{graphicx} %environnements figure
|
||||
\usepackage{float} %environnements flottants
|
||||
\usepackage{array} %environnements array
|
||||
\usepackage{faktor} %ensembles quotients
|
||||
\usepackage{hyperref}
|
||||
\usepackage[table,usenames,dvipsnames,x11names]{xcolor} %couleurs
|
||||
\usepackage{mathdots} % pour les iddots
|
||||
\usepackage{multicol} %environnement multicols
|
||||
\usepackage{fancyhdr} %pour la personalisation des pages
|
||||
\usepackage{fourier} %la fonte préférée
|
||||
\usepackage{enumitem} %pour les énumérations
|
||||
\usepackage{verbatim} %pour les citation textuelles
|
||||
\usepackage{listingsutf8} %pour les imports de code extérieur (SQL, Python...)
|
||||
\BLOCK{ if type_ecrit != 'let'}
|
||||
\usepackage{titlesec}
|
||||
\BLOCK{ endif }
|
||||
\usepackage{marvosym} %pour certaines commandes spéciales (euros, radioactivité...)
|
||||
|
||||
%\usepackage[french]{babel} %non reconnu sous gentoo ?
|
||||
%\usepackage{multirow} ??
|
||||
%\usepackage{setspace} pour les espaces dans le document
|
||||
%\usepackage{subfig}
|
||||
%\usepackage[notindex,nottoc,notlot,notlof,notbib]{tocbibind}
|
||||
%\usepackage{makeidx}
|
||||
%\usepackage{sidecap}
|
||||
%\usepackage{wrapfig}
|
||||
%\usepackage{todonotes}
|
||||
%\usepackage{diagbox}
|
||||
|
||||
\usepackage{framed} %encadrés
|
||||
|
||||
\usepackage{tikz,pgf,tkz-tab,pgfplots} %tikz
|
||||
\pgfplotsset{compat=newest}
|
||||
\usetikzlibrary{patterns} % hachures
|
||||
\usetikzlibrary{3d} % surfaces 3d
|
||||
\usepackage{tcolorbox}
|
||||
\tcbuselibrary{skins,xparse,breakable,theorems}
|
||||
\usepackage{empheq} %encadrés des réponses
|
||||
\synctex=1 % pour l'ouverture du fichier tex lors du clic sur pdf
|
@ -0,0 +1,62 @@
|
||||
\BLOCK{if type_ecrit == 'let'}
|
||||
\pagestyle{empty} % Suppress headers and footers
|
||||
\setlength\parindent{1cm} % Paragraph indentation
|
||||
\makeatletter
|
||||
\newcommand{\vhrulefill}[1]{\leavevmode\leaders\hrule\@height#1\hfill \kern\z@}
|
||||
\makeatother
|
||||
\geometry{
|
||||
top=1cm, % Top margin
|
||||
bottom=1.5cm, % Bottom margin
|
||||
left=3cm, % Left margin
|
||||
right=3cm, % Right margin
|
||||
%showframe, % Uncomment to show how the type block is set on the page
|
||||
}
|
||||
\BLOCK{ else }
|
||||
% zone de texte
|
||||
\geometry{%
|
||||
a4paper, % format de papier
|
||||
% Définition des marges :
|
||||
left=1.6cm, % marge intérieure à la page
|
||||
right = 1.6cm, % marge extérieure
|
||||
top = 1.8cm,
|
||||
bottom = 1.8cm,
|
||||
% En-tête et pied de page :
|
||||
headheight=5.2mm, % espace réservé à l'en-tête dans la marge top
|
||||
headsep=3mm, % espace entre le corps et l'en-tête
|
||||
footskip=9mm % espace entre le corps et le pied de page
|
||||
}
|
||||
|
||||
% paquet itemize
|
||||
\setlist[itemize]{label=$\bullet$}
|
||||
|
||||
% paquet lstset
|
||||
\lstset{inputencoding=utf8}
|
||||
|
||||
% paquet hyperlink
|
||||
\hypersetup{colorlinks = true, linkcolor = Turquoise, citecolor = red,
|
||||
urlcolor = red}
|
||||
|
||||
% paquet titlesec
|
||||
\titleformat{\section}[block]
|
||||
{\bfseries\normalsize}
|
||||
{\thesection.}{5pt}
|
||||
{\filcenter}
|
||||
\titleformat{\subsection}[block]
|
||||
{\bfseries\normalsize}
|
||||
{\thesubsection.}{5pt}
|
||||
{\filcenter}
|
||||
\titleformat{\subsubsection}[block]
|
||||
{\bfseries\normalsize}
|
||||
{\thesubsubsection.}{5pt}
|
||||
{\filcenter}
|
||||
|
||||
% paquet fancyhdr
|
||||
\pagestyle{fancy}
|
||||
\BLOCK{ if fancyhead }
|
||||
\fancyhead[L]{\VAR{ classe } - \VAR{ short_title } - \VAR{ lycee } \VAR{ annee } }
|
||||
\BLOCK{ else }
|
||||
\fancyhead[L]{\VAR{ classe } - \VAR{ lycee } \VAR{ annee } }
|
||||
\BLOCK{ endif }
|
||||
\fancyhead[R]{\VAR{ auteur }}
|
||||
\fancyfoot[C]{\thepage}
|
||||
\BLOCK{ endif }
|
@ -0,0 +1,15 @@
|
||||
\newif\ifproof
|
||||
\prooffalse
|
||||
\ifdefined\PROOF
|
||||
\prooftrue
|
||||
\fi
|
||||
\newif\ifsol
|
||||
\solfalse
|
||||
\ifdefined\SOL
|
||||
\soltrue
|
||||
\fi
|
||||
\newif\ifsoli
|
||||
\solifalse
|
||||
\ifdefined\SOLI
|
||||
\solitrue
|
||||
\fi
|
@ -0,0 +1,96 @@
|
||||
\BLOCK{ if type_ecrit == 'let' }
|
||||
\newcommand{\logo}[1]{\renewcommand{\logo}{#1}}
|
||||
\newcommand{\Who}[1]{\renewcommand{\Who}{#1}}
|
||||
\newcommand{\Title}[1]{\renewcommand{\Title}{#1}}
|
||||
\newcommand{\headerlineone}[1]{\renewcommand{\headerlineone}{#1}}
|
||||
\newcommand{\headerlinetwo}[1]{\renewcommand{\headerlinetwo}{#1}}
|
||||
\newcommand{\authordetails}[1]{\renewcommand{\authordetails}{#1}}
|
||||
\newcommand{\authordetailsblock}{
|
||||
\hspace{\fill} % Move the author details to the far right
|
||||
\parbox[t]{0.48\textwidth}{ % Box holding the author details; width value specifies where it starts and ends, increase to move details left
|
||||
\footnotesize % Use a smaller font size for the details
|
||||
\Who\\ % Author name
|
||||
\textit{\authordetails} % The author details text, all italicised
|
||||
}
|
||||
}
|
||||
\address{
|
||||
\includegraphics[width=1in]{\logo} % Include the logo of author institution
|
||||
\hspace{0.82\textwidth} % Position of the institution logo, increase to move left, decrease to move right
|
||||
\vskip -0.1\textheight~\\ % Position of the large header text in relation to the institution logo, increase to move down, decrease to move up
|
||||
\Large\hspace{0.2\textwidth}\headerlineone\hfill ~\\[0.006\textheight] % First line of institution name, adjust hspace if your logo is wide
|
||||
\hspace{0.2\textwidth}\headerlinetwo\hfill \normalsize % Second line of institution name, adjust hspace if your logo is wide
|
||||
\makebox[0ex][r]{\textbf{\Who\Title}}\hspace{0.01\textwidth} % Print author name and title with a little whitespace to the right
|
||||
~\\[-0.01\textheight] % Reduce the whitespace above the horizontal rule
|
||||
\hspace{0.2\textwidth}\vhrulefill{1pt} \\ % Horizontal rule, adjust hspace if your logo is wide and \vhrulefill for the thickness of the rule
|
||||
\authordetailsblock % Include the letter author's details on the right side of the page under the horizontal rule
|
||||
\hspace{-0.25\textwidth} % Horizontal position of the author details block, increase to move left, decrease to move right
|
||||
\vspace{-0.1\textheight} % Move the date and letter content up for a more compact look
|
||||
}
|
||||
\renewcommand{\opening}[1]{
|
||||
{\centering\fromaddress\vspace{0.05\textheight} \\ % Print the header and from address here, add whitespace to move date down
|
||||
\hspace*{\longindentation}\today\hspace*{\fill}\par} % Print today's date, remove \today to not display it
|
||||
{\raggedright \toname \\ \toaddress \par} % Print the to name and address
|
||||
\vspace{1cm} % White space after the to address
|
||||
\noindent #1 % Print the opening line
|
||||
}
|
||||
\signature{\Who\Title} % The signature is a combination of the author's name and title
|
||||
\renewcommand{\closing}[1]{
|
||||
\vspace{2.5mm} % Some whitespace after the letter content and before the signature
|
||||
\noindent % Stop paragraph indentation
|
||||
\hspace*{\longindentation} % Move the signature right to the value of \longindentation
|
||||
\parbox{\indentedwidth}{
|
||||
\raggedright
|
||||
#1 % Print the signature text
|
||||
\vskip 1.65cm % Whitespace between the closing text and author's name for a physical signature
|
||||
\fromsig % Prints the value of \signature{}, i.e. author name and title
|
||||
}
|
||||
}
|
||||
\Who{\VAR{ auteur_lettre }} % Your name
|
||||
\Title{, \VAR{ auteur_titre }} % Your title, leave blank for no title
|
||||
\authordetails{
|
||||
\VAR{ lycee }\\ % Your department/institution
|
||||
\VAR{ lycee_adresse }\\ % Your address
|
||||
\VAR{ lycee_complement_adresse }\\ % Your city, zip code, country, etc
|
||||
Courriel : \VAR{ auteur_adresse_mail }\\ % Your email address
|
||||
%Phone: (000) 111-1111\\ % Your phone number
|
||||
%URL: LaTeXTemplates.com % Your URL
|
||||
}
|
||||
\logo{LW.png} % Logo filename, your logo should have square dimensions (i.e. roughly the same width and height), if it does not, you will need to adjust spacing within the HEADER STRUCTURE block in structure.tex (read the comments carefully!)
|
||||
\headerlineone{\VAR{ institution }} % Top header line, leave blank if you only want the bottom line
|
||||
\headerlinetwo{\VAR{ nom_institution}} % Bottom header line
|
||||
\BLOCK{ else }
|
||||
\renewcommand{\qedsymbol}{\textcolor{red}{$\blacksquare$}}
|
||||
\theoremstyle{plain}
|
||||
\newtheorem*{thmm}{Théorème}
|
||||
\newtheorem*{propp}{Proposition}
|
||||
\newtheorem*{corr}{Corollaire}
|
||||
\newtheorem*{lemm}{Lemme}
|
||||
|
||||
\theoremstyle{definition}
|
||||
\newtheorem*{definitionn}{Définition}
|
||||
\newtheorem*{exx}{Exemple}
|
||||
\newtheorem*{rmkk}{Remark}
|
||||
\newtheorem\VAR{ td }{exo}{Exercice}
|
||||
\newtheorem\VAR{ td }{sol}{Solution}
|
||||
\newtcbtheorem[auto counter]{thm}{Théorème}{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}{thm}
|
||||
\newtcbtheorem[use counter from=thm]{prop}{Proposition}{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}{prop}
|
||||
\newtcbtheorem[use counter from=thm]{cor}{Corollaire}{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}{cor}
|
||||
\newtcbtheorem[use counter from=thm]{lem}{Lemme}{colback=red!5!white,colframe=red!60!black,fonttitle=\bfseries}{lem}
|
||||
\newtcbtheorem[use counter from=thm]{definition}{Définition}{colback=blue!5!white,colframe=blue!75!black,fonttitle=\bfseries}{def}
|
||||
\newtcolorbox[use counter from=thm]{rmk}[1][]{colframe=black!50!white,colback=white,leftrule=2pt, toprule=3pt, rightrule=-1pt, bottomrule=-1pt,boxsep=0pt,right=0.3cm, left=0.3cm, top=3pt, bottom=3pt,fonttitle=\bfseries,sharpish corners,breakable,enhanced,coltitle=black,title={\noindent\textbf{Remarque~\thetcbcounter.}\par},nobeforeafter,#1}
|
||||
\newtcolorbox[use counter from=thm]{ex}[1][]{colframe=gray!50!white,colback=white,leftrule=2pt, toprule=3pt, rightrule=-1pt, bottomrule=-1pt,boxsep=0pt,right=0.3cm, left=0.3cm, top=3pt, bottom=3pt,fonttitle=\bfseries,breakable,enhanced,title={\noindent\textbf{Exemple~\thetcbcounter.}\par},#1}
|
||||
\newtcolorbox[use counter from=thm]{exs}[1][]{colframe=gray!50!white,colback=white,leftrule=2pt, toprule=3pt, rightrule=-1pt, bottomrule=-1pt,boxsep=0pt,right=0.3cm, left=0.3cm, top=3pt, bottom=3pt,fonttitle=\bfseries,sharpish corners,breakable,enhanced,title={\noindent\textbf{Exemples~\thetcbcounter.}\par},#1}
|
||||
\newtcolorbox[use counter from=thm]{rmks}[1][]{colframe=black!50!white,colback=white,leftrule=2pt, toprule=3pt, rightrule=-1pt, bottomrule=-1pt,boxsep=0pt,right=0.3cm, left=0.3cm, top=3pt, bottom=3pt,fonttitle=\bfseries,sharpish corners,breakable,enhanced,title= {\noindent\textbf{Remarques~\thetcbcounter.}\par},#1}
|
||||
|
||||
\newtcolorbox[use counter from=thm]{notation}[1][]{colframe=purple!50!white,colback=white,leftrule=2pt, toprule=-1pt, rightrule=-1pt, bottomrule=-1pt,boxsep=0pt,right=0.3cm, left=0.3cm, top=3pt, bottom=3pt,fonttitle=\bfseries,sharpish corners,breakable,enhanced,code= {\noindent\textbf{Notations.}\par},notitle,#1}
|
||||
|
||||
\renewtcolorbox{proof}[1][]{colframe=red,colback=white,leftrule=2pt, toprule=-1pt, rightrule=-1pt, bottomrule=1pt,boxsep=0pt,right=0.3cm, left=0.3cm, top=3pt, bottom=3pt,sharpish corners,notitle,before upper ={\textbf{Preuve} :\par},after upper ={\qed},breakable,enhanced,#1}
|
||||
|
||||
\newtcolorbox{attention}[1][]{colframe=red,colback=red!5!white,notitle,attach title to upper,halign=center,title={\textcolor{red}{\Radioactivity}\qquad},after upper={\qquad\textcolor{red}{\Radioactivity}},#1}
|
||||
\newtcolorbox{objectif}[1][]{colframe=cyan!50!white,title=\textbf{Objectifs},#1}
|
||||
\newtcolorbox{plan}[1][]{colframe=blue!50!white,title=\textbf{Plan du cours},#1}
|
||||
|
||||
\BLOCK{ endif }
|
||||
|
||||
|
||||
|
@ -0,0 +1,136 @@
|
||||
\BLOCK{ if type_ecrit != 'let' }
|
||||
%\addto\captions{% Replace "english" with the language you use
|
||||
% \renewcommand{}%
|
||||
% {}%
|
||||
% }
|
||||
\renewcommand*\contentsname{} % titre de la table des matières, mais est déjà prévue ailleurs
|
||||
|
||||
\def\K{\mathbb{K}}
|
||||
\def\Q{\mathbb{Q}}
|
||||
\def\C{\mathbb{C}}
|
||||
\def\R{\mathbb{R}}
|
||||
\def\Rp{\mathbb{R}_+}
|
||||
\def\Rpt{\mathbb{R}^{\times}_+}
|
||||
\def\Rt{\mathbb{R}^{\times}}
|
||||
\def\N{\mathbb{N}}
|
||||
\def\Nt{\mathbb{N}^{\times}}
|
||||
\def\Z{\mathbb{Z}}
|
||||
\def\U{\mathbb{U}}
|
||||
\def\F{\mathbb{F}}
|
||||
\def\dt{\text{dt}}
|
||||
\def\dx{\text{dx}}
|
||||
\def\d{\partial}
|
||||
\def\f{\frac} % compatibilité rétrograde
|
||||
\def\le{\left} % compatibilité rétrograde
|
||||
\def\ri{\right}
|
||||
|
||||
\newcommand{\mc}[1]{\mathcal{#1}}
|
||||
\newcommand{\mb}[1]{\mathbb{#1}}
|
||||
\newcommand{\mr}[1]{\mathring{#1}}
|
||||
\renewcommand{\o}[1]{\overline{#1}}
|
||||
\newcommand{\ov}[1]{\overrightarrow{#1}}
|
||||
\newcommand{\norme}[1]{\left|\left|#1\right|\right|}
|
||||
\newcommand{\module}[1]{\left|#1\right|}
|
||||
%\newcommand{\fpi}[1]{\f{\pi}{#1}} compatibilité rétrograde
|
||||
%\newcommand{\func}[5]{\begin{displaymath}\begin{array}{ccc}#1: #2&\rightarrow& #3 \\ #4 & \mapsto \end{array}\end{displaymath}} compatibilité rétrograde ?
|
||||
\newcommand{\dsum}{\displaystyle \sum}
|
||||
\newcommand{\dprod}{\displaystyle \prod}
|
||||
\newcommand{\dint}{\displaystyle \int}
|
||||
\newcommand{\dlim}{\displaystyle \lim}
|
||||
\newcommand{\dcup}{\displaystyle \cup}
|
||||
\newcommand{\bdcup}{\displaystyle \bigcup}
|
||||
\newcommand{\dcap}{\displaystyle \cap}
|
||||
\newcommand{\bdcap}{\displaystyle \bigcap}
|
||||
\newcommand{\leftexp}[2]{{\vphantom{#2}}^{#1}{#2}}
|
||||
|
||||
\newtcbox{\mresult}[1][]{nobeforeafter,#1,colframe=Turquoise,colback=white,leftrule=-1pt,toprule=-1pt,rightrule=1pt,bottomrule=1pt,boxsep=0.3cm,right=0.3cm,left=0.3cm,top=3pt,bottom=3pt,notitle,sharpish corners,math upper,#1} % type de box pour les résultats mathématique
|
||||
\newcommand{\mathresult}[1]{\begin{empheq}[box=\mresult]{align*}#1\end{empheq}} % commande pour encadrer un résultat mathématique
|
||||
\newcommand{\reseq}[1]{\begin{empheq}[box=\mresult]{align*}#1\end{empheq}} % compatibilité rétrograde
|
||||
|
||||
\newtcolorbox{maresult}[1][]{nobeforeafter,colframe=Turquoise,colback=white,leftrule=-1pt,toprule=-1pt,rightrule=1pt,bottomrule=1pt,boxsep=0.3cm,right=0.3cm,left=0.3cm,top=3pt,bottom=3pt,notitle,sharpish corners,math upper,#1} % type de box pour les résultats mathématique trop longs
|
||||
\newtcolorbox{teresult}[1][]{breakable,enhanced,nobeforeafter,colframe=Turquoise,colback=white,leftrule=-1pt,toprule=-1pt,rightrule=1pt,bottomrule=1pt,boxsep=0.3cm,right=0.3cm,left=0.3cm,top=3pt,bottom=3pt,notitle,sharpish corners,#1} % type de box pour les résultats texte trop long.
|
||||
%\newtcolorbox{result}[1][]{breakable,enhanced,nobeforeafter,colframe=Turquoise,colback=white,leftrule=-1pt,toprule=-1pt,rightrule=1pt,bottomrule=1pt,boxsep=0.3cm,right=0.3cm,left=0.3cm,top=3pt,bottom=3pt,notitle,sharpish corners,#1} % resultat en général : permet de mettre du texte et des maths avec align*
|
||||
|
||||
\newtcbox{\tresult}[1][]{breakable,enhanced,nobeforeafter,#1,colframe=Turquoise,colback=white,leftrule=-1pt,toprule=-1pt,rightrule=1pt,bottomrule=1pt,boxsep=0.3cm,right=0.3cm,left=0.3cm,top=3pt,bottom=3pt,notitle,sharpish corners,#1} % type de box pour les résultats texte
|
||||
\newcommand{\textresult}[1]{\begin{center}\tresult{#1}\end{center}} % commande pour encadrer un résultat texte
|
||||
\newcommand{\fresult}[1]{\begin{center}\tresult{#1}\end{center}} % compatibilité rétrograde
|
||||
\newcommand{\result}[1]{\begin{center}\tresult{#1}\end{center}} % compatibilité rétrograde
|
||||
\newcommand{\reponse}[1]{\begin{framed}#1\end{framed}}
|
||||
|
||||
\newcommand{\sqlstyle}{
|
||||
\lstset{
|
||||
language=sql,
|
||||
frameround=tttt,
|
||||
frame=single,
|
||||
framerule=1pt,
|
||||
rulecolor=\color{gray!60},
|
||||
showstringspaces=false,
|
||||
backgroundcolor=\color{gray!10},
|
||||
basicstyle=\ttfamily\small,%\setstretch{1},
|
||||
keywordstyle=\color{red!90}\bf,
|
||||
commentstyle=\color{purple}\slshape,
|
||||
stringstyle=\color{green},
|
||||
emph={[2]no, column, read},
|
||||
emphstyle=[2],
|
||||
otherkeywords={TEXT, REFERENCES, EXISTS, OFFSET},% IS},
|
||||
inputencoding=utf8,
|
||||
}
|
||||
}
|
||||
\newcommand{\pythonstyle}{
|
||||
\lstset{
|
||||
language=python,
|
||||
frameround=tttt,
|
||||
frame=single,
|
||||
framerule=2pt,
|
||||
rulecolor=\color{gray!60},
|
||||
rulesep=.3pt,
|
||||
backgroundcolor=\color{gray!5},
|
||||
basicstyle=\ttfamily\small,%\setstretch{1},
|
||||
stringstyle=\color{green},
|
||||
emphstyle=[4]\color{blue},
|
||||
upquote=true,
|
||||
morecomment=[s][\color{Cyan}]{"""}{"""},
|
||||
commentstyle=\color{gray}\slshape,
|
||||
inputencoding=utf8,
|
||||
%commentstyle=\color{Green},
|
||||
keywordstyle=\color{Green!80},
|
||||
frame=single,
|
||||
breaklines=true,
|
||||
% morekeywords={True, False},
|
||||
numbers=left,
|
||||
numbersep=10pt,
|
||||
numberstyle=\footnotesize\color{Gray},
|
||||
showstringspaces=false,
|
||||
stringstyle=\color{Mulberry},
|
||||
tabsize=4,
|
||||
emph={[4]ArithmeticError,AssertionError,AttributeError,BaseException,%
|
||||
DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,%
|
||||
False,FloatingPointError,FutureWarning,GeneratorExit,IOError,%
|
||||
ImportError,ImportWarning,IndentationError,IndexError,KeyError,%
|
||||
KeyboardInterrupt,LookupError,MemoryError,NameError,None,%
|
||||
NotImplemented,NotImplementedError,OSError,OverflowError,%
|
||||
PendingDeprecationWarning,ReferenceError,RuntimeError,RuntimeWarning,%
|
||||
StandardError,StopIteration,SyntaxError,SyntaxWarning,SystemError,%
|
||||
SystemExit,TabError,True,TypeError,UnboundLocalError,UnicodeDecodeError,%
|
||||
UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,%
|
||||
UserWarning,ValueError,Warning,ZeroDivisionError,abs,all,any,apply,%
|
||||
basestring,bool,buffer,callable,chr,classmethod,cmp,coerce,compile,%
|
||||
complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,%
|
||||
execfile,exit,file,filter,float,frozenset,getattr,globals,hasattr,%
|
||||
hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,%
|
||||
license,list,locals,long,map,max,min,object,oct,open,ord,pow,property,%
|
||||
quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,%
|
||||
slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,%
|
||||
vars,xrange,zip},
|
||||
}}
|
||||
\newcommand{\lstpy}[2]{\pythonstyle\lstinputlisting[caption=#2]{#1}}
|
||||
\newcommand{\lstsql}[2]{\sqlstyle\lstinputlisting[caption=#2]{#1}} % Environnement SQL. Syntaxe env{\nameref}{\ref}
|
||||
\newcommand\pythoninline[1]{{\pythonstyle\lstinline!#1!}}
|
||||
\newcommand\sqlinline[1]{{\sqlstyle\lstinline!#1!}}
|
||||
\lstnewenvironment{python}[1][]{
|
||||
\pythonstyle
|
||||
}{}
|
||||
\lstnewenvironment{sql}[1][]{
|
||||
\sqlstyle
|
||||
}{}
|
||||
\BLOCK{ endif }
|
@ -0,0 +1,84 @@
|
||||
\DeclareMathOperator{\GL}{GL}
|
||||
\DeclareMathOperator{\Sym}{S}
|
||||
\DeclareMathOperator{\An}{A}
|
||||
\DeclareMathOperator{\Uni}{U}
|
||||
\DeclareMathOperator{\syl}{Syl}
|
||||
\DeclareMathOperator{\stab}{Stab}
|
||||
\DeclareMathOperator{\GU}{GU}
|
||||
\DeclareMathOperator{\PGL}{PGL}
|
||||
\DeclareMathOperator{\SL}{SL}
|
||||
\DeclareMathOperator{\Or}{O}
|
||||
\DeclareMathOperator{\SO}{SO}
|
||||
\DeclareMathOperator{\Aut}{Aut}
|
||||
\DeclareMathOperator{\End}{End}
|
||||
\DeclareMathOperator{\Hom}{Hom}
|
||||
\DeclareMathOperator{\Image}{Im}
|
||||
\DeclareMathOperator{\Real}{Re}
|
||||
\DeclareMathOperator{\ID}{id}
|
||||
\DeclareMathOperator{\tr}{tr}
|
||||
\DeclareMathOperator{\trace}{trace}
|
||||
\DeclareMathOperator{\Ker}{Ker}
|
||||
\DeclareMathOperator{\exponential}{exp}
|
||||
\DeclareMathOperator{\Modulo}{mod}
|
||||
\DeclareMathOperator{\spec}{spec}
|
||||
\DeclareMathOperator{\ch}{ch}
|
||||
\DeclareMathOperator{\sh}{sh}
|
||||
\DeclareMathOperator{\ppcm}{ppcm}
|
||||
\DeclareMathOperator{\arcos}{arcos}
|
||||
\DeclareMathOperator{\Vect}{Vect}
|
||||
\DeclareMathOperator{\diag}{diag}
|
||||
\DeclareMathOperator{\mat}{Mat}
|
||||
\DeclareMathOperator{\Sp}{Sp}
|
||||
\DeclareMathOperator{\Arg}{Arg}
|
||||
\DeclareMathOperator{\Cov}{Cov}
|
||||
\DeclareMathOperator{\I}{I}
|
||||
\DeclareMathOperator{\rang}{rang}
|
||||
\DeclareMathOperator{\M}{M}
|
||||
\DeclareMathOperator{\mul}{mul}
|
||||
|
||||
\begin{document}
|
||||
\BLOCK{ if type_ecrit == 'ds' }
|
||||
\thispagestyle{fancy}
|
||||
\fancyhead{}
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics[width=0.1\textwidth]{LW.png}
|
||||
\end{figure}
|
||||
\fancyfoot{}
|
||||
\begin{center}
|
||||
\huge{\textbf{\VAR{ ds_numero } \'epreuve de Mathématiques}}\\
|
||||
\huge{\textbf{\VAR{ classe } - \VAR{ annee }}}\\
|
||||
\vspace{1em}
|
||||
\Large{Durée : 4h}
|
||||
\end{center}
|
||||
\hrule
|
||||
\vspace{3em}
|
||||
\begin{center}
|
||||
\LARGE{\textbf{L'usage des calculatrices est interdit}}
|
||||
\end{center}
|
||||
\vspace{6em}
|
||||
\begin{center}
|
||||
\underline{\Large{\textbf{AVERTISSEMENT}}}
|
||||
\end{center}
|
||||
\vspace{1em}
|
||||
\begin{center}
|
||||
\begin{minipage}[]{.98\textwidth}
|
||||
\Large{Toute réponse non justifiée \textbf{ne sera pas prise en compte}. \\ \newline Par ailleurs la \textbf{présentation, la qualité de la rédaction, la clarté et la précision des raisonnements} entreront pour une part importante dans l'appréciation des copies.\\ \newline Vous êtes invités à encadrer vos résultats.}
|
||||
\end{minipage}
|
||||
|
||||
\vspace{5em}
|
||||
\begin{minipage}[]{.98\textwidth}
|
||||
\large{\noindent Si au cours de l'épreuve, vous repérez ce qui vous semble être une erreur d'énoncé, vous le signalez sur votre copie et poursuivez votre composition en indiquant les raisons des initiatives que vous êtes amenés à prendre.}
|
||||
\end{minipage}
|
||||
\end{center}
|
||||
%\text{\Large{Toute réponse non mise en valeur ne sera pas prise en compte.}}\\
|
||||
%\text{\Large{Par ailleur la \textbf{présentation, la qualité de la rédaction, la clarté et la précision des raisonnements} entreront pour une part importante dans l'appréciation des copies.}}
|
||||
|
||||
\newpage
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
\setcounter{page}{1}
|
||||
\fancyhead[L]{\VAR{ classe } - \VAR{ short_title } - \VAR{ lycee } \VAR{ annee } }
|
||||
\fancyhead[R]{\VAR{ auteur }}
|
||||
\fancyfoot[C]{\thepage}
|
||||
|
||||
\BLOCK{ endif }
|
@ -0,0 +1,4 @@
|
||||
\input{Utils/01_paquets}
|
||||
\input{Utils/02_config_paquets}
|
||||
\input{Utils/03_compilation_conditionnelle}
|
||||
\input{Utils/04_environnements}
|
@ -0,0 +1,8 @@
|
||||
|
||||
\BLOCK{ if type_ecrit == 'ds' }
|
||||
\vspace{10em}
|
||||
\begin{center}
|
||||
\Large{\underline{FIN DE L'ÉPREUVE}.}
|
||||
\end{center}
|
||||
\BLOCK{ endif }
|
||||
\end{document}
|
@ -0,0 +1,104 @@
|
||||
%Fichier généré le \VAR{date}
|
||||
\BLOCK{ if type_ecrit == 'let'}
|
||||
\begin{letter}{
|
||||
<+À qui de droit+>\\
|
||||
}
|
||||
\opening{Chers <++>,}
|
||||
|
||||
Je connais <++> car celui-ci a effectué sa deuxième année de classe préparatoire dans la filière PT du lycée Langevin-Wallon dans laquelle j'enseigne les mathématiques. <++>
|
||||
|
||||
<++> pour ces raisons je me permets de recommander <++> pour son \textbf{inscription au niveau <++>} de <++>
|
||||
|
||||
\closing{Bien cordialement,}
|
||||
\end{letter}
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ if type_ecrit == 'pb' }
|
||||
\section{<++ Votre titre ici ++>}<++>
|
||||
|
||||
\def\pb{<++ nom du problème ++>pbq:}
|
||||
\begin{enumerate}[resume]
|
||||
\item\label{\pb\theenumi} <++>
|
||||
\end{enumerate}<++>
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ if type_ecrit == 'in' }
|
||||
\begin{enumerate}[]
|
||||
\BLOCK{ for i in range(8) }
|
||||
\item <++>
|
||||
\reponse{
|
||||
\vspace{10em}
|
||||
}
|
||||
\BLOCK{ if i == 3 }
|
||||
\newpage
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ endfor }
|
||||
\end{enumerate}
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ if type_ecrit == 'cr' }
|
||||
\BLOCK{ for nom in liste_noms }
|
||||
\BLOCK{ if nom != '' }
|
||||
\begin{tcolorbox}[breakable, colframe=black, colback=white, coltext=black, title=\sffamily\huge\bfseries{\VAR{lycee}\hfill \VAR{classe} \hfill S\VAR{semaine}}]\sffamily\Large\bfseries{ \VAR{ nom } \hfill Note : <+note+>}
|
||||
\end{tcolorbox}
|
||||
% Barème
|
||||
% Tableau question de cours : /3
|
||||
% Exposé question de cours : /6
|
||||
% Tableau exercice : /3
|
||||
% Raisonner : /5
|
||||
% Dialoguer : /3
|
||||
|
||||
% Si pas de question de cours
|
||||
% Tableau exercice : /4
|
||||
% Raisonner : /11
|
||||
% Dialoguer : /5
|
||||
|
||||
\subsection*{Question de cours :}
|
||||
<++>
|
||||
|
||||
\subsection*{Exercice :}
|
||||
\begin{exo}
|
||||
<++>
|
||||
\end{exo}
|
||||
|
||||
\vspace{.5cm}
|
||||
\begin{tcolorbox}[breakable, colframe=gray!30, coltitle=black, colback=white, coltext=black,title=\sffamily\large\bfseries{Remarques}]
|
||||
Cours : <++>.\\
|
||||
Exo : <++>.\\
|
||||
\end{tcolorbox}
|
||||
|
||||
|
||||
\newpage
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ endfor }
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ if type_ecrit == 'ob' }
|
||||
\BLOCK{ for nom in liste_noms }
|
||||
\BLOCK{ if nom != '' }
|
||||
\begin{tcolorbox}[breakable, colframe=black, colback=white, coltext=black, title=\sffamily\huge\bfseries{\VAR{lycee}\hfill \VAR{classe}}]\sffamily\Large\bfseries{ \VAR{ nom } \hfill Note (pour information): <+notemaths+>+<+noteinfo+> = <+notefinale+>}
|
||||
\end{tcolorbox}
|
||||
|
||||
\subsection*{Mathématiques :}
|
||||
|
||||
\vspace{.5cm}
|
||||
\begin{tcolorbox}[breakable, colframe=gray!30, coltitle=black, colback=white, coltext=black,title=\sffamily\large\bfseries{Remarques}]
|
||||
<+remarques+>
|
||||
\end{tcolorbox}
|
||||
|
||||
\subsection*{Informatique :}
|
||||
|
||||
\vspace{.5cm}
|
||||
\begin{tcolorbox}[breakable, colframe=gray!30, coltitle=black, colback=white, coltext=black,title=\sffamily\large\bfseries{Remarques}]
|
||||
<+remarques+>
|
||||
\end{tcolorbox}
|
||||
|
||||
\subsection*{Conclusion :}
|
||||
<+ccl+>
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ endfor }
|
||||
\BLOCK{ endif }
|
||||
\BLOCK{ if type_ecrit == 'te' }
|
||||
\begin{exo}
|
||||
<++>
|
||||
\end{exo}
|
||||
\reponse{
|
||||
\vspace{17cm}
|
||||
}
|
||||
\BLOCK{ endif }
|
@ -0,0 +1,8 @@
|
||||
\input{Utils/header}
|
||||
\input{Utils/05_macros}
|
||||
\input{Utils/06_math_operator}
|
||||
\BLOCK{ if contenu }
|
||||
\input{titre_contenu}
|
||||
\BLOCK{ endif }
|
||||
\input{\VAR{ tex_file }}
|
||||
\input{Utils/tailer}
|
@ -0,0 +1,5 @@
|
||||
\thispagestyle{empty}
|
||||
\begin{tcolorbox}[colframe=Turquoise!70!white,adjusted title=center,halign title=center,title={\Large \VAR{ title } },arc=3mm]
|
||||
\tableofcontents
|
||||
\end{tcolorbox}
|
||||
\newpage
|
@ -0,0 +1,28 @@
|
||||
from setuptools import setup, find_packages
|
||||
from documentex.constantes_document_latex import version
|
||||
|
||||
setup(
|
||||
name="documentex",
|
||||
version=version,
|
||||
packages=find_packages(),
|
||||
include_package_data=True,
|
||||
py_modules=['documentex'],
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'documentex = documentex.documentex:documentex',
|
||||
]
|
||||
},
|
||||
install_requires=[
|
||||
"jinja2",
|
||||
"Click",
|
||||
"PyInquirer",
|
||||
],
|
||||
|
||||
author = "David Denoncin",
|
||||
author_email = "math@denoncin.fr",
|
||||
url = "math.denoncin.fr",
|
||||
description = "Utilitaire pour créer des arborescence de dossiers LaTeX",
|
||||
classifiers=[
|
||||
"Licence :: WTFPL"
|
||||
]
|
||||
)
|
Loading…
Reference in New Issue