latex-homework/commun/commun.sty

152 lines
3.4 KiB
Plaintext
Raw Normal View History

2016-03-22 11:49:55 +00:00
%%%
%%%
%%% Extensions : commun.sty
%%% Version : 1.0
%%% Date : 03/05/15
%%% Auteur : Jeff LANCE
%%%
%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{commun}[2015/05/03 Extensions et definitions globales, v1.0]
%-- extensions
% langue et police
\RequirePackage[francais]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{libertine}
\RequirePackage{eurosym}
\RequirePackage{bbding}
\RequirePackage{xcolor}
\RequirePackage[framemethod=tikz]{mdframed}
2016-03-22 11:49:55 +00:00
% maths
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{tkz-euclide}
\RequirePackage{calc}
\RequirePackage{pgfplots}
\RequirePackage[amssymb, squaren, pstricks]{SIunits}
\RequirePackage{asymptote}
% \RequirePackage{cancel}
2016-03-22 11:49:55 +00:00
% programmation
\RequirePackage{xifthen}
2016-03-22 11:49:55 +00:00
\RequirePackage{ifmtarg}
\RequirePackage{ifpdf}
\RequirePackage{xstring}
\RequirePackage{multido}
\RequirePackage{xparse}
% tableau
\RequirePackage{array}
\RequirePackage{tabularx}
% liste
2016-03-31 17:49:20 +00:00
%\RequirePackage{enumitem}
2016-03-22 11:49:55 +00:00
%-- %
%% MACROS : DEBUT
\makeatletter
%-- Macros personnelles
% Pour environnement \tabular commandes d'alignement du contenu
% dans la colonne de largeur <largeur>.
%% 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-03-31 17:49:20 +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-31 17:49:20 +00:00
% questions<[type]>
%
% type = 1 -> \arabic
% type = a -> \alph
% type = A -> \Alph
% type = i -> \roman
% type = I -> \Roman
% \arabic par défaut
\newcounter{questionscounter}
\newcommand{\questionsseparator}{.}
\newenvironment{questions}[1][1] {
\ifthenelse{ \equal{#1}{i} }
{
\def\cType{\roman}
\renewcommand{\questionsseparator}{)}
}
{
\ifthenelse{ \equal{#1}{I} }
{
\def\cType{\Roman}
\renewcommand{\questionsseparator}{.}
}
{
\ifthenelse{ \equal{#1}{a} }
{
\def\cType{\alph}
\renewcommand{\questionsseparator}{)}
}
{
\ifthenelse{ \equal{#1}{A} }
{
\def\cType{\Alph}
\renewcommand{\questionsseparator}{.}
}
{
\def\cType{\arabic}
\renewcommand{\questionsseparator}{.}
}
}
}
}
\begin{list}{\textbf{\cType{questionscounter}\questionsseparator}}{
\usecounter{questionscounter}
\itemindent=0em
\itemsep=8pt \leftmargin=0,54cm}
} {
\end{list}
}
\newcommand{\bq}{\begin{questions}}
\newcommand{\eq}{\end{questions}}
2016-04-05 14:51:34 +00:00
% enumerate
\newcommand{\be}{\begin{enumerate}}
\newcommand{\ee}{\end{enumerate}}
% itemize
\newcommand{\bi}{\begin{itemize}}
\newcommand{\ei}{\end{itemize}}
\newcommand\hcancel[2][black]{
\setbox0=\hbox{$#2$}%
\rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{2pt}}}}#2
}
% \NewDocumentCommand \hcancel { O{black} O{1pt} } {
% \setbox0=\hbox{$#3$}%
% \rlap{\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{#2}}}} {#3}
% }
2016-03-22 11:49:55 +00:00
%--%
% Macros modifiées
% - %
\makeatother
%% MACROS : FIN