2016-03-22 11:49:55 +00:00
|
|
|
%%%
|
|
|
|
%%%
|
|
|
|
%%% Extensions : commun.sty
|
|
|
|
%%% Version : 1.0
|
|
|
|
%%% Date : 03/05/15
|
2016-08-11 16:04:08 +00:00
|
|
|
%%%
|
|
|
|
%%% Version : 2.0
|
|
|
|
%%% Date : 11/08/16
|
|
|
|
%%% Mods : Change some packages call to be compatible with LuaLaTeX
|
|
|
|
%%%
|
2016-03-22 11:49:55 +00:00
|
|
|
%%% Auteur : Jeff LANCE
|
|
|
|
%%%
|
|
|
|
%%%
|
|
|
|
|
|
|
|
\NeedsTeXFormat{LaTeX2e}
|
2017-03-19 15:23:56 +00:00
|
|
|
\ProvidesPackage{commun}[2015/05/03 Ensembles d'environnements et de fonctions
|
|
|
|
utilisables partout, v2.0]
|
2016-03-22 11:49:55 +00:00
|
|
|
|
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
%
|
|
|
|
%
|
|
|
|
% PACKAGES
|
|
|
|
%
|
|
|
|
%
|
2017-03-19 17:05:13 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% development
|
2016-08-12 10:41:05 +00:00
|
|
|
\RequirePackage{xifthen}
|
|
|
|
\RequirePackage{ifmtarg}
|
|
|
|
\RequirePackage{ifpdf}
|
|
|
|
\RequirePackage{xstring}
|
|
|
|
\RequirePackage{multido}
|
|
|
|
\RequirePackage{xparse}
|
|
|
|
\RequirePackage{etoolbox}
|
|
|
|
\RequirePackage{ifluatex}
|
2016-09-27 09:55:38 +00:00
|
|
|
\RequirePackage{import}
|
2016-08-12 10:41:05 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% language
|
2016-08-12 10:41:05 +00:00
|
|
|
\ifluatex
|
2017-05-12 19:24:21 +00:00
|
|
|
\RequirePackage{polyglossia} % => babel
|
|
|
|
\setdefaultlanguage{french} % => inputenc
|
|
|
|
\RequirePackage{luatextra} % charge fontspec => fontenc
|
2018-02-16 14:56:32 +00:00
|
|
|
% \defaultfontfeatures{Ligatures=TeX}
|
2016-08-12 10:41:05 +00:00
|
|
|
\else
|
2017-05-12 19:24:21 +00:00
|
|
|
\RequirePackage[francais]{babel} % => polyglossia
|
|
|
|
\RequirePackage[utf8]{inputenc} % => fontspec
|
|
|
|
\RequirePackage[T1]{fontenc} % => fontspec
|
2016-08-12 10:41:05 +00:00
|
|
|
\fi
|
2016-08-11 16:04:08 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% fonts
|
2016-03-22 11:49:55 +00:00
|
|
|
\RequirePackage{libertine}
|
2016-08-12 09:48:12 +00:00
|
|
|
\RequirePackage{pifont}
|
|
|
|
\RequirePackage{fontawesome}
|
2016-03-22 11:49:55 +00:00
|
|
|
\RequirePackage{eurosym}
|
2017-03-29 13:43:07 +00:00
|
|
|
%\RequirePackage{bbding}
|
2016-08-12 09:48:12 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% color and graphics
|
2016-08-13 10:49:10 +00:00
|
|
|
\ifluatex
|
|
|
|
\RequirePackage{luacolor}
|
|
|
|
\fi
|
2016-04-07 20:21:19 +00:00
|
|
|
\RequirePackage{xcolor}
|
2016-05-10 12:22:19 +00:00
|
|
|
\RequirePackage[framemethod=tikz]{mdframed}
|
2016-06-12 16:12:47 +00:00
|
|
|
\RequirePackage{graphicx}
|
2017-03-02 00:19:30 +00:00
|
|
|
\RequirePackage{transparent}
|
2016-03-22 11:49:55 +00:00
|
|
|
|
|
|
|
% maths
|
|
|
|
\RequirePackage{amsmath}
|
|
|
|
\RequirePackage{amssymb}
|
|
|
|
\RequirePackage{tkz-euclide}
|
2016-12-28 01:19:41 +00:00
|
|
|
\usetikzlibrary{shadows}
|
2016-03-22 11:49:55 +00:00
|
|
|
\RequirePackage{calc}
|
|
|
|
\RequirePackage{pgfplots}
|
2018-08-20 13:38:13 +00:00
|
|
|
\pgfplotsset{compat=1.13}
|
2016-08-13 23:34:31 +00:00
|
|
|
\RequirePackage{siunitx}
|
2016-03-22 11:49:55 +00:00
|
|
|
\RequirePackage{asymptote}
|
2016-05-28 21:16:55 +00:00
|
|
|
\RequirePackage{mathrsfs}
|
2017-05-12 19:24:21 +00:00
|
|
|
\RequirePackage{tabvar}
|
2016-03-22 11:49:55 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% tables
|
2016-03-22 11:49:55 +00:00
|
|
|
\RequirePackage{array}
|
|
|
|
\RequirePackage{tabularx}
|
2016-05-11 12:58:49 +00:00
|
|
|
\RequirePackage{multicol}
|
2017-02-17 17:27:18 +00:00
|
|
|
\RequirePackage{boldline}
|
2016-03-23 14:24:40 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% layout
|
2016-08-16 15:17:16 +00:00
|
|
|
\RequirePackage{varwidth}
|
2016-12-14 17:37:20 +00:00
|
|
|
\RequirePackage{adjustbox}
|
2017-05-12 19:24:21 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% text
|
2017-05-12 19:24:21 +00:00
|
|
|
\RequirePackage[dash,phantomtext]{dashundergaps}
|
2018-08-19 17:58:59 +00:00
|
|
|
\RequirePackage{comment}
|
2018-08-20 13:59:45 +00:00
|
|
|
|
|
|
|
|
2016-03-22 11:49:55 +00:00
|
|
|
|
2017-02-17 15:27:44 +00:00
|
|
|
\makeatletter
|
2016-03-22 11:49:55 +00:00
|
|
|
|
2016-05-12 19:55:28 +00:00
|
|
|
|
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
%
|
|
|
|
%
|
|
|
|
% SETTINGS
|
|
|
|
%
|
|
|
|
%
|
2016-03-22 11:49:55 +00:00
|
|
|
|
2018-08-19 17:58:59 +00:00
|
|
|
\newboolean{display}
|
|
|
|
\ifthenelse{\boolean{display}}{\includecomment{solution}}{\excludecomment{solution}}
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
%
|
|
|
|
%
|
|
|
|
% MACROS
|
|
|
|
%
|
|
|
|
%
|
2018-08-19 17:58:59 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% Tableau
|
|
|
|
% Alignment commands of the content in the column with a defined width.
|
2017-03-19 17:05:13 +00:00
|
|
|
|
2016-09-30 22:48:12 +00:00
|
|
|
\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}}
|
2016-03-22 11:49:55 +00:00
|
|
|
%% lh{largeur} : gauche - haut
|
|
|
|
%\newcolumntype{lh}[1]{>{\raggedright}p{#1}}
|
|
|
|
%% ch{largeur} : centre - haut
|
|
|
|
%\newcolumntype{ch}[1]{>{\centering\arraybackslash}p{#1}}
|
|
|
|
%% rh{largeur} : droite - haut
|
|
|
|
%\newcolumntype{rh}[1]{>{\raggedleft}p{#1}}
|
|
|
|
%% lc{largeur} : gauche - centre
|
|
|
|
%\newcolumntype{lc}[1]{>{\raggedright}m{#1}}
|
|
|
|
%% cc{largeur} : centre - centre
|
2016-09-30 22:48:12 +00:00
|
|
|
% \newcolumntype{M}[1]{ >{\centering\arraybackslash} m{#1} }
|
2016-03-22 11:49:55 +00:00
|
|
|
%% rc{largeur} : droite - centre
|
|
|
|
%\newcolumntype{rc}[1]{>{\raggedleft}m{#1}}
|
|
|
|
%% lb{largeur} : gauche - bas
|
|
|
|
%\newcolumntype{lb}[1]{>{\raggedright}b{#1}}
|
|
|
|
%% cb{largeur} : centre - bas
|
|
|
|
%\newcolumntype{cb}[1]{>{\centering}b{#1}}
|
|
|
|
%% rb{largeur} : droite - bas
|
|
|
|
%\newcolumntype{rb}[1]{>{\raggedleft}b{#1}}
|
2016-03-23 14:24:40 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% Item in a tab.
|
2016-08-29 21:06:06 +00:00
|
|
|
\newcommand{\tabitem}{~~\llap{\textbullet}~~}
|
2016-04-07 20:21:19 +00:00
|
|
|
|
2017-03-19 17:05:13 +00:00
|
|
|
|
2018-08-19 17:58:59 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
%
|
|
|
|
%
|
|
|
|
% Texte
|
|
|
|
%
|
|
|
|
%
|
2017-05-12 19:24:21 +00:00
|
|
|
|
2017-03-19 17:05:13 +00:00
|
|
|
% \hcancel[color][size]{text}
|
2018-08-20 13:59:45 +00:00
|
|
|
% Strike text with a color and a defined thickness.
|
2016-04-07 20:21:19 +00:00
|
|
|
\newcommand\hcancel[2][black]{
|
|
|
|
\setbox0=\hbox{$#2$}%
|
2017-05-12 19:24:21 +00:00
|
|
|
\rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{1pt}}}}#2
|
2016-04-07 20:21:19 +00:00
|
|
|
}
|
2016-05-10 19:16:31 +00:00
|
|
|
|
2017-03-19 17:05:13 +00:00
|
|
|
% \circled{text}
|
2018-08-20 13:59:45 +00:00
|
|
|
% Circled text.
|
2017-03-19 17:05:13 +00:00
|
|
|
\newcommand*\circled[1]{
|
|
|
|
\tikz[baseline=(char.base)]{
|
|
|
|
\node[shape=circle,draw,inner sep=2pt] (char) {#1};
|
|
|
|
}
|
|
|
|
}
|
2017-03-29 19:38:03 +00:00
|
|
|
|
|
|
|
% \keystroke{text}
|
2018-08-20 13:59:45 +00:00
|
|
|
% Boxed text as a keyboard key.
|
|
|
|
% Why: menukeys and tipfr packages don't really run correctly with beamer.
|
2017-03-29 19:38:03 +00:00
|
|
|
\newcommand*\keystroke[1]{%
|
|
|
|
\tikz[baseline=(key.base)]
|
|
|
|
\node[%
|
|
|
|
draw,
|
|
|
|
fill=white,
|
|
|
|
drop shadow={shadow xshift=0.25ex,shadow yshift=-0.25ex,fill=black,opacity=0.75},
|
|
|
|
rectangle,
|
|
|
|
rounded corners=2pt,
|
|
|
|
inner sep=1pt,
|
|
|
|
line width=0.5pt,
|
|
|
|
font=\scriptsize\sffamily
|
|
|
|
](key) {#1\strut}
|
|
|
|
;
|
|
|
|
}
|
2017-03-19 17:05:13 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
%---------------------------------------------
|
|
|
|
% \NewDocumentCommand \hcancel { O{black} O{1pt} } {
|
|
|
|
% \setbox0=\hbox{$#3$}%
|
|
|
|
% \rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{#2}}}} {#3}
|
|
|
|
% }
|
|
|
|
|
|
|
|
% \NewDocumentCommand \solution { s O{solution} g } {
|
|
|
|
% \IfBooleanTF {#1}
|
|
|
|
% {
|
|
|
|
% \setboolean{display}{true}
|
|
|
|
% }
|
|
|
|
% {}
|
|
|
|
% \begin{#2}
|
|
|
|
% \end{#2}
|
|
|
|
% }
|
|
|
|
|
|
|
|
%% \underdash[color]{text}
|
|
|
|
%\newcommand\underdash[1][black]{% <- règle la couleur du texte
|
|
|
|
% \bgroup
|
|
|
|
% \ifdim\ULdepth=\maxdimen\settodepth\ULdepth{(j}\advance\ULdepth.4pt\fi
|
|
|
|
% \markoverwith{\kern0.2em% <- règle l'espacement avant un pointillé
|
|
|
|
% \vtop{
|
|
|
|
% \kern0.5ex% <- règle l'altitude des pointillés
|
|
|
|
% {\color{black}% <- règle la couleur des pointillés
|
|
|
|
% \hrule width.4em% <- règle la largeur des pointillés
|
|
|
|
% }
|
|
|
|
% }
|
|
|
|
% \kern0.2em% <- règle l'espacement après un pointillé
|
|
|
|
% }
|
|
|
|
% \color{#1}\ULon
|
|
|
|
%}
|
|
|
|
%---------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%
|
|
|
|
%
|
|
|
|
% Fonts
|
|
|
|
%
|
|
|
|
%
|
2017-03-19 17:05:13 +00:00
|
|
|
|
2017-03-18 20:34:36 +00:00
|
|
|
\newfontfamily\Annie[Ligatures=TeX]{Annie Use Your Telescope}
|
|
|
|
\newfontfamily\Architects[Ligatures=TeX]{Architects Daughter}
|
2017-03-19 15:21:14 +00:00
|
|
|
\newfontfamily\Bristol[Ligatures=TeX]{Bristol}
|
2017-05-12 19:24:21 +00:00
|
|
|
\newfontfamily\ChelseaMarket[Ligatures=TeX]{Chelsea Market}
|
2017-03-19 15:21:14 +00:00
|
|
|
\newfontfamily\Comic[Ligatures=TeX]{Comic Sans MS}
|
2017-03-18 20:34:36 +00:00
|
|
|
\newfontfamily\Delius[Ligatures=TeX]{Delius}
|
|
|
|
\newfontfamily\DeliusSC[Ligatures=TeX]{Delius Swash Caps}
|
2017-03-19 15:21:14 +00:00
|
|
|
\newfontfamily\FingerPaint[Ligatures=TeX]{Finger Paint}
|
|
|
|
\newfontfamily\Handlee[Ligatures=TeX]{Handlee}
|
|
|
|
\newfontfamily\Julee[Ligatures=TeX]{Julee}
|
2017-03-18 20:34:36 +00:00
|
|
|
\newfontfamily\NixieOne[Ligatures=TeX]{Nixie One}
|
2017-03-19 15:21:14 +00:00
|
|
|
\newfontfamily\PenguinAttack[Ligatures=TeX]{PenguinAttack}
|
2017-03-01 17:43:39 +00:00
|
|
|
\newfontfamily\PokemonHollow[Ligatures=TeX]{Pokemon Hollow}
|
|
|
|
\newfontfamily\PokemonSolid[Ligatures=TeX]{Pokemon Solid}
|
2017-03-01 17:42:14 +00:00
|
|
|
\newfontfamily\ScratchedLetters[Ligatures=TeX]{Scratched Letters}
|
2018-08-19 17:58:59 +00:00
|
|
|
% \newfontfamily\TrebuchetMS[Ligatures=TeX]{Trebuchet MS}
|
2018-08-20 13:59:45 +00:00
|
|
|
|
|
|
|
%--------------------------------------------------------
|
|
|
|
% Intent for a more general command.
|
2016-08-16 15:17:16 +00:00
|
|
|
% \NewDocumentCommand \setFont { O{\familydefault} O{\encodingdefault} }{%
|
|
|
|
% \fontencoding{#2}%
|
|
|
|
% \fontfamily{#1}%
|
|
|
|
% \selectfont
|
|
|
|
% }
|
2018-08-20 13:59:45 +00:00
|
|
|
%--------------------------------------------------------
|
2017-01-03 22:55:55 +00:00
|
|
|
|
2017-01-04 18:34:35 +00:00
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
|
|
|
|
%
|
|
|
|
%
|
|
|
|
% Colors
|
|
|
|
%
|
|
|
|
%
|
|
|
|
|
2017-03-19 15:21:14 +00:00
|
|
|
% \newColorCommand{color}
|
|
|
|
% Create a macro which can be accessed with the name "\color".
|
|
|
|
% This macro make the following text to be colored in color.
|
|
|
|
\newcommand\newColorCommand[1]{%
|
|
|
|
\expandafter\newcommand\csname #1\endcsname{\color{#1}}}
|
|
|
|
|
2018-08-20 13:59:45 +00:00
|
|
|
% Create some color commands
|
2017-03-19 15:21:14 +00:00
|
|
|
\newColorCommand{red}
|
|
|
|
\newColorCommand{white}
|
2017-03-29 15:53:10 +00:00
|
|
|
\newColorCommand{gray}
|
2016-03-22 11:49:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\makeatother
|