summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/epslatex-fr/Franc-chap.sty
blob: 1ca8373fe598a3f2a1bc74f896ff4ad3d94ed510 (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
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
\ProvidesPackage{Franc-chap}[1997/01/15]
\RequirePackage[Bjarne]{fncychap}
% Jean-Pierre Drucbert
% from Bjarne option of fncychap.sty
%%%%%%% FRANC DEF
%%%%% NUMÉROS LITTÉRAUX EN FRANÇAIS (<=99; >=0)

% pb \appendix 17Dec96
\let\sv@appendix\appendix
\newif\ifappendix\appendixfalse
\def\appendix{\sv@appendix\appendixtrue}

%\DeclareOption{Franc}{%
  \ChNameUpperCase
  \ChTitleUpperCase  
% \ChNameVar{\raggedleft\normalsize\rm}
% \ChNumVar{\raggedleft \bfseries\Large}
  \ChNameVar{\raggedleft\normalsize\sffamily\bfseries}
  \ChNumVar{\raggedleft\Large\sffamily\bfseries}
%  \ChTitleVar{\raggedleft \Large\rm}
  \ChTitleVar{\raggedleft \bfseries\LARGE\sf\bfseries}
  \ChRuleWidth{1pt}

%  \newcounter{AlphaCnt}
%  \newcounter{AlphaDecCnt}
  \newcounter{UnitsCnt}
  \renewcommand{\AlphaNo}{%
    \ifcase\number\theAlphaCnt
      \ifnum\number\thechapter=0
        ZÉRO\else{}\fi
    \or
    \ifnum\number\thechapter>20
    \def\@sepAlpha{}%
    \ifnum\number\thechapter<80 ET \fi UN\fi
    \or DEUX\or TROIS\or QUATRE\or CINQ
    \or SIX\or SEPT\or HUIT\or NEUF\or DIX
    \or ONZE\or DOUZE\or TREIZE\or QUATORZE\or QUINZE
    \or SEIZE\or DIX-SEPT\or DIX-HUIT\or DIX-NEUF\fi
}

  \renewcommand{\AlphaDecNo}{%
    \setcounter{AlphaDecCnt}{0}
    \@whilenum\number\theAlphaCnt>0\do
      {\addtocounter{AlphaCnt}{-10}
       \def\@sepAlpha{}
       \addtocounter{AlphaDecCnt}{1}}
     \ifnum\number\theAlphaCnt=0
     \else
       \addtocounter{AlphaDecCnt}{-1}
       \def\@sepAlpha{-}
% CALCULER UnitsCnt. Si = 0 ou 1, pas de separateur.
       \setcounter{UnitsCnt}{\number\thechapter}
       \divide\c@UnitsCnt by 10
       \multiply\c@UnitsCnt by 10
       \@tempcnta=\c@chapter
       \advance\@tempcnta by -\c@UnitsCnt
       \c@UnitsCnt=\@tempcnta
       \ifnum\number\theUnitsCnt<2\def\@sepAlpha{ }\fi
       \addtocounter{AlphaCnt}{10}
     \fi
     
     
    \ifcase\number\theAlphaDecCnt\or DIX\or VINGT\or TRENTE\or
    QUARANTE\or CINQUANTE\or SOIXANTE\or SOIXANTE-DIX\or
    QUATRE-VINGT\or QUATRE-VINGT-DIX\fi
    }
  \renewcommand{\TheAlphaChapter}{%
  \ifappendix\thechapter\else % in appendices, get just the letter
    \ifnum\number\thechapter>99
    \thechapter
    \else
    \ifnum\number\thechapter<0
    \thechapter
    \else
    \setcounter{AlphaCnt}{\number\thechapter}
    \ifnum\number\thechapter<20
      \ifnum\number\thechapter=1
      PREMIER
      \else
      \AlphaNo
      \fi
    \else\ifnum\number\thechapter<70
      \ifnum\number\theAlphaCnt=0
      \AlphaDecNo
      \else
      \ifnum\number\theAlphaCnt=1
      \AlphaDecNo et Un
      \else
      \AlphaDecNo\@sepAlpha\AlphaNo
      \fi\fi
    \else\ifnum\number\thechapter<80
      %70 à 79
      \setcounter{UnitsCnt}{\number\thechapter}
      \addtocounter{UnitsCnt}{-70}
       \ifcase\number\theUnitsCnt
	SOIXANTE-DIX
	\or SOIXANTE ET ONZE%
	\or SOIXANTE-DOUZE%
	\or SOIXANTE-TREIZE%
	\or SOIXANTE-QUATORZE%
	\or SOIXANTE-QUINZE%
	\or SOIXANTE-SEIZE%
	\or SOIXANTE-DIX-SEPT%
	\or SOIXANTE-DIX-HUIT%
	\or SOIXANTE-DIX-NEUF\fi
    \else\ifnum\number\thechapter<90
      \AlphaDecNo\@sepAlpha\AlphaNo
    \else
      \setcounter{UnitsCnt}{\number\thechapter}
      \addtocounter{UnitsCnt}{-90}
       \ifcase\number\theUnitsCnt
	QUATRE-VINGT-DIX
	\or QUATRE-VINGT-ONZE%
	\or QUATRE-VINGT-DOUZE%
	\or QUATRE-VINGT-TREIZE%
	\or QUATRE-VINGT-QUATORZE%
	\or QUATRE-VINGT-QUINZE%
	\or QUATRE-VINGT-SEIZE%
	\or QUATRE-VINGT-DIX-SEPT%
	\or QUATRE-VINGT-DIX-HUIT%
	\or QUATRE-VINGT-DIX-NEUF\fi
    \fi\fi\fi\fi
    \fi\fi
    \fi
    }

  \renewcommand{\DOCH}{%
    \mghrulefill{\RW}\par\nobreak
    \CNV\FmN{\@chapapp}\par\nobreak 
    \CNoV\TheAlphaChapter\par\nobreak
    \vskip -1\baselineskip\vskip 5pt\mghrulefill{\RW}\par\nobreak
    \vskip 20\p@
    }
  \renewcommand{\DOTI}[1]{%
    \CTV\FmTi{#1}\par\nobreak
    \vskip 40\p@
    }
  \renewcommand{\DOTIS}[1]{%
    \CTV\FmTi{#1}\par\nobreak
    \vskip 40\p@
    }
%}
\endinput