% grlatex package
% by Panos Hilaris
% 2002-01-09
\ProvidesPackage{grlatex}
 
\def\grlatexsetlang{%
  % english language must be defined with babel
  \selectlanguage{english}%    
  \grlatex@namesdateenumucc
  \lefthyphenmin=2
  \righthyphenmin=2
}


\def\grlatex@namesdateenumucc{%
  \grlatex@names
  \grlatex@date
  \grlatex@enum
  \grlatex@uccode
}

% a ripoff from babel's greek.ldf
\def\grlatex@names{%
  \def\prefacename{��������}%
  \def\refname{��������}%
  \def\abstractname{��������}%
  \def\bibname{������������}%
  \def\chaptername{��������}%
  \def\appendixname{���������}%
  \def\contentsname{�����������}%
  \def\listfigurename{��������� ��������}%
  \def\listtablename{��������� �������}%
  \def\indexname{���������}%
  \def\figurename{�����}%
  \def\tablename{�������}%
  \def\partname{�����}%
  \def\enclname{���������}%
  \def\ccname{�����������}%
  \def\headtoname{����}%
  \def\pagename{������}%
  \def\seename{�����}%
  \def\alsoname{����� ������}%
  \def\proofname{��������}%
  \def\glossaryname{��������}%
}

\def\grlatex@date{%
  \def\today{\number\day\space\grlatex@month\space\number\year}%
}

\def\grlatex@month{%
  \ifcase\month
    \or ����������%
    \or �����������%
    \or �������%
    \or ��������%
    \or �����%
    \or �������%
    \or �������%
    \or ���������%
    \or �����������%
    \or ���������%
    \or ���������%
    \or ����������%
  \fi
}

% uppercase codes for conversion
\def\grlatex@uccode{
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    %
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    %
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    \uccode`�=`�%
    %
    \uccode`�=`�%
}

% enumerations:
% count up to 24

% alphabetic: � � � � � � � � � � � � � ...
\def\grlatex@alph#1{% 
  \ifcase#1%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\else
    \@ctrerr
  \fi  
}

\def\grlatex@Alph#1{%
  \ifcase#1%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\or �%
    \or �\or �\or �\or �\else
    \@ctrerr 
  \fi  
}


% gr-numeral: � � � � � �� � � � � �� �� �� ...
\def\grlatex@grnum#1{% 
  \ifcase#1%
    \or   �\or  �\or  �\or  �\or �%
    \or  ��\or  �\or  �\or  �\or �%
    \or  ��\or ��\or ��\or ��\or ��%
    \or ���\or ��\or ��\or ��\or �%
    \or  ��\or ��\or ��\or ��\else
    \@ctrerr
  \fi  
}

\def\grlatex@Grnum#1{% 
  \ifcase#1%
    \or   �\or  �\or  �\or  �\or �%
    \or  ��\or  �\or  �\or  �\or �%
    \or  ��\or ��\or ��\or ��\or ��%
    \or ���\or ��\or ��\or ��\or �%
    \or  ��\or ��\or ��\or ��\else
    \@ctrerr
  \fi  
}


% latin @Alph / @alph are kept in \latin@alph, \latin@Alph
\def\grlatex@enum{%
   \let\latin@alph\@alph
   \let\latin@Alph\@Alph
   % default greek letter enumeration is greek numerals
   \let\@alph\grlatex@grnum
   \let\@Alph\grlatex@Grnum
}


% the two following are user commands,
% each choosing the desired greek letter enumeration.
% default is greek numerals (see above).
% to change default give \grlatexenumalph
\def\grlatexenumalph{
   \let\@alph\grlatex@alph
   \let\@Alph\grlatex@Alph
}

\def\grlatexenumgrnum{
   \let\@alph\grlatex@grnum
   \let\@Alph\grlatex@Grnum
}
