-
Notifications
You must be signed in to change notification settings - Fork 6
/
scratch-minimal.sty
174 lines (154 loc) · 5.68 KB
/
scratch-minimal.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
% \mainfolder est ../ si compilation d'un chapitre, sinon c'est vide
\ProvidesPackage{\mainfolder scratch-minimal}
% ----------------------------------------------------------------------
% Je n'utilise pas \RequirePackage car \usepackage est moins geeky ;)
\usepackage{\mainfolder scratch-common}
% ----------------------------------------------------------------------
% Police par defaut
\usepackage{lmodern}
% ----------------------------------------------------------------------
% Format de la page
\usepackage{geometry}
\geometry{a4paper, top=2.5cm, bottom=2cm, left=2.5cm, right=2.5cm, marginparsep=1cm}
\setlength{\parindent}{0cm}
% Espace interligne (+ 21%)
\linespread{1.21}
% ----------------------------------------------------------------------
% Définition d'un terme, mise en relief
\newcommand{\defi}[1]{{\color{myorange}\textbf{\emph{#1}}}}
\newcommand{\evidence}[1]{{\color{blue}\textbf{\emph{#1}}}}
\newcommand{\assertion}[1]{{\og\emph{#1}\fg}} % pour chapitre logique
% ----------------------------------------------------------------------
% Titre du livre
\newcommand{\montitre}[1]{
\begin{center}
\Huge #1
\end{center}
\begin{center}
\LogoExoSept{5}
\end{center}
\tableofcontents
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
}
% ----------------------------------------------------------------------
% Les chapitres
\newcommand{\debutchapitres}{} % on ne fait rien de spécial avant les chapitres
\newcommand{\chapitre}[1]{
\chapter{#1}
}
\newcommand{\finchapitre}{}
% ----------------------------------------------------------------------
% Personnalisation pour les théorèmes,...
\usepackage{amsthm}
\newtheoremstyle{theoremeexo7}% name
{3pt}% Space above
{3pt}% Space below
{\itshape}% Body font
{}% Indent amount
{\bfseries}% Theorem head font
{.\newline}% Punctuation after theorem head
{3pt}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’ )
\newtheoremstyle{definitionexo7}% name
{3pt}% Space above
{3pt}% Space below
{\upshape}% Body font
{}% Indent amount
{\bfseries}% Theorem head font
{.\newline}% Punctuation after theorem head
{3pt}% Space after theorem head
{}% Theorem head spec (can be left empty, meaning ‘normal’ )
\theoremstyle{theoremeexo7}
%\newtheorem{theoreme}{Théorème}
%\newtheorem{proposition}{Proposition}
%\newtheorem*{propriete*}{Propriété}
%\newtheorem{lemme}{Lemme}
%\newtheorem{corollaire}{Corollaire}
\theoremstyle{definitionexo7}
\newtheorem{activite}{Activité}
\newtheorem{enigme}{\'Enigme}
\newtheorem*{exemple}{Exemple}
%\newtheorem*{solution}{Solution}
% ----------------------------------------------------------------------
% Encadrement auteurs
\newcommand{\auteurs}[1]{\textbf{Auteurs} \\
#1
}
% ----------------------------------------------------------------------
% Encadrement des formules
\usepackage{fancybox}
%\setlength{\fboxsep}{7pt}
\newcommand{\mybox}[1]{\begin{center}\shadowbox{#1}\end{center}}
\newcommand{\myboxinline}[1]{\raisebox{-2ex}{\shadowbox{#1}}}
% ---- autre version
% \usepackage{varwidth}
% \tikzset{
% block/.style = {
% minimum height=1em,
% inner xsep=.7em, inner ysep=.35em,
% draw, thick, rounded corners,
% execute at begin node={\begin{varwidth}{\linewidth}\begin{center}},
% execute at end node={\end{center}\end{varwidth}}
% },
% inline/.style = {
% thin, inner sep=.35em,
% fill=white,
% drop shadow={shadow xshift=1pt, shadow yshift=-1pt}
% }
% }
% \newcommand{\mybox}[1]{\begin{center}\tikz{\node[block]{#1};}\end{center}}
% \newcommand{\myboxinline}[1]{\tikz[baseline=(X.base)]{\node[block, inline](X){#1};}}
% ----------------------------------------------------------------------
% Algorithmes
% bloque de code (\insertcode)
\newcommand{\insertcode}[2]{
{\hfill\texttt{\color{gray}#2}}
\begin{center}
\begin{minipage}{0.9\textwidth}
\myinputlisting{#1}
\end{minipage}
\end{center}
}
% code en ligne (\codeinline)
\newcommand{\codeinline}[1]{\lstinline!#1!}
% ----------------------------------------------------------------------
% Package liens hypertexts
% En règle général il doit être le dernier package chargé.
% pdfencoding=auto : d'après http://tex.stackexchange.com/questions/24445
\usepackage[draft, pdfencoding=auto]{hyperref}
\hypersetup{colorlinks=true, linkcolor=blue, urlcolor=blue,
pdftitle={Exo7 - Cours de mathématiques}, pdfauthor={Exo7}}
% --- Liens vers vidéo Youtube
% variable myvideo : 0 pas de video, sinon la référence youtube
\newcommand{\video}[1]{\def\myvideo{#1}}
\newcommand{\insertvideo}[2]{\video{#1}%
{\small\texttt{\href{http://www.youtube.com/watch?v=\myvideo}{Vidéo $\blacksquare$ #2}}}}
% --- Liens vers les fiches d'exercices
\newcommand{\mafiche}[1]{\def\mymafiche{#1}}
\newcommand{\insertfiche}[2]{\mafiche{#1}%
{\small\texttt{\href{http://exo7.emath.fr/ficpdf/\mymafiche}{Fiche d'exercices $\blacklozenge$ #2}}}}
% --- Indication des couleurs (pour couleur #1, pour nb #2)
\newcommand{\couleurnb}[2]{#1}
% Pour afficher/cacher les solutions
\usepackage{comment}
\newenvironment{code}{\begin{center}}{\end{center}}
\newenvironment{solution}{\bigskip\textbf{Solution.}}{}
%\tcolorboxenvironment{solution}{leftlined={3pt}{lightgray,decorate,decoration={name=zigzag}}}
\def\myzero{0}
\ifx \displaysolutions \myzero \excludecomment{solution}\let\endsolution\relax\else\fi
\ifx \displaysolutions \myzero \excludecomment{code}\let\endsolution\relax\else\fi
\newcommand{\onesolution}[3]{
\begin{center}
\textbf{#1 \\ #2}\\
{#3}
\end{center}
}
% Scratch
\usepackage{scratch3}
\setscratch{scale=1.0}
\newcommand{\blockmusic}{\blocksound}
% ----------------------------------------------------------------------
% Constantes pour l'inclusion des figures
\newcommand{\scalebloc}{1.2}
\newcommand{\scalesolution}{0.5}
\newcommand{\scaleecran}{0.8}