%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Ce fichier provient de stackexchange. À ma connaissance,
% l'utilisateur egreg est l'auteur original.
%
% Je l'ai modifié quelque peu pour mes besoins,
% mais je ne me considère pas comme faisant partie
% des auteurs de ce fichier.
%
% Ce fichier peut être utiliser à la guise de chacun 
% et chacune.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Définition de polices de caractères pour XeTeX.
%
\catcode`@=11
\font\etenrm=ecrm1000 % roman text
\font\eeightrm=ecrm0800 % roman text
\font\tctenrm=tcrm1000
\font\tceightrm=tcrm0800
\font\tcfiverm=tcrm0500
% \font\sevenrm=ecrm0700
% \font\fiverm=ecrm0500

\font\fourrm=cmr5 at 4pt
\font\fouri=cmmi5 at 4pt
\font\foursy=cmsy5 at 4pt

\font\tenbf=ecbx1000 % boldface extended
\font\tctenbf=tcbx1000
\font\tceightbf=tcbx0800
\font\tcfivebf=tcbx0500
\font\sevenbf=ecbx0700
\font\eightbf=ecbx0800 % boldface extended
\font\fivebf=ecbx0500

\font\tentt=ectt1000 % typewriter
\font\eighttt=ectt0800 % typewriter
\font\fivett=ectt0800 at 5 truept% typewriter
\font\tctentt=tctt1000
\font\tceighttt=tctt0800
\font\tcfivett=tctt0800 at 5truept

\font\tensl=ecsl1000 % slanted roman
\font\tctensl=tcsl1000
\font\eightsl=ecsl0800 % slanted roman
\font\tceightsl=tcsl0800
\font\tcfivesl=tcsl0500

\font\tenit=ecti1000 % text italic
\font\tctenit=tcti1000
\font\eightit=ecti0800 % text italic
\font\tceightit=tcti0800
\font\tcfiveit=tcti0800 at 5truept

% \font\tenrm=ptmr8t % roman text
% \font\sevenrm=ptmr8t at 7pt
% \font\fiverm=ptmr8t at 5pt

% \font\tenbf=ptmb8t % boldface extended
% \font\sevenbf=ptmb8t at 7pt
% \font\fivebf=ptmb8t at 5pt

% \font\tentt=pcrr8t % typewriter

% \font\tensl=ptmro8t % slanted roman

% \font\tenit=ptmri8t % text italic

% \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
% \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
% \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
% \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
% \textfont\itfam=\tenit
% \textfont\slfam=\tensl
% \textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
%   \scriptscriptfont\bffam=\fivebf
% \textfont\ttfam=\tentt

\def\rm{\fam\z@\let\tcfont\tctenrm\etenrm}
\def\it{\fam\itfam\let\tcfont\tctenit\tenit}
\def\sl{\fam\slfam\let\tcfont\tctensl\tensl}
\def\bf{\fam\bffam\let\tcfont\tctenbf\tenbf}
\def\tt{\fam\ttfam\let\tcfont\tctentt\tentt}



\font\twelveecrm=ecrm1200 % roman text
\font\tctwelverm=tcrm1200

\font\twelveecbf=ecbx1200 % boldface extended
\font\tctwelvebf=tcbx1200
\font\twelvebf=cmbx12
\font\cmtenbf=cmbx10
\font\cmeightbf=cmbx8
\font\cmfivebf=cmbx5

\font\twelveectt=ectt1200 % typewriter
\font\tctwelvett=tctt1200

\font\twelveecsl=ecsl1200 % slanted roman
\font\tctwelvesl=tcsl1200
\font\twelvesl=cmsl12
\font\cmtensl=cmsl10
\font\cmeightsl=cmsl8

\font\twelveecit=ecti1200 % text italic
\font\tctwelveit=tcti1200
\font\twelveit=cmti12
\font\cmtenit=cmti10
\font\cmeightit=cmti8

\font\twelverm=cmr12
\font\twelvei=cmmi12
\font\twelvesy=cmsy10 at 12truept
\font\twelveex=cmex10 at 12truept

\font\cmtenrm=cmr10
\font\cmteni=cmmi10
\font\cmtensy=cmsy10
\font\cmtenex=cmex10

\font\cmeightrm=cmr8
\font\cmeighti=cmmi8
\font\cmeightsy=cmsy8
\font\cmeightex=cmex8

\font\cmfiverm=cmr5
\font\cmfivei=cmmi5
\font\cmfivesy=cmsy5
\font\cmfiveex=cmex5


\font\cmfourrm=cmr5 at 4pt
\font\cmfouri=cmmi5 at 4pt
\font\cmfoursy=cmsy5 at 4pt
\font\cmfourex=cmex5 at 4pt

\font\ninerm=cmr9
\font\ninei=cmmi9
\font\ninesy=cmsy9


%%Defining blackboard characters (e.g. R the reals)
\newfam\bbbfam
\font\bbbtwelve=msbm10 at 12truept
\font\bbbten=msbm10
\font\bbbnine=msbm9
\font\bbbeight=msbm8
\font\bbbseven=msbm7
\font\bbbfive=msbm5
\font\bbbfour=msbm5 at 4pt
\textfont\bbbfam=\bbbten
\scriptfont\bbbfam=\bbbseven
\scriptscriptfont\bbbfam=\bbbfive
\def\bbb{\fam=\bbbfam}

\def\cinqpt{%
    \def\rm{\fam\z@\let\tcfont\tceightrm\eeightrm}%
    \def\it{\fam\itfam\let\tcfont\tcfiveit\eightit}%
    \textfont\itfam=\cmeightit %
    \def\sl{\fam\slfam\let\tcfont\tcfivesl\eightsl}%
    \textfont\slfam=\cmeightsl %
    \def\bf{\fam\bffam\let\tcfont\tcfivebf\eightbf}%
    \textfont\bffam=\cmfivebf \scriptfont\bffam=\fivebf %
    \scriptscriptfont\bffam=\fivebf %
    \def\tt{\fam\ttfam\let\tcfont\tcfivett\fivett}%
    \textfont\ttfam=\fivett %
%    %
%    %
    \textfont0=\cmfiverm \scriptfont0=\fiverm \scriptscriptfont0=\fourrm%
    \textfont1=\cmfivei \scriptfont1=\fivei \scriptscriptfont1=\fouri%
    \textfont2=\cmfivesy \scriptfont2=\fivesy \scriptscriptfont2=\foursy%
    \textfont3=\cmfiveex \scriptfont3=\cmeightex \scriptscriptfont3=\cmeightex%
%    %
    \textfont\bbbfam=\bbbeight%
    \scriptfont\bbbfam=\bbbfive%
    \scriptscriptfont\bbbfam=\bbbfour%
    \def\bbb{\fam=\bbbfam}%
%    %
    \tt \ttglue=.5em plus.25em minus.15em %
%    %
    \let\big=\eightbig%
    \setbox\strutbox=\hbox{\vrule height10pt depth2pt width\z@}% %
%    %
    \normalbaselineskip=12pt %
    \normalbaselines\rm%
}
\def\tenbig#1{{\hbox{$\left#1\vbox to 9pt{}\right.\n@space$}}}

\newskip\ttglue
\def\douzept{%
    \def\rm{\fam\z@\let\tcfont\tctwelverm\twelveecrm}%
    \def\it{\fam\itfam\let\tcfont\tctwelveit\twelveecit}%
    \textfont\itfam=\twelveit %
    \def\sl{\fam\slfam\let\tcfont\tctwelvesl\twelveecsl}%
    \textfont\slfam=\twelvesl %
    \def\bf{\fam\bffam\let\tcfont\tctwelvebf\twelveecbf}%
    \textfont\bffam=\twelvebf \scriptfont\bffam=\sevenbf %
    \scriptscriptfont\bffam=\fivebf %
    \def\tt{\fam\ttfam\let\tcfont\tctwelvett\twelveectt}%
    \textfont\ttfam=\tentt %
    
    
    \textfont0=\twelverm \scriptfont0=\ninerm \scriptscriptfont0=\sevenrm
    \textfont1=\twelvei \scriptfont1=\ninei \scriptscriptfont1=\seveni
    \textfont2=\twelvesy \scriptfont2=\ninesy \scriptscriptfont2=\sevensy
    \textfont3=\twelveex \scriptfont3=\twelveex \scriptscriptfont3=\twelveex
    
    \textfont\bbbfam=\bbbtwelve
    \scriptfont\bbbfam=\bbbnine
    \scriptscriptfont\bbbfam=\bbbseven
    \def\bbb{\fam=\bbbfam}%
    
    \tt \ttglue=.5em plus.25em minus.15em\relax
    
    \let\big=\twelvebig
    \setbox\strutbox=\hbox{\vrule height10pt depth4pt width\z@}% 
    
    \normalbaselineskip=14pt\relax 
    \normalbaselines\rm
}
\def\twelvebig#1{{\hbox{$\left#1\vbox to 10pt{}\right.\n@space$}}}

\def\dixpt{%
    \def\rm{\fam\z@\let\tcfont\tctenrm\etenrm}%
    \def\it{\fam\itfam\let\tcfont\tctenit\tenit}%
    \textfont\itfam=\cmtenit %
    \def\sl{\fam\slfam\let\tcfont\tctensl\tensl}%
    \textfont\slfam=\cmtensl %
    \def\bf{\fam\bffam\let\tcfont\tctenbf\tenbf}%
    \textfont\bffam=\cmtenbf \scriptfont\bffam=\tenbf %
    \scriptscriptfont\bffam=\sevenbf %
    \def\tt{\fam\ttfam\let\tcfont\tctentt\tentt}%
    \textfont\ttfam=\tentt %
%    %
%    %
    \textfont0=\cmtenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm%
    \textfont1=\cmteni \scriptfont1=\seveni \scriptscriptfont1=\fivei%
    \textfont2=\cmtensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy%
    \textfont3=\cmtenex \scriptfont3=\cmtenex \scriptscriptfont3=\cmtenex%
%    %
    \textfont\bbbfam=\bbbten%
    \scriptfont\bbbfam=\bbbseven%
    \scriptscriptfont\bbbfam=\bbbfive%
    \def\bbb{\fam=\bbbfam}%
%    %
    \tt \ttglue=.5em plus.25em minus.15em %
%    %
    \let\big=\tenbig%
    \setbox\strutbox=\hbox{\vrule height10pt depth2pt width\z@}% %
%    %
    \normalbaselineskip=12pt %
    \normalbaselines\rm%
}
\def\tenbig#1{{\hbox{$\left#1\vbox to 9pt{}\right.\n@space$}}}

\def\huitpt{%
    \def\rm{\fam\z@\let\tcfont\tceightrm\eeightrm}%
    \def\it{\fam\itfam\let\tcfont\tceightit\eightit}%
    \textfont\itfam=\cmeightit %
    \def\sl{\fam\slfam\let\tcfont\tceightsl\eightsl}%
    \textfont\slfam=\cmeightsl %
    \def\bf{\fam\bffam\let\tcfont\tceightbf\eightbf}%
    \textfont\bffam=\cmeightbf \scriptfont\bffam=\eightbf %
    \scriptscriptfont\bffam=\fivebf %
    \def\tt{\fam\ttfam\let\tcfont\tceighttt\eighttt}%
    \textfont\ttfam=\eighttt %
%    %
%    %
    \textfont0=\cmeightrm \scriptfont0=\fiverm \scriptscriptfont0=\fourrm%
    \textfont1=\cmeighti \scriptfont1=\fivei \scriptscriptfont1=\fouri%
    \textfont2=\cmeightsy \scriptfont2=\fivesy \scriptscriptfont2=\foursy%
    \textfont3=\cmeightex \scriptfont3=\cmeightex \scriptscriptfont3=\cmeightex%
%    %
    \textfont\bbbfam=\bbbeight%
    \scriptfont\bbbfam=\bbbfive%
    \scriptscriptfont\bbbfam=\bbbfour%
    \def\bbb{\fam=\bbbfam}%
%    %
    \tt \ttglue=.5em plus.25em minus.15em %
%    %
    \let\big=\eightbig%
    \setbox\strutbox=\hbox{\vrule height10pt depth2pt width\z@}% %
%    %
    \normalbaselineskip=12pt %
    \normalbaselines\rm%
}
\def\tenbig#1{{\hbox{$\left#1\vbox to 9pt{}\right.\n@space$}}}


%%Defining blackboard characters (e.g. R the reals)
\newfam\bbbfam
\font\bbbten=msbm10
\font\bbbseven=msbm7
\font\bbbfive=msbm5
\textfont\bbbfam=\bbbten
\scriptfont\bbbfam=\bbbseven
\scriptscriptfont\bbbfam=\bbbfive
\def\bbb{\fam=\bbbfam}

%%Character shortcut
\def\joli#1{{\cal #1}}
\def\bbchar#1{{\bbb #1}}
\def\Z{{\bbb Z}} \def\T{{\bbb T}} \def\R{{\bbb R}}
\def\N{{\bbb N}} \def\Q{{\bbb Q}} \def\Cp{{\bbb C}} \catcode`@=12


% set the font
\rm
\catcode`@=12
