summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/frenchmath
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-05-04 19:46:50 +0000
committerKarl Berry <karl@freefriends.org>2024-05-04 19:46:50 +0000
commit5c49536f219c05a5f99b96b555ff2e8aa0a6f7d1 (patch)
tree4fc4de6962412d15c608b6c0f6bc4c4be2119bb8 /Master/texmf-dist/tex/latex/frenchmath
parent7ddc7470a363bebb8453ec8362d284b1aa2e4f78 (diff)
frenchmath (4may24)
git-svn-id: svn://tug.org/texlive/trunk@71170 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/frenchmath')
-rw-r--r--Master/texmf-dist/tex/latex/frenchmath/frenchmath.sty245
1 files changed, 68 insertions, 177 deletions
diff --git a/Master/texmf-dist/tex/latex/frenchmath/frenchmath.sty b/Master/texmf-dist/tex/latex/frenchmath/frenchmath.sty
index 303b5165ba9..9f4fbdecd12 100644
--- a/Master/texmf-dist/tex/latex/frenchmath/frenchmath.sty
+++ b/Master/texmf-dist/tex/latex/frenchmath/frenchmath.sty
@@ -22,59 +22,30 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{frenchmath}
- [2024/02/25 v2.10 .dtx Typesetting mathematics according to French rules]
-
-\newif\ifcapsit
-\DeclareOption{capsit}{\capsittrue}
-\newif\iflgrmath
-\DeclareOption{lgrmath}{\lgrmathtrue}
-\newif\ifupgreek
-\DeclareOption{upgreek}{\upgreektrue}
-\newif\ifUpgreek
-\DeclareOption{Upgreek}{\Upgreektrue\upgreektrue}
-\newif\ifnoibrackets
-\DeclareOption{noibrackets}{\noibracketstrue}
+ [2024/05/04 v3.0 .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
-\@ifpackageloaded{unicode-math}{
- \@ifpackageloaded{mathdesign}{
- \PackageInfo{frenchmath}{Package mathdesign
- is loaded, \MessageBreak
- I don't load mathrsfs and amssymb}
- }{
- %\let\circledS\relax % utilisé uniquement par mathdesign
- \let\eth\relax % 3 incompatibilités unicode-math / amssymb
- \let\digamma\relax
- \let\backepsilon\relax
- \RequirePackage{amssymb}
- \PackageInfo{frenchmath}{Package unicode-math
- is loaded, \MessageBreak
- I don't load mathrsfs}
- }
- \let\vide\varnothing % \varnothing sera écrasé par unicode-math
-}{
- \AtBeginDocument{
- \@ifpackageloaded{mathdesign}{
- \PackageInfo{frenchmath}{Package mathdesign
- is loaded, \MessageBreak
- I don't load mathrsfs and amssymb}
- }{
- \RequirePackage{amssymb} % \leqslant, \geqslant, \varnothing
- \@ifundefined{mathscr}{\RequirePackage{mathrsfs}}{
- \PackageInfo{frenchmath}{Command \string\mathscr\space
- already defined, \MessageBreak
- I don't load mathrsfs}
- }
- }
- }
-}
\RequirePackage{amsopn} % fournit \DeclareMathOperator
-\@ifpackageloaded{mathptmx}{\RequirePackage{dotlessj}}{}
\RequirePackage{xspace} % utile pour les commandes \ssi, \Oij
-\ifnoibrackets\else\RequirePackage{ibrackets}\fi % intelligent brackets
-\RequirePackage{decimalcomma} % depuis frenchmath 2.7
+\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}}{}
+}
-\newcommand*\DeclareMathUp[1]{
+\providecommand*\DeclareMathUp[1]{
\DeclareMathSymbol{#1}{\mathalpha}{operators}{`#1}}
\def\apply#1#2{\apply@#1#2,\apply@,}
@@ -82,22 +53,60 @@
\else #1{#2}\afterfi@{\apply@#1}\fi}
\def\afterfi@#1#2\fi{\fi#1}
-\ifcapsit\else\AtBeginDocument{
+\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
+ }\fi
+}
-\AtBeginDocument{\@ifpackageloaded{pstricks-add}{\psset{comma=true}}{}}
-\DeclareMathSymbol{;}{\mathbin}{operators}{'73} % \mathpunct à l'origine
+\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
+ \newcommand\varnothing{% \usefont évite de déclarer AMSb
+ \mathord{\text{\usefont{U}{AMSb}{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}
-\@ifundefined{vide}{\newcommand\vide{\varnothing}}{}
+\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}{AMSb}{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}
-\newcommand*\cmod[1]{\quad[#1]}
+\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}
@@ -138,134 +147,16 @@
\ensuremath{\left(O ; \vec{u}, \vec{v}\,\right)}\xspace}
\newcommand\Ouv{\@ifstar{\@@Ouv}{\@Ouv}}
-\AtBeginDocument{
- \renewcommand\ij{%
- \ensuremath{\left(\vec{\imath}, \vec{\jmath}\,\right)}\xspace}}
+\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}
-\providecommand\SaveGreekItalics{% pourrait être définie ailleurs
- \let\italpha\alpha
- \let\itbeta\beta
- \let\itgamma\gamma
- \let\itdelta\delta
- \let\itepsilon\epsilon
- \let\itzeta\zeta
- \let\iteta\eta
- \let\ittheta\theta
- \let\itiota\iota
- \let\itkappa\kappa
- \let\itlambda\lambda
- \let\itmu\mu
- \let\itnu\nu
- \let\itxi\xi
- \let\itpi\pi
- \let\itrho\rho
- \let\itsigma\sigma
- \let\ittau\tau
- \let\itupsilon\upsilon
- \let\itphi\phi
- \let\itchi\chi
- \let\itpsi\psi
- \let\itomega\omega
- \let\itvarepsilon\varepsilon
- \let\itvartheta\vartheta
- \let\itvarpi\varpi
- \let\itvarsigma\varsigma
- \let\itvarphi\varphi
-}
-
-\providecommand\upgreekUndefined{
- \let\upalpha\@undefined
- \let\upbeta\@undefined
- \let\upgamma\@undefined
- \let\updelta\@undefined
- \let\upepsilon\@undefined
- \let\upzeta\@undefined
- \let\upeta\@undefined
- \let\uptheta\@undefined
- \let\upiota\@undefined
- \let\upkappa\@undefined
- \let\uplambda\@undefined
- \let\upmu\@undefined
- \let\upnu\@undefined
- \let\upxi\@undefined
- \let\uppi\@undefined
- \let\uprho\@undefined
- \let\upsigma\@undefined
- \let\uptau\@undefined
- \let\upupsilon\@undefined
- \let\upphi\@undefined
- \let\upchi\@undefined
- \let\uppsi\@undefined
- \let\upomega\@undefined
- \let\upvarepsilon\@undefined
- \let\upvartheta\@undefined
- \let\upvarpi\@undefined
- \let\upvarrho\@undefined
- \let\upvarsigma\@undefined
- \let\upvarphi\@undefined
-}
-
-\AtBeginDocument{
- \iflgrmath
- \SaveGreekItalics
- \RequirePackage[font=fcm,style=french]{lgrmath}
- \fi
- \ifupgreek
- \@ifpackageloaded{upgreek}{}{
- \@ifpackageloaded{unicode-math}{\upgreekUndefined}{}
- \SaveGreekItalics
- \RequirePackage[Symbol]{upgreek}
- }
- \renewcommand\alpha{\upalpha}
- \renewcommand\beta{\upbeta}
- \renewcommand\gamma{\upgamma}
- \renewcommand\delta{\updelta}
- \renewcommand\epsilon{\upepsilon}
- \renewcommand\zeta{\upzeta}
- \renewcommand\eta{\upeta}
- \renewcommand\theta{\uptheta}
- \renewcommand\iota{\upiota}
- \renewcommand\kappa{\upkappa}
- \renewcommand\lambda{\uplambda}
- \renewcommand\mu{\upmu}
- \renewcommand\nu{\upnu}
- \renewcommand\xi{\upxi}
- \renewcommand\pi{\uppi}
- \renewcommand\rho{\uprho}
- \renewcommand\sigma{\upsigma}
- \renewcommand\tau{\uptau}
- \renewcommand\upsilon{\upupsilon}
- \renewcommand\phi{\upphi}
- \renewcommand\chi{\upchi}
- \renewcommand\psi{\uppsi}
- \renewcommand\omega{\upomega}
- \renewcommand\varepsilon{\upvarepsilon}
- \renewcommand\vartheta{\upvartheta}
- \renewcommand\varpi{\upvarpi}
- \renewcommand\varrho{\upvarrho}
- \renewcommand\varsigma{\upvarsigma}
- \renewcommand\varphi{\upvarphi}
- \fi
- \ifUpgreek
- % unicode-math utilise \upGamma, \upDelta...
- \renewcommand\Gamma{\Upgamma}
- \renewcommand\Delta{\Updelta}
- \renewcommand\Theta{\Uptheta}
- \renewcommand\Lambda{\Uplambda}
- \renewcommand\Xi{\Upxi}
- \renewcommand\Pi{\Uppi}
- \renewcommand\Sigma{\Upsigma}
- \renewcommand\Upsilon{\Upupsilon}
- \renewcommand\Phi{\Upphi}
- \renewcommand\Psi{\Uppsi}
- \renewcommand\Omega{\Upomega}
- \fi
-}
\endinput
%%