%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "dpccyr.sty",
%%%     version         = "1.00",
%%%     date            = "09 December 1991",
%%%     time            = "17:33:06 BST",
%%%     author          = "David Carlisle",
%%%     address         = "Computer Science Department
%%%                        Manchester University
%%%                        Oxford Road
%%%                        Manchester
%%%                        England
%%%                        M13 9PL",
%%%     telephone       = "+44 61 275 6139",
%%%     FAX             = "+44 61 275 6236",
%%%     checksum        = "08249 262 918 8383",
%%%     email           = "carlisle@cs.man.ac.uk (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "LaTeX, cyrillic, NFSS",
%%%     supported       = "yes",
%%%     docstring       = "
%%%
%%%     dpccyr.sty (cyrillic.sty)
%%%
%%%     Loads the UWcyr fonts for the NFSS.
%%%     This file may be installed as cyrillic.sty but should be
%%%     distributed as dpccyr.sty to avoid name clashes with other,
%%%     possibly better, cyrillic options.
%%%
%%%     The checksum field above was produced by
%%%     Robert Solovay's checksum utility.",
%%%  }
%%% ====================================================================
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%<*x>
% This file may be used without modification as a style (.sty) file.
%
% If you have Mittelbach's doc.sty, this file may be formatted with a
% command like:
%                latex dpccyr.sty
%
% If you have the Mittelbach/Duchier/Braams docstrip utility, you may
% produce a faster loading .sty file.  Rename this file to: dpccyr.doc
% Then run this file through *plain* TeX:
%                tex dpccyr.doc
% This should produce the file dpccyr.sty.
% If you do not have plain TeX on your system, you can trick LaTeX into
% doing the work as follows:
%                latex \def\fmtname{plain} \input dpccyr.doc
% Note that you may need to quote the arguments here to stop your
% operating system treating the \ characters incorrectly.
%
%                latex dpccyr.doc
% Will produce a typeset version of the documentation, as above.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\plain{plain}\ifx\fmtname\plain\csname fi\endcsname
     \def\batchfile{dpccyr.doc}
     \input docstrip
     \preamble

     Do not distribute the stripped version of this file.
     The checksum in the header refers to the documented version.

     \endpreamble
%                                                   =======
     \generateFile{dpccyr.sty}{t}{\from{dpccyr.doc}{fontdef}}
%                                                   =======
%     You do not need the fontdef option if you LaTeX format already has
%     the cyrillic fontdefs (eg fontdef.max). So you may just need:
%    \generateFile{dpccyr.sty}{t}{\from{dpccyr.doc}{}}
     \endinput
\fi
%
\ifcat a\noexpand @\let\next\relax\else\def\next{%
    \documentstyle[dpccyr,doc]{article}\MakePercentIgnore}\fi\next
%
%\def\eatmodule<#1>{}\eatmodule
%</x>
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \textwidth=355pt   ^^A Allow macrocode text with 72 columns.
% \CodelineIndex     ^^A Code lines numbered.
% \DisableCrossrefs  ^^A No Cross references.
% \MakeShortVerb{\|} ^^A |\foo| works like \verb+\foo+
%
%
% \title{dpccyr.sty\\(cyrillic.sty)}
% \author{D. P. Carlisle}
% \date{09 December 1991}
% \begin{document}
% \maketitle
%
% This file defines the commands:\\
% |\cyr|        normal weight upright cyrillic\\
% |\cyr\it|     normal weight italic cyrillic\\
% |\cyr\sc|     normal weight caps and small caps cyrillic\\
% |\cyr\bf|     bold weight upright cyrillic\\
% |\cyrss|      normal weight sans-serif cyrillic\\
% |\mathcyr|    same as |\cyr|, but set up for math-mode
%
% It should perhaps be noted that I know nothing at all about the
% Cyrillic alphabet, this is just a basic set of declarations to allow
% these fonts to be used in a \LaTeX\ based on the NFSS.
%
% This file may be installed as {\tt cyrillic.sty}, however it should be
% distributed as {\tt dpccyr.sty} to avoid name clashes with other,
% possibly better Cyrillic styles.
%
% \typeout{End of the Introduction and Examples.}
% \typein[\answer]%
%   {Do you want an annotated listing of the macro definitions (y/n) ?}
% \def\next{y}\ifx\answer\next\else\expandafter\stop\fi
%
% \section{The Macros}
%
% If your \LaTeX\ format is built with a fontdef file, like {\tt
% fontdef.max}, which contains the cyrillic font definitions, you may
% modify the |\generateFile| command in the preamble to this document,
% not to include the {\tt fontdef} option. {\tt docstrip} will then
% remove the following section from the stripped {\tt .sty} version of
% this file.
%
%    \begin{macrocode}
%<*fontdef>
\new@fontshape{UWCyr}{m}{n}{%
   <5>wncyr5%
   <6>wncyr6%
   <7>wncyr7%
   <8>wncyr8%
   <9>wncyr9%
   <10>wncyr10%
   <11>wncyr10 at10.95pt%
   <12>wncyr10 at12pt%
   <14>wncyr10 at14.4pt%
   <17>wncyr10 at17.28pt%
   <20>wncyr10 at20.74pt%
   <25>wncyr10 at24.88pt}{}

\new@fontshape{UWCyr}{m}{it}{%
   <5>wncyi5%
   <6>wncyi6%
   <7>wncyi7%
   <8>wncyi8%
   <9>wncyi9%
   <10>wncyi10%
   <11>wncyi10 at10.95pt%
   <12>wncyi10 at12pt%
   <14>wncyi10 at14.4pt%
   <17>wncyi10 at17.28pt%
   <20>wncyi10 at20.74pt%
   <25>wncyi10 at24.88pt}{}

\new@fontshape{UWCyr}{m}{sc}{%
   <5>wncysc10 at5pt%
   <6>wncysc10 at6pt%
   <7>wncysc10 at7pt%
   <8>wncysc10 at8pt%
   <9>wncysc10 at9pt%
   <10>wncysc10%
   <11>wncysc10 at10.95pt%
   <12>wncysc10 at12pt%
   <14>wncysc10 at14.4pt%
   <17>wncysc10 at17.28pt%
   <20>wncysc10 at20.74pt%
   <25>wncysc10 at24.88pt}{}

\new@fontshape{UWCyr}{b}{n}{%
   <5>wncyb5%
   <6>wncyb6%
   <7>wncyb7%
   <8>wncyb8%
   <9>wncyb9%
   <10>wncyb10%
   <11>wncyb10 at10.95pt%
   <12>wncyb10 at12pt%
   <14>wncyb10 at14.4pt%
   <17>wncyb10 at17.28pt%
   <20>wncyb10 at20.74pt%
   <25>wncyb10 at24.88pt}{}

\extra@def{UWCyr}{}{}

\new@fontshape{UWCyss}{m}{n}{%
   <5>wncyss8 at5pt%
   <6>wncyss8 at6pt%
   <7>wncyss8 at7pt%
   <8>wncyss8%
   <9>wncyss9%
   <10>wncyss10%
   <11>wncyss10 at10.95pt%
   <12>wncyss10 at12pt%
   <14>wncyss10 at14.4pt%
   <17>wncyss10 at17.28pt%
   <20>wncyss10 at20.74pt%
   <25>wncyss10 at24.88pt}{}

\extra@def{UWCyss}{}{}
%</fontdef>
%    \end{macrocode}
%
% The main definitions:
%    \begin{macrocode}
\input cyracc.def
%    \end{macrocode}
%
% Set up the user level font commands:
%    \begin{macrocode}
\extra@def{UWCyr}{}{\mathcyracc}
\def\cyr{\fontfamily{UWCyr}\cyracc\selectfont}
\def\cyrss{\fontfamily{UWCyss}\cyracc\selectfont}

\subst@fontshape{UWCyr}{bx}{n}{UWCyr}{b}{n}

\newmathalphabet{\mathcyr}
\addtoversion{normal}{\mathcyr}{UWCyr}{m}{n}
\addtoversion{bold}{\mathcyr}{UWCyr}{b}{n}
%    \end{macrocode}

% A version of |\cyracc| using |\mathchar| instead of
% |\char|, so the symbols come from the correct font. Can use
% |\fam=7| trick rather than get the cyrillic fontfamily out of
% |\mathcyr@group| as these symbols are only used within the scope (or
% argument) of |\mathcr|. This ought to be in {\tt cyrac.def}
% as it applies to any math-mode use of these fonts, not just \LaTeX.

%    \begin{macrocode}
\def\mathcyracc{%
  \def\cydot{{\kern0pt}}%
  \mathchardef\cprime"707E
  \mathchardef\Cprime"705E
  \mathchardef\cdprime"707F
  \mathchardef\Cdprime"705F
  \def\dbar{dj}\def\Dbar{Dj}%
  \mathchardef\dz"701E
  \mathchardef\Dz"7016
  \mathchardef\dzh"700A
  \mathchardef\Dzh"7002
  \def\'##1{\if c##1\mathchar"700F
    \else \if C##1\mathchar"7007
    \else \mathaccent"7026 ##1\fi \fi }%
  \def\`##1{\if e##1\mathchar"700B
    \else \if E##1\mathchar"7003
    \else \errmessage{accent \string\` not defined in cyrillic}%
        ##1\fi \fi }%
  \def\=##1{\if e##1\mathchar"700D
    \else \if E##1\mathchar"7005
    \else \if \i##1\mathchar"700C
    \else \if I##1\mathchar"7004
    \else \errmessage{accent \string\= not defined in cyrillic}%
        ##1\fi \fi \fi \fi }%
  \def\u##1{\if \i##1\mathaccent"7024 i%
    \else \mathaccent"7024 ##1\fi }%
  \def\"##1{\if \i##1\mathaccent"7020 \mathchar"703D
    \else \if I##1\mathaccent"7020 \mathchar"7004
    \else \mathaccent"7020 ##1\fi \fi }%
  \def\!{\mskip-\thinmuskip}}
%    \end{macrocode}

% \end{document}
\endinput
