From c6deffed18f97db19ea1fde48fb37d54982a22cc Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Thu, 4 Oct 2018 22:32:37 +0200 Subject: [PATCH] Update. --- commun/commun.sty | 84 ++++++++++++- cours/cours_beamer.cls | 14 +-- cours/cours_devoir.cls | 256 ++++++++++++++++++---------------------- cours/cours_paper.cls | 38 ++++-- shortcuts/shortcuts.sty | 48 ++++++-- 5 files changed, 261 insertions(+), 179 deletions(-) diff --git a/commun/commun.sty b/commun/commun.sty index 22a2a3c..52c87a0 100644 --- a/commun/commun.sty +++ b/commun/commun.sty @@ -33,6 +33,7 @@ \RequirePackage{etoolbox} \RequirePackage{ifluatex} \RequirePackage{import} +\RequirePackage{lipsum} % language \ifluatex @@ -103,7 +104,8 @@ \RequirePackage[dash]{dashundergaps} \RequirePackage{comment} \RequirePackage{caption} - +\RequirePackage[outputdir=./build]{minted} +\RequirePackage{inconsolata} \makeatletter @@ -116,8 +118,9 @@ % % -% \providetoggle{display} -% \toggletrue{display} +% Set the default monospaced font +\setmonofont[StylisticSet=3]{Inconsolatazi4} + % @@ -128,7 +131,6 @@ % Tableau % Alignment commands of the content in the column with a defined width. - \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} @@ -178,10 +180,10 @@ } } -% \keystroke{text} +% \kbd{text} % Boxed text as a keyboard key. % Why: menukeys and tipfr packages don't really run correctly with beamer. -\newcommand*\keystroke[1]{% +\newcommand*\kbd[1]{% \tikz[baseline=(key.base)] \node[% draw, @@ -196,6 +198,9 @@ ; } +% \getrandomletter[*]{start}{end} +% Choose a letter between start and end in the alphabetical order. +% Produce a uppercased letter when called with a star. \NewDocumentCommand \getrandomletter { s G{1} G{26} }{% \IfBooleanTF { #1 }{ \pgfmathrandominteger{\zzz}{#2}{#3}\csname pgffor@Alpha\endcsname{\zzz} @@ -204,12 +209,40 @@ } } +% \@getletter{start}{end} +% Choose a letter between start an end. The letter maybe in uppercase or in lowercase. \NewDocumentCommand \@getletter{ G{1} G{26} }{ \pgfmathsetmacro{\random}{rnd} \pgfmathparse{\random >= 0.5 ? "\noexpand\getrandomletter{#1}{#2}" : "\noexpand\getrandomletter*{#1}{#2}"} \pgfmathresult } +% NEED COMMENT +\newsavebox{\fminipagebox} +\NewDocumentEnvironment{fminipage}{m O{\fboxsep}} +{\par\kern#2\noindent\begin{lrbox}{\fminipagebox} + \begin{minipage}{#1}\ignorespaces} + {\end{minipage}\end{lrbox}% + \makebox[#1]{% + \kern\dimexpr-\fboxsep-\fboxrule\relax + \fbox{\usebox{\fminipagebox}}% + \kern\dimexpr-\fboxsep-\fboxrule\relax + }\par\kern#2 +} + + + +% +% +% MINTED +% +% + +\definecolor{friendlybg}{HTML}{F0F0F0} +\newminted[python]{python}{style=bw, fontsize=\small, bgcolor=white, autogobble, frame=lines, breaklines, escapeinside=||, xleftmargin=0em, xrightmargin=0em, numbersep=.2em} +\newmintinline{python}{style=autumn, fontsize=\small, bgcolor=friendlybg, autogobble, encoding=utf8} +\renewcommand{\theFancyVerbLine}{\sffamily\black{\bfseries{\scriptsize\arabic{FancyVerbLine}}}} + % @@ -224,6 +257,45 @@ +% +% +% AMSTHM +% +% +\newtheoremstyle{exostyle1} +{\topsep}% espace avant +{\topsep}% espace apres +{}% Police utilisee par le style de thm +{}% Indentation (vide = aucune, \parindent = indentation paragraphe) +{\bfseries}% Police du titre de thm +{}% Signe de ponctuation apres le titre du thm +{\newline}% Espace apres le titre du thm (\newline = linebreak) +{\thmname{#1}\thmnumber{ #2}\thmnote{ - \normalfont{\textit{#3}}}} % composants du titre du thm : \thmname = nom, \thmnumber = numéro, \thmnote = sous-titre + +\newtheoremstyle{exostyle2} +{\topsep}% espace avant +{\topsep}% espace apres +{}% Police utilisee par le style de thm +{}% Indentation (vide = aucune, \parindent = indentation paragraphe) +{\bfseries}% Police du titre de thm +{}% Signe de ponctuation apres le titre du thm +{\newline}% Espace apres le titre du thm (\newline = linebreak) +{% + \if\relax\detokenize{#3}\relax + % no optional argument + \else + \makebox[0pt][l]{\hspace{.9\textwidth}\normalfont\itshape#3}% + \fi + \thmname{#1}\thmnumber{ #2}% +} + +\theoremstyle{exostyle2} +\newtheorem{exercice}{Exercice} +\newtheorem{exercice*}[exercice]{\faPencil \ Exercice} +% + + + % % % Captions diff --git a/cours/cours_beamer.cls b/cours/cours_beamer.cls index 699f1d8..e4f52ec 100644 --- a/cours/cours_beamer.cls +++ b/cours/cours_beamer.cls @@ -292,7 +292,7 @@ %} % déf(*)(TITRE) -\NewDocumentEnvironment{déf}{ s g }{%begin +\NewDocumentEnvironment{défn}{ s g }{%begin \setbeamercolor*{block title}{parent=definition} % \setbeamercolorofitem{definition} \IfBooleanTF #1 @@ -314,7 +314,7 @@ } % défn(*)(TITRE) -\NewDocumentEnvironment{défn}{ s g }{%begin +\NewDocumentEnvironment{déf}{ s g }{%begin \setbeamercolor*{block title}{parent=definition} % \setbeamercolorofitem{definition} \IfBooleanTF #1 @@ -336,7 +336,7 @@ } % thm(TITRE) -\NewDocumentEnvironment{thm}{ g }{%begin +\NewDocumentEnvironment{thmn}{ g }{%begin \setbeamercolor*{block title}{parent=theorem} % \setbeamercolorofitem{theorem} \IfNoValueTF {#1} { @@ -349,7 +349,7 @@ } % thmn(TITRE) -\NewDocumentEnvironment{thmn}{ g }{%begin +\NewDocumentEnvironment{thm}{ g }{%begin \setbeamercolor*{block title}{parent=theorem} % \setbeamercolorofitem{theorem} \IfNoValueTF {#1} { @@ -362,7 +362,7 @@ } % ppt(*)(TITRE) -\NewDocumentEnvironment{ppt}{ s g }{%begin +\NewDocumentEnvironment{pptn}{ s g }{%begin \setbeamercolor*{block title}{parent=property} % \setbeamercolorofitem{property} \IfBooleanTF #1 @@ -384,7 +384,7 @@ } % pptn(*)(TITRE) -\NewDocumentEnvironment{pptn}{ s g }{%begin +\NewDocumentEnvironment{ppt}{ s g }{%begin \setbeamercolor*{block title}{parent=property} % \setbeamercolorofitem{property} \IfBooleanTF #1 @@ -492,7 +492,7 @@ \NewDocumentEnvironment{exe}{ G{Exemple} }{%begin \setbeamercolor*{block title}{parent=example} % \setbeamercolorofitem{example} - \begin{block} {\faPaperclip \hspace{.125em} #1} + \begin{block} {\faEye \hspace{.125em} #1} }{%end \end{block} } diff --git a/cours/cours_devoir.cls b/cours/cours_devoir.cls index ddb0a87..2fb20d3 100644 --- a/cours/cours_devoir.cls +++ b/cours/cours_devoir.cls @@ -2,195 +2,163 @@ %%% %%% Classe : cours_devoir.cls %%% Version : 1.0 -%%% Date : 01/04/17 +%%% Date : 03/10/18 %%% Auteur : Jeff LANCE %%% %%% \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{cours_devoir}[2016/11/09 Document de devoir, V1.0] +\ProvidesClass{cours_devoir}[2018/10/03 Devoirs, V1.0] + + +% +% +% INIT +% +% +\LoadClassWithOptions{scrartcl} +%\LoadClass[a4paper, 12pt, DIV=24]{scrartcl} +% +% +% PACKAGES +% +% +% Others +\RequirePackage{xkeyval} -%-- PARENT CLASS -\LoadClass[a4paper, 11pt]{article} -%--------------- - - - - -%-- PACKAGES CALLS -%%% PERSO %%% +% Own packages. Those contains some global settings and definitions. \RequirePackage{commun} +\RequirePackage{couleurs} \RequirePackage{shortcuts} -%%%%%%%%%%%%% -%%% AUTRES %%% +% Output \RequirePackage{comment} + +% Layout \RequirePackage{geometry} -\RequirePackage{fancyhdr} +\RequirePackage[footsepline, plainfootsepline]{scrlayer-scrpage} +\RequirePackage{titling} \RequirePackage{titlesec} +\RequirePackage{pageslts} \RequirePackage{enumitem} -\RequirePackage{environ} -%%%%%%%%%%%%%% -%----------------- +\RequirePackage[]{hyperref} + + \makeatletter +% +% +% OPTIONS +% +% -%-- SETTINGS -%%% PATHS %%% -\graphicspath{{images/}} -%%%%%%%%%%%%% +\DeclareOptionX{type}[ds]{% + \def\type{#1}% +} + +\ExecuteOptions{a4paper, DIV=24} +\ExecuteOptionsX{type} +\ProcessOptionsX -%%% METAPOST %%% + +% +% +% FIXES +% +% + +% Fix error from KOMA-Script scrartcl class. +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} + + + +% +% +% SETTINGS +% +% + +% metapost \ifpdf \DeclareGraphicsRule{*}{mps}{*}{} \fi -%%%%%%%%%%%%%%%% - -%%% TikZ %%% +% tkz \usetkzobj{all} % on charge tous les objets -%%%%%%%%%%%% +% sizing of the page +\geometry{a4paper, includeheadfoot, hmargin=.7cm, vmargin=.5cm, head=14.5pt} -%%% PAGE %%% -\geometry{a4paper, hmargin=.8cm, vmargin=2cm, centering, nofoot, headheight=1cm, layoutvoffset=.5cm} -%%%%%%%%%%%% +% title, header and footer +\ihead[]{} +\chead[]{} +\ohead[]{} +\ifoot[]{} +\cfoot[]{} +\ofoot[]{} +% KOMA-Script version (preferred) -%%% TITRE, EN-TÊTE, PIED,... %%% -\thispagestyle{fancy} -\pagestyle{empty} -\fancyhead{} -\fancyfoot{} -\renewcommand{\headrulewidth}{0.0pt} -\renewcommand{\footrulewidth}{0.0pt} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -%%% SECTIONS %%% -\titlelabel{\textbf{\thetitle}} -\titleformat{\section}[runin]{\rmfamily\bfseries\large}{\thesection}{.5em}{}[\\] -\titleformat{\subsection}[runin]{\rmfamily\bfseries\normal}{\thesubsection)}{.5em}{}[\\] -%%%%%%%%%%%%%%%% - - -%%% LISTS %%% -\setlist[enumerate,1]{label=\textbf{\arabic*.}, - font=\sffamily, - leftmargin=1.2em, - noitemsep,resume} -\setlist[enumerate,2]{label=\textbf{\alph*)}, - font=\sffamily, - leftmargin=1.2em, - noitemsep -} -\setlist[enumerate,3]{label={\textcircled{\small\Alph*}}, - font=\sffamily, - leftmargin=1.2em, - noitemsep -} -%%%%%%%%%%%%% - - -%%% MDFRAMED %%% -% global options -\mdfsetup{ - frametitlealignment=\raggedright,% - innerbottommargin=2em,% +\ifthenelse{ \equal{\type}{ds} }{ + \cohead[\textbf{MATHÉMATIQUES}\\\textbf{Devoir surveillé}]{\textbf{MATHÉMATIQUES}\\\textbf{Devoir surveillé}} + \lohead[NOM :\\Prénom :]{NOM :\\Prénom :} + \rohead[Le \@date]{Le \@date} + \cehead[]{} + \lehead[]{} + \rehead[]{} +}{ + \ifthenelse{ \equal{\type}{dm} }{ + \cohead[\textbf{MATHÉMATIQUES}\\\textbf{Devoir maison}]{\textbf{MATHÉMATIQUES}\\\textbf{Devoir maison}} + \lohead[NOM :\\Prénom :]{NOM :\\Prénom :} + \rohead[Le \@date]{Le \@date} + \cehead[]{} + \lehead[]{} + \rehead[]{} + }{ + + } } -% styles -\tikzset{ - symbol/.style={ - rectangle, draw=white, - fill=white, scale=1, - overlay - } -} +\cofoot*{} +\pagestyle{scrheadings} +\setkomafont{pagehead}{\normalfont} +\setkomafont{pagefoot}{\normalfont} -% idea: a shadowed square frame with a light bulb icon at upper left -\mdfdefinestyle{tips}{% - linecolor=white,linewidth=1pt,% - tikzsetting={draw=black,dotted,line width=1pt},% - leftmargin=0,rightmargin=0,% - innertopmargin=0em,innerbottommargin=0.5em,% - innerleftmargin=1em,innerrightmargin=.5em,% - skipabove=0,skipbelow=0,% - frametitlerule=false,% - frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,% - frametitleaboveskip=0,frametitlebelowskip=0 - nobreak=true,% - xcolor,% - hidealllines=false, %leftline=true, % topline=true, bottomline=true,% - % shadow=true,% - % backgroundcolor=gray!40,% FOR TEST ONLY - firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) - node[symbol] { \faLightbulbO }; - },% - secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) - node[symbol] { \faLightbulbO }; - },% - middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) - node[symbol] { \faLightbulbO }; - },% - singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) - node[symbol] { \faLightbulbO }; - },% -} - -\mdtheorem[style=tips, theoremseparator={}, theoremspace={}]{tips}{} - -\RenewDocumentEnvironment{tips}{ o } {%begin - \begin{tips*} -}{%end - \end{tips*} -} -%%%%%%%%%%%%%%%% - -%----------- +% paths +\graphicspath{{images/}} - -%-- OWN COMMANDS - -%% \lHead{TEXT} -%% partie gauche du titre -%\NewDocumentCommand \lHead { g } { -% \fancyhead[LO]{#1\\} -% \fancyhead[LE]{} -%} % -%% \cHead{TEXT} -%% partie centrale du titre -%\NewDocumentCommand \cHead { g } { -% \fancyhead[CO]{\textbf{MATHÉMATIQUES}\\#1\\} -% \fancyhead[CE]{} -%} % -%% \rHead{TEXT} -%% partie droite du titre -%\NewDocumentCommand \rHead { g } { -% \fancyhead[RO]{#1\\} -% \fancyhead[RE]{} -%} +% MACROS +% +% -% \headrule -% affiche un trait de séparation netre le titre et le contenu du document -%\NewDocumentCommand \headrule { } { -% \renewcommand{\headrulewidth}{1.0pt} -%} +% lists +\newlist{questions}{enumerate}{2} +\setlist[questions]{labelindent=0em, leftmargin=*, labelsep=0.5em} +\setlist[questions, 1]{label=\textbf{\arabic*.}} +\setlist[questions, 2]{label=\textbf{\alph*)}} -%--------------- +\newlist{questionsl}{enumerate*}{1} +\setlist*[questionsl]{label=\textbf{\alph*)}} +\setlist[enumerate, 1]{label=\textbf{\arabic*.}, leftmargin=*, labelsep=.5em} +\setlist[enumerate, 2]{label=\textbf{\alph*)}} +\setlist[description]{font=\sffamily\bfseries} +% +\NewDocumentCommand \turnpage{ }{ + \rofoot[\textit{Tourner la page, svp} \faHandORight]{\textit{Tourner la page, svp} \faHandORight} +} \makeatother diff --git a/cours/cours_paper.cls b/cours/cours_paper.cls index 8b5bf92..039a5d0 100644 --- a/cours/cours_paper.cls +++ b/cours/cours_paper.cls @@ -315,6 +315,18 @@ frametitlebackgroundcolor=white!0,%innertopmargin=\topskip,% nobreak=false,% xcolor,% + firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) + node[symbol] { \faEye }; + },% + secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) + node[symbol] { \faEye }; + },% + middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) + node[symbol] { \faEye }; + },% + singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,-.4)+1.0*(0,\y1)$) + node[symbol] { \faEye }; + },% } % quote: frame with no borders but with a beginning quote at upper left and % an ending quote at lower right @@ -726,20 +738,20 @@ \setlist[description]{font=\sffamily\bfseries} -% amsthm -\newtheoremstyle{exostyle} - {\topsep}% espace avant - {\topsep}% espace apres - {}% Police utilisee par le style de thm - {}% Indentation (vide = aucune, \parindent = indentation paragraphe) - {\bfseries}% Police du titre de thm - {}% Signe de ponctuation apres le titre du thm - {\newline}% Espace apres le titre du thm (\newline = linebreak) - {\thmname{#1}\thmnumber{ #2}\thmnote{ - \normalfont{\textit{#3}}}} % composants du titre du thm : \thmname = nom, \thmnumber = numéro, \thmnote = sous-titre - -\theoremstyle{exostyle} -\newtheorem{exercice}{Exercice} +%% amsthm +%\newtheoremstyle{exostyle} +% {\topsep}% espace avant +% {\topsep}% espace apres +% {}% Police utilisee par le style de thm +% {}% Indentation (vide = aucune, \parindent = indentation paragraphe) +% {\bfseries}% Police du titre de thm +% {}% Signe de ponctuation apres le titre du thm +% {\newline}% Espace apres le titre du thm (\newline = linebreak) +% {\thmname{#1}\thmnumber{ #2}\thmnote{ - \normalfont{\textit{#3}}}} % composants du titre du thm : \thmname = nom, \thmnumber = numéro, \thmnote = sous-titre % +%\theoremstyle{exostyle} +%\newtheorem{exercice}{Exercice} +%% diff --git a/shortcuts/shortcuts.sty b/shortcuts/shortcuts.sty index 9db9328..f55ac1f 100644 --- a/shortcuts/shortcuts.sty +++ b/shortcuts/shortcuts.sty @@ -16,7 +16,11 @@ \makeatletter -%-- Environments +% +% +% ENVIRONMENTS +% +% % itemize \newcommand{\bi}{\begin{itemize}} \newcommand{\ei}{\end{itemize}} @@ -36,13 +40,16 @@ -%-- Typo +% +% +% TEXT +% +% % Another shortcut for white text. \NewDocumentCommand \ghost { } {% \white } -%-- Texte % c'est-à-dire \NewDocumentCommand \cad { } { {c'est-à-dire} @@ -51,7 +58,13 @@ {C'est-à-dire} } -%-- Maths + + +% +% +% MATHS +% +% % vecteurs i et j % utilise la syntax du package xparse non appelé dans le préambule de ce % fichier. @@ -62,22 +75,39 @@ \ensuremath{ \vec{\jmath} } } +% repère (base vectorielle) (O;i;j) +\NewDocumentCommand \oij { } { + \ensuremath{ \left(O\; ;\; \vec{\imath}\; ;\; \vec{\jmath}\right) } +} + +% repère (O;I;I) +\NewDocumentCommand \OIJ { } { + \ensuremath{ \left(O\; ;\; I\; ;\; J\right) } +} + % redéfinition du signe vectoriel -\renewcommand{\Vec}[1]{\overrightarrow{#1\vphantom(}} +\renewcommand{\Vec}[1]{ + \overrightarrow{#1\vphantom(} +} + +% écriture dans un système positionnel +\newcommand{\base}[2]{ + \ensuremath{ \overline{#1\vphantom(}^{#2} } +} % ensembles \NewDocumentCommand \R { s g } { \IfBooleanTF {#1} { \IfNoValueTF {#2} { - \ensuremath{\!\!\! \mathbb{R} \setminus \{0\} \!\!} + \!\!\!\!\ensuremath{\mathbb{R} \setminus \{0\}}\!\!\! }{ - \ensuremath{\!\!\! \mathbb{R} \setminus \{0, #2\} \!\!} + \!\!\!\!\ensuremath{\mathbb{R} \setminus \{0, #2\}}\!\!\! } }{ \IfNoValueTF {#2} { - \ensuremath{\!\!\! \mathbb{R} \!\!} + \!\!\!\!\ensuremath{\mathbb{R}}\!\!\! }{ - \ensuremath{\!\!\! \mathbb{R} \setminus \{#2\} \!\!} + \!\!\!\!\ensuremath{\mathbb{R} \setminus \{#2\}}\!\!\! } } }