cours.cls 6.92 KB
Newer Older
1
\NeedsTeXFormat{LaTeX2e}
Pierre-antoine Comby's avatar
Pierre-antoine Comby committed
2
\ProvidesClass{../../cours}[2019/01/09 LaTeX class for Lessons]
3 4 5 6 7 8
\makeatletter
% Base Class

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}


9 10 11 12
% Custom arguments
\def\teacher#1{\gdef\@teacher{#1}}
\def\module#1{\gdef\@module{#1}}

13 14 15 16 17 18
\ProcessOptions\relax
% Main packages

\LoadClass[12pt,a4paper,french,titlepage]{book}

\RequirePackage[french]{babel} % pour ecrire en francais
19
\RequirePackage[left=2.00cm, right=2.00cm, top=3.00cm, bottom=3.00cm,headheight=15pt]{geometry} % la mise en page
20 21 22

% Packages
\RequirePackage[utf8]{inputenc} % encodage
23
\RequirePackage[T1]{fontenc}
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
\RequirePackage{fancyhdr} % la mise en page
\RequirePackage[dvipsnames,x11names]{xcolor} % Un peu de couleur !
\RequirePackage{float}
\RequirePackage{subcaption}
\RequirePackage{subfiles}
\RequirePackage{hyperref}
\hypersetup{
    unicode=true,            % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,         % show Acrobat’s toolbar?
    pdfmenubar=true,         % show Acrobat’s menu?
    pdffitwindow=false,      % window fit to page when opened
    pdfstartview={FitH},     % fits the width of the page to the window
    pdftitle=\@title,      % title
    pdfauthor=\@author,    % author
    colorlinks=true,         % false: boxed links; true: colored links
    linkcolor=black,      % color of internal links
    citecolor=OliveGreen,    % color of links to bibliography
    filecolor=magenta,       % color of file links
    urlcolor=BlueViolet      % color of external links
}
\RequirePackage{tikz}
\usetikzlibrary{fit}
\usetikzlibrary{positioning}
47 48 49 50 51 52 53 54 55 56
\RequirePackage{schemabloc} 
\RequirePackage[european,cuteinductors,siunitx,straightvoltages]{circuitikz}
\tikzset{every picture/.style={execute at begin picture={\shorthandoff{:;!?};}}}
\usetikzlibrary{positioning, fit, calc}
\RequirePackage{pgfplots}
\RequirePackage{mathtools}
\RequirePackage{amsfonts}
\RequirePackage{mathrsfs}
\RequirePackage{amssymb}
\RequirePackage[section]{placeins} % Oblige a placer toutes les figures avant de passer a la section suivante
57

58 59 60
\RequirePackage{fancyhdr}
\pagestyle{fancy}
  \fancyhf {}
61

62

63
\renewcommand{\chaptermark}[1]{\markboth{\bsc{\@chapapp~\thechapter{}~:} #1}{}}
64 65 66 67

  \renewcommand{\sectionmark}[1]{\markright{\thesection.{} #1}}
  \renewcommand{\headrulewidth}{1pt}   %Epaisseur de la ligne.
  \renewcommand{\footrulewidth}{1pt}   %Epaisseur de la ligne.
68 69 70 71 72 73 74
  \fancyhead[LE]{\textsl{\leftmark}}
  \fancyhead[LO]{{}}
  \fancyhead[RO]{\textsl{\rightmark}}
  \fancyhead[RE]{{}}
  \fancyfoot[C]{\textit{\thepage}}
  \fancyfoot[L]{\textsl{\@module}}
  \fancyfoot[R]{M1 IST-E3A}
75

76
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
77 78
%%%%%%%%%%%%%%%%%%% Custom title Page %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Pierre-antoine Comby's avatar
Pierre-antoine Comby committed
79
\RequirePackage{setspace}
80 81
\renewcommand{\maketitle}{%
  \begin{titlepage}
82 83 84 85
    \centering
    \vspace*{-2cm}
    \includegraphics[width=\linewidth]{../../img/bandeau-master-e3a}\\
    \vspace{1cm}
86 87 88 89 90 91 92
		{\huge \textsc{M1 E3A - Voie André Ampère}}
		\vspace{1cm}
        % \includegraphics[height=4cm]{Saphire} \\
        \vfill
        \@ifundefined{@module}
        {}
        {%
Pierre-antoine Comby's avatar
Pierre-antoine Comby committed
93
          \baselineskip=2\baselineskip
94
          {\Huge \textbf{\textsc{\@module}}}\\
95
          %\baselineskip=0.5\baselineskip
96
        }\vfill
97 98
        \@ifundefined{@title}
        {}
99 100 101
        {%
          \baselineskip=2\baselineskip
          {\Huge \textbf{\textsc{\@title}}}\\
102
          \baselineskip=0.5\baselineskip
103 104
        }\vfill
        {\LARGE\textbf{Note de Cours}}
105
        \vfill
Pierre-antoine Comby's avatar
Pierre-antoine Comby committed
106
        \@ifundefined{@date}{}{%
107
 		{\LARGE Version du \@date}
108 109 110 111
        \vfill}
      \@ifundefined{@author}
        {}{%
          {\Large
112 113 114 115 116 117 118
            \begin{minipage}[t]{0.5\linewidth}
              \raggedright
              \underline{Un cours de:} \\
              \textsc{\@teacher}
            \end{minipage}\hfill
            \begin{minipage}[t]{0.5\linewidth}
              \raggedleft
119
              \underline{Pris en note par:} \\
120 121 122
              \textsc{\@author}
            \end{minipage}
          }}\\
123 124 125 126 127 128
    \vspace{1cm}
	\includegraphics[width=6cm]{../../img/ENSPS}
	\hfill
	\includegraphics[width=6cm]{../../img/UPS}\\
	\vspace{0.5cm}
	\includegraphics[width=\linewidth]{../../img/bandeau-eea}
129 130 131 132 133 134
	\end{titlepage}}

% pas de début de section dans la moitié inférieure d'une page

  \RequirePackage{needspace}

135 136 137 138 139 140 141
%  \renewcommand{\section}{
    % \needspace{0.2\textheight}%
    % \@startsection {section}{1}{\z@}%
	% {-3.5ex \@plus -1ex \@minus -.2ex}%
	% {2.3ex \@plus.2ex}%
	% {\reset@font\Large\bfseries}
%  }
142 143 144 145
\raggedbottom

\setcounter{secnumdepth}{3}
\renewcommand{\thesection}{\arabic{section}}
146 147 148 149 150 151 152
\RequirePackage{titletoc}
\titlecontents*{chapter}% <section-type>
  [0pt]% <left>
  {}% <above-code>
  {\bfseries \thecontentslabel\quad}% <numbered-entry-format>
  {}% <numberless-entry-format>
  {\bfseries\hfill\contentspage}% <filler-page-format>
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% BOITES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\RequirePackage{tikz,environ}
\tikzstyle{mybox} = [draw=black, very thick,
    rectangle, inner sep=10pt, inner ysep=20pt]
\tikzstyle{fancytitle} = [draw=black, fill=white, text=black]

\NewEnviron{defin}{\par
\begin{center}
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.8\textwidth}
    	\BODY
	\end{minipage} };
\node[fancytitle, right=10pt] at (box.north west) {\textbf{Définition}};
\end{tikzpicture}\end{center}\par
}

% \NewEnviron{thm}{\par
% \begin{center}
% \begin{tikzpicture}
% \node [mybox] (box){%
%     \begin{minipage}{0.8\textwidth}
%     	\BODY
% 	\end{minipage} };
% \node[fancytitle, right=10pt] at (box.north west) {\textbf{Théorème}};
% \end{tikzpicture}\end{center}\par
%}

\RequirePackage{thmbox}
\RequirePackage{xparse}
\NewDocumentEnvironment{prop}{o}{%
\begin{center}\begin{minipage}{0.8\textwidth}
  \thmbox[M]{\textbf{Proposition \IfNoValueTF{#1}{}{\em (#1)}}}%
  %\hspace*{-1.5em}%
  }
  {%
  \endthmbox\vspace*{.75ex}\end{minipage}\end{center}%
  }

\NewDocumentEnvironment{thm}{o}{%
\begin{center}\begin{minipage}{0.8\textwidth}
  \thmbox[M]{\textbf{Théorème \IfNoValueTF{#1}{}{\em (#1)}}}%
  %\hspace*{-1.5em}%
  }
  {%
  \endthmbox\vspace*{.75ex}\end{minipage}\end{center}%
  }


\NewDocumentEnvironment{corol}{o}{%
	\begin{center}\begin{minipage}{0.8\textwidth}
			\thmbox[M]{\textbf{Corollaire \IfNoValueTF{#1}{}{\em (#1)}}}%
			%\hspace*{-1.5em}%
		}
		{%
			\endthmbox\vspace*{.75ex}\end{minipage}\end{center}%
}

217
\NewDocumentEnvironment{lemme}{o}{%
218
	\begin{center}\begin{minipage}{0.8\textwidth}
219
			\thmbox[M]{\textbf{Lemme \IfNoValueTF{#1}{}{\em (#1)}}}%
220 221 222 223 224 225
			%\hspace*{-1.5em}%
		}
		{%
			\endthmbox\vspace*{.75ex}\end{minipage}\end{center}%
}

226 227 228
\newenvironment{rem}{\par\medbreak
   \noindent\textbf{Remarque: }\nopagebreak}{\medbreak\par}
\newenvironment{exemple}[1][\unskip]{\par\medbreak\noindent\textbf{Exemple: }\textit{#1}  \nopagebreak}{\bigbreak\par}
229
\newenvironment{preuve}{\par\textit{Démonstration: }\nopagebreak}{\par}