summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/jknappen/greekctr.sty
blob: f26be2d094c2368e116d9a9bd9d4d6b2cfb5a9a0 (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
% greekctr.sty
% 15. Juni 1990, revised 3-jan-1996, 1999-02-14
% (c) Copyright 1990-1999 J"org Knappen
% Licence: GNU licence Version 2
% For additional information look after \endinput
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{greekctr}[1999/02/14 Greek Counterstyle v3.0 (jk)]
\def\greek#1{\@greek{\@nameuse{c@#1}}}
\def\@greek#1{\ifcase#1\or\ensuremath{\alpha}\or\ensuremath{\beta}\or%
  \ensuremath{\gamma}\or\ensuremath{\delta}\else\@igreek{#1}\fi}
\def\@igreek#1{\ifcase#1\or\or\or\or\or\ensuremath{\varepsilon}%
  \or\ensuremath{\zeta}\or\ensuremath{\eta}\or\ensuremath{\vartheta}%
  \or\ensuremath{\iota}\or\ensuremath{\kappa}\or\ensuremath{\lambda}\or%
  \ensuremath{\mu}\or\ensuremath{\nu}\or%
  \ensuremath{\xi}\or\ensuremath{o}\or\ensuremath{\pi}\or%
  \ensuremath{\varrho}%
  \or\ensuremath{\sigma}\or\ensuremath{\tau}\or\ensuremath{\upsilon}\or%
  \ensuremath{\varphi}\or\ensuremath{\chi}\or%
  \ensuremath{\psi}\or\ensuremath{\omega}\else%
  \ensuremath{\omega}\@ctrerr\fi} 
\def\Greek#1{\@Greek{\@nameuse{c@#1}}}
\def\@Greek#1{\ifcase#1\or A\or B\or\ensuremath{\Gamma}\or%
  \ensuremath{\Delta}\else\@iGreek{#1}\fi}
\def\@iGreek#1{\ifcase#1\or\or\or\or\or E\or Z\or H\or\ensuremath{\Theta}\or%
  I\or K\or\ensuremath{\Lambda}\or M\or N\or\ensuremath{\Xi}\or O\or%
  \ensuremath{\Pi}\or P\or\ensuremath{\Sigma}\or T\or%
  \ensuremath{\Upsilon}\or%
  \ensuremath{\Phi}\or X\or\ensuremath{\Psi}\or%
  \ensuremath{\Omega}\else\ensuremath{\Omega}\@ctrerr\fi}
\endinput

Usage:

\renewcommand{\the<counter>}{\greek{<counter>}}
\renewcommand{\the<counter>}{\Greek{<counter>}}

e.g. \renewcommand{\theenumi}{\greek{enumi}}

Provides \greek and \Greek for counters just like \alph. No switch to 
math mode is needed. \varepsilon, \vartheta and \varphi are preferred, 
but \pi and \sigma.

Version 3 doesn't need the package amstxt any longer, since it relies on 
\ensuremath. Also fixed a bug in the handling of Omega.

J"org Knappen, Barbarossaring 43, D-55118 Mainz, Allemagne.