latex-homework/shortcuts/shortcuts.sty

206 lines
4.1 KiB
Plaintext
Raw Normal View History

2017-02-17 15:06:56 +00:00
%%%
%%%
2017-03-19 15:27:16 +00:00
%%% Extensions : shortcuts.sty
%%% Version : 1.0
%%% Date : 10/05/16
%%% Auteur : Jeff LANCE
2016-05-28 21:33:38 +00:00
%%% Notes : Cette extension peut demander l'ajout de certains packages.
%%% Il est conseillé de l'appeler dans un(e) classe/(package) appelant
%%% elle(lui)-même ces packages.
%%%
%%%
\NeedsTeXFormat{LaTeX2e}
2017-03-19 15:22:05 +00:00
\ProvidesPackage{shortcuts}[2016/05/16 Définitions de raccourcis vers des macros
existantes, v1.0]
2017-02-17 14:09:27 +00:00
\makeatletter
2018-10-04 20:32:37 +00:00
%
%
% ENVIRONMENTS
%
%
2018-11-04 09:16:13 +00:00
% itemize
\newcommand{\bi}{\begin{itemize}}
\newcommand{\ei}{\end{itemize}}
% enumerate
\newcommand{\be}{\begin{enumerate}}
\newcommand{\ee}{\end{enumerate}}
% descriptions
\newcommand{\bd}{\begin{description}}
\newcommand{\ed}{\end{description}}
% questions
\newcommand{\bq}{\begin{questions}}
\newcommand{\eq}{\end{questions}}
2018-11-04 09:16:13 +00:00
%--
2016-05-28 21:20:44 +00:00
2016-05-28 21:33:38 +00:00
2018-10-04 20:32:37 +00:00
%
%
% TEXT
%
%
2018-11-04 09:16:13 +00:00
2018-10-16 21:08:59 +00:00
% another shortcut to whiting text.
\NewDocumentCommand \ghost { } {%
\white
}
2016-08-11 16:20:46 +00:00
% c'est-à-dire
\NewDocumentCommand \cad { } {
{c'est-à-dire}
}
\NewDocumentCommand \Cad { } {
{C'est-à-dire}
}
2016-08-11 16:20:46 +00:00
2018-10-20 06:56:57 +00:00
% smileys
\NewDocumentCommand \wink { } {
{\DejaVuSans 😉}
}
%\NewDocumentCommand \smile { } {
% {\DejaVuSans 😃}
%}
\NewDocumentCommand \lol { } {
{\DejaVuSans 😂}
}
\NewDocumentCommand \sad { } {
{\DejaVuSans 😞}
}
2018-11-04 09:16:13 +00:00
%--
2018-10-20 06:56:57 +00:00
2018-10-04 20:32:37 +00:00
%
%
% MATHS
%
%
2018-11-04 09:16:13 +00:00
2018-10-16 21:08:59 +00:00
% i & j vectors
2016-05-28 21:20:44 +00:00
\NewDocumentCommand \veci { } {
\ensuremath{ \vec{\imath} }
2016-05-28 21:20:44 +00:00
}
\NewDocumentCommand \vecj { } {
\ensuremath{ \vec{\jmath} }
2016-05-28 21:20:44 +00:00
}
2018-10-16 21:08:59 +00:00
% frame (O;i;j)
2018-10-04 20:32:37 +00:00
\NewDocumentCommand \oij { } {
\ensuremath{ \left(O\; ;\; \vec{\imath}\; ;\; \vec{\jmath}\right) }
}
2018-10-16 21:08:59 +00:00
% frame (O;I;I)
2018-10-04 20:32:37 +00:00
\NewDocumentCommand \OIJ { } {
\ensuremath{ \left(O\; ;\; I\; ;\; J\right) }
}
2018-10-16 21:08:59 +00:00
% frame (O;x;y)
\NewDocumentCommand \oxy { } {
\ensuremath{ \left(O\; ;\; x\; ;\; y\right) }
}
% vector arrow redefinition
2018-10-04 20:32:37 +00:00
\renewcommand{\Vec}[1]{
\overrightarrow{#1\vphantom(}
}
2018-10-16 21:08:59 +00:00
% positional notation
2018-10-04 20:32:37 +00:00
\newcommand{\base}[2]{
\ensuremath{ \overline{#1\vphantom(}^{#2} }
}
2018-09-25 04:42:35 +00:00
2018-10-16 21:08:59 +00:00
% sets: N, Z, D, Q, R\Q and R with possibility to minus some numbers
2016-08-16 11:17:38 +00:00
\NewDocumentCommand \R { s g } {
\IfBooleanTF {#1} {
\IfNoValueTF {#2} {
2018-10-04 20:32:37 +00:00
\!\!\!\!\ensuremath{\mathbb{R} \setminus \{0\}}\!\!\!
}{
2018-10-04 20:32:37 +00:00
\!\!\!\!\ensuremath{\mathbb{R} \setminus \{0, #2\}}\!\!\!
}
}{
\IfNoValueTF {#2} {
2018-10-04 20:32:37 +00:00
\!\!\!\!\ensuremath{\mathbb{R}}\!\!\!
}{
2018-10-04 20:32:37 +00:00
\!\!\!\!\ensuremath{\mathbb{R} \setminus \{#2\}}\!\!\!
}
}
}
\NewDocumentCommand \RQ { } {
2016-08-16 11:14:07 +00:00
\( \mathbb{R} \setminus \mathbb{Q} \)
}
2016-08-16 11:14:07 +00:00
\NewDocumentCommand \Q { s g } {
\IfBooleanTF {#1} {
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{Q} \setminus \{0\} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{Q} \setminus \{0, #2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}{
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{Q} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{Q} \setminus \{#2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}
}
2016-08-16 11:14:07 +00:00
\NewDocumentCommand \D { s g } {
\IfBooleanTF {#1} {
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{D} \setminus \{0\} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{D} \setminus \{0, #2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}{
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{D} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{D} \setminus \{#2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}
}
2016-08-16 11:14:07 +00:00
\NewDocumentCommand \Z { s g } {
\IfBooleanTF {#1} {
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{Z} \setminus \{0\} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{Z} \setminus \{0, #2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}{
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{Z} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{Z} \setminus \{#2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}
}
2016-08-16 11:14:07 +00:00
\NewDocumentCommand \N { s g } {
\IfBooleanTF {#1} {
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{N} \setminus \{0\} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{N} \setminus \{0, #2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}{
\IfNoValueTF {#2} {
\ensuremath{\!\!\! \mathbb{N} \!\!}
2016-08-16 11:14:07 +00:00
}{
\ensuremath{\!\!\! \mathbb{N} \setminus \{#2\} \!\!}
2016-08-16 11:14:07 +00:00
}
}
}
2018-11-04 09:16:13 +00:00
%--
2017-02-17 14:09:27 +00:00
\makeatother