\documentclass{report}
\usepackage[russian]{babel}
\usepackage[koi8-r]{inputenc}

\begin{document}
\title{Тестовый файл для русского языка}
\author{Михаил Байков}
\date{2002-04-26}

\maketitle

\tableofcontents

\chapter{Введение}

\section{Inline equations}

Parsing the tricky \verb#$$# properly $\varepsilon $$_o$ as an example.

First begin with simple \verb#$# delimited equation such as
$x+y=w$ as an example.  All the equations in this section should
look identical.

Next how about a simple \verb#\begin{math}# delimited equation such as
\begin{math}x+y=w\end{math} as an example.  All the equations in this section should
look identical.

Now consider \verb#\(# and \verb#\)# delimited equation such as
\(x+y=w\) as an example.  All the equations in this section should
look identical.

\section{Unnumbered equations}

I will start with a simple \verb#$$# wave equation
that will have no number
$$
\nabla^2 \phi -{1\over c} {\partial \phi\over \partial t}  = 0
$$
This is followed by a \verb#displaymath# environment
\begin{displaymath}
\nabla^2 \phi -{1\over c} {\partial \phi\over \partial t}  = 0
\end{displaymath}
Here is an example of the \verb#\[# displaymath environment
\[
\nabla^2 \phi -{1\over c} {\partial \phi\over \partial t}  = 0
\]


\section{Numbered equations}
Next comes an \verb#equation# environment
\begin{equation}
\nabla^2 \phi -{1\over c} {\partial \phi\over \partial t}  = 0
\end{equation}
Note that \verb#\nonumber# in an \verb#equation# environment still gets
an equation number
\begin{equation}
\nabla^2 \phi -{1\over c} {\partial \phi\over \partial t}  = 0 \nonumber
\end{equation}

\section{Testing equation array}

Here the equation array is being tested.  This equation has no equation number
and is about as simple as an equation array can get.
\begin{eqnarray*}
z & = & w + x + \\
  &   & 5w - 8c 
\end{eqnarray*}

Here the equation array is being tested.  This equation has equation numbers
and is almost as simple as an equation array can get.
\begin{eqnarray}
z & = & w + x + \\
  &   & 5w - 8c 
\end{eqnarray}

Here the equation array is being tested.  This equation the first and third equations numbered
\begin{eqnarray}
z & = & w + x  \\
z & = & w + x \nonumber\\
z & = & w + x  
\end{eqnarray}

Here the equation array is being tested.  This checks for a bug when 
\verb#\nonumber# is present in an \verb#\begin{eqnarray*}# environment.  
No equations should be numbered.
\begin{eqnarray*}
z & = & w + x  \\
z & = & w + x \nonumber\\
z & = & w + x  
\end{eqnarray*}

\section{Equation numbering test}
This equation needs a number 
\begin{equation}\label{ab3}
\,\varphi\,=\,\left|\,
\begin{array}{c}
\psi_1 \\
\psi_2
\end{array}\,\right|\,; \quad {\rm and} \quad
\,\chi\,=\,\left|\,
\begin{array}{c}
\psi_3 \\
\psi_4
\end{array}\,\right|\,; \quad {\rm or} \quad
\,\eta\,=\,\left|\,
\begin{array}{c}
\tilde{\psi}_1 \\
\tilde{\psi}_2
\end{array}\,\right|\,; \quad {\rm and} \quad
\,\lambda\,=\,\left|\,
\begin{array}{c}
\tilde{\psi}_3 \\
\tilde{\psi}_4
\end{array}\,\right|\,;
\end{equation}
more text following

\section{Testing math environment closing}

For a while, getting \texttt{latex2rtf} to contain all the math elements
to the enclosing was a major headache.  It is working for now.  Here are
a few test cases.

Case 1 Here a math environment is found within an italic environment
\textit{s$_c+1$} or {\it s$_c$}

Case 2 The odd construction \verb#$a+\bf R$# follows $a+\bf R$ which
should make ``a'' italic and ``R'' bold

Case 3 Same as above but using \verb#\(# to enter a math environment
\(a+\bf R\) roman type follows

Case 4 Same as above but using \verb#\[# to enter a math environment \[a+\bf R\] 
roman type follows

Case 5 Same as above but using \verb#\begin{math}# to enter a math environment
\begin{math}a+\bf R\end{math} roman type follows

Case 6 Same as above but using \verb#\begin{equation}# to enter a math environment
\begin{equation}a+ \bf R\end{equation} roman type follows

Case 7 Same as above but using \verb#\begin{eqnarray}# to enter a math environment
\begin{eqnarray}a+ \bf R\end{eqnarray} roman type follows

Case 8 Same as above but using \verb#\begin{equation*}# to enter a math environment
\begin{equation*}a+ \bf R\end{equation*} roman type follows

Case 9 Same as above but using \verb#$$# to enter a math environment
$$a+ \bf R$$ roman type follows


\section{Large Delimiters}

\subsection{Determinant}

$$
\det A = \left| \begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{array} \right|
$$

\subsection{Mixed Delimiters}
$$
w =  \left| 4 x^3 + \left( (x-y) + \frac{42}{1+x^4} \right) \right|.
$$

\subsection{Submatrices}
$$
A = \left[ \begin{array}{cccc}
\left|\begin{array}{cc}
b_{11}&b_{12}\\
b_{21}&b_{22}
\end{array}\right|
 & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{array} \right]
$$

\subsection{Fractions}
Simple
$$
{x \over y}
$$
More complicated
$$
{x+1 \over {x+2 \over y+z +w}}
$$
Missing braces
$$
x \over y
$$
Including braces
$$
{\{ x+y \} \over w}
$$
Including left
$$
{\left{\sqrt{y+z}\right}\over w}
$$

\section{fields}
Problem with mbox containing \$ in a field
$$
x[l]\leftarrow x[(l+m) mod  n] \oplus \mbox{shiftright}(x[l])
 \oplus \left\{ \begin{array}{ll}
                0   & \mbox{if LSB of $x[l]$=0} \\
                b   & \mbox{if LSB of $x[l]$=1,}
               \end{array}
        \right.
$$
problem with correctly delimiting the above equation 
$
x[l]\leftarrow x[(l+m) mod  n] \oplus \mbox{shiftright}(x[l])
 \oplus \left\{ \begin{array}{ll}
                0   & \mbox{if LSB of $x[l]$=0} \\
                b   & \mbox{if LSB of $x[l]$=1,}
               \end{array}
        \right.
$

\end{document}
