summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/frenchmath/frenchmath.sty
blob: bfa9bedfda79f267cbb36df43cf20f1bc33e6e20 (plain)
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
%%
%% This is file `frenchmath.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% frenchmath.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2019-2024 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3 of this license
%% or (at your option) any later version. The latest version of this
%% license is in:
%% 
%% http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{frenchmath}
    [2024/05/07 v3.1 .dtx Typesetting mathematics according to French rules]

\newif\iffrenchmath@capsit
\DeclareOption{capsit}{\frenchmath@capsittrue}
\newif\iffrenchmath@noibrackets
\DeclareOption{noibrackets}{\frenchmath@noibracketstrue}
\newif\iffrenchmath@mathgreeks
\DeclareOption*{\frenchmath@mathgreekstrue
    \PassOptionsToPackage{\CurrentOption,upright}{mathgreeks}}
\ProcessOptions \relax

\RequirePackage{amsopn} % fournit \DeclareMathOperator
\RequirePackage{xspace} % utile pour les commandes \ssi, \Oij
\RequirePackage{etoolbox} % fournit \AtEndPreamble
\iffrenchmath@mathgreeks \RequirePackage{mathgreeks} \fi
\AtEndPreamble{
  \RequirePackage{decimalcomma}
  \iffrenchmath@noibrackets\else\RequirePackage{ibrackets}\fi
  \@ifpackageloaded{mathptmx}{\let\jmath\@undefined}{}
  \@ifundefined{jmath}{\RequirePackage{dotlessj}}{}
  \@ifpackageloaded{pstricks-add}{\psset{comma=true}}{}
}

\providecommand*\DeclareMathUp[1]{
    \DeclareMathSymbol{#1}{\mathalpha}{operators}{`#1}}

\def\apply#1#2{\apply@#1#2,\apply@,}
\def\apply@#1#2,{\ifx\apply@#2\empty
    \else #1{#2}\afterfi@{\apply@#1}\fi}
\def\afterfi@#1#2\fi{\fi#1}

\AtEndPreamble{\iffrenchmath@capsit\else\AtBeginDocument{
  \apply\DeclareMathUp{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z}
  }\fi
}

\AtEndPreamble{% au cas où frenchmath est chargé avant unicode-math
  \AtBeginDocument{% après actions de unicode-math
    \DeclareMathSymbol{;}{\mathbin}{operators}{'73} % et non \mathpunct
    \@ifundefined{mathscr}{\RequirePackage{mathrsfs}}{
        \PackageWarningNoLine{frenchmath}{Command \string\mathscr\space
            already defined, \MessageBreak
            I don't load mathrsfs}
    }
    \@ifundefined{leqslant}{
        \DeclareSymbolFont{AMSa}{U}{msa}{m}{n}% de amsfonts
        \DeclareMathSymbol{\leqslant}{\mathrel}{AMSa}{"36}% de amssymb
        \DeclareMathSymbol{\geqslant}{\mathrel}{AMSa}{"3E}
    }{
        \PackageWarningNoLine{frenchmath}{\string\leqslant\space
            and \string\geqslant\space already defined,
            \MessageBreak
            they will not be redefined}
    }
    \@ifundefined{varnothing}{% de amssymb
        \@ifundefined{text}{\RequirePackage{amstext}}{}
        \newcommand\varnothing{% \usefont évite de déclarer AMSb
            \mathord{\text{\usefont{U}{msb}{m}{n}\symbol{"3F}}}}
    }{
        \PackageWarningNoLine{frenchmath}{\string\varnothing\space
            already defined,
            \MessageBreak
            it will not be redefined,
            \MessageBreak
            except by using \string\AMSvarnothing}
    }
  }
}

\newcommand\curs{\mathscr}
\newcommand\infeg{\leqslant}
\newcommand\supeg{\geqslant}
\newcommand\vide{\varnothing}
\newcommand\AMSvarnothing{% doit être appelé après \setmathfont ?
    \AtEndPreamble{\AtBeginDocument{% après actions de unicode-math
        \renewcommand\varnothing{%
            \mathord{\text{\usefont{U}{msb}{m}{n}\symbol{"3F}}}}
    }}
}
\newcommand\paral{\mathrel{\ooalign{$\mkern-1.75mu/\mkern1.75mu$\cr%
    $\mkern1.75mu/\mkern-1.75mu$}}}
\newcommand\ssi{si, et seulement si,\xspace}
\newif\if@display % provient de amsmath, peut être appelé 2 fois
\everydisplay\@xp{\the\everydisplay \@displaytrue}
\newcommand*\cmod[1]{\penalty \z@ % similaire à amsmath \allowbreak
    \if@display\mkern 18mu\else\mkern 8mu\fi [#1]}

\DeclareMathOperator{\pgcd}{pgcd}
\DeclareMathOperator{\ppcm}{ppcm}
\DeclareMathOperator{\card}{card}
\DeclareMathOperator{\Card}{Card}
\DeclareMathOperator{\Ker}{Ker}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\rg}{rg}
\DeclareMathOperator{\Vect}{Vect}
\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\sh}{sh}
\AtBeginDocument{\let\oldth\th %\th existe déjà (mode texte)
    \renewcommand\th{\TextOrMath{\oldth}{\operatorname{th}}}}
\DeclareMathOperator{\cosec}{cosec}
\DeclareMathOperator{\cosech}{cosech}

\newcommand\@Oij{%
    \ensuremath{\left(O, \vec{\imath}, \vec{\jmath}\,\right)}\xspace}
\newcommand\@@Oij{%
    \ensuremath{\left(O ; \vec{\imath}, \vec{\jmath}\,\right)}\xspace}
\newcommand\Oij{\@ifstar{\@@Oij}{\@Oij}}

\newcommand\@Oijk{%
    \ensuremath{%
        \left(O, \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
        \vec{\vphantom{t}\smash{k}}\,\right)}%
    \xspace}
\newcommand\@@Oijk{%
    \ensuremath{%
        \left(O ; \vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
        \vec{\vphantom{t}\smash{k}}\,\right)}%
    \xspace}
\newcommand\Oijk{\@ifstar{\@@Oijk}{\@Oijk}}

\newcommand\@Ouv{%
    \ensuremath{\left(O, \vec{u}, \vec{v}\,\right)}\xspace}
\newcommand\@@Ouv{%
    \ensuremath{\left(O ; \vec{u}, \vec{v}\,\right)}\xspace}
\newcommand\Ouv{\@ifstar{\@@Ouv}{\@Ouv}}

\AtBeginDocument{\let\oldij\ij %\ij existe déjà (mode texte)
    \renewcommand\ij{\TextOrMath{\oldij}{%
        \left(\vec{\imath}, \vec{\jmath}\,\right)}}
}
\newcommand\ijk{%
    \ensuremath{%
        \left(\vec{\vphantom{t}\imath}, \vec{\vphantom{t}\jmath},
        \vec{\vphantom{t}\smash{k}}\,\right)}%
    \xspace}


\endinput
%%
%% End of file `frenchmath.sty'.