\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{kokosolmupdf}[2000/10/16 Solmu]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Poisto 4.10.2007
% \PassOptionsToPackage{draft,final}{graphicx}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\LoadClass[a4paper,twoside,dvips]{article}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Kieleen ja merkistˆˆn liittyvat paketit
\RequirePackage[finnish]{babel}

% Poisto 4.10.2007
%\RequirePackage[latin1]{inputenc}

% Lisays 4.10.2007
\RequirePackage[applemac]{inputenc}
\RequirePackage[T1]{fontenc}

% Apupaketti laskemista varten
\RequirePackage{calc}

% Paljon matematiikkaan liittyvaa
\RequirePackage[intlimits]{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
\RequirePackage{amsthm}
\RequirePackage{verbatim}

% Xy-pic, "matemaattisia" kuvia varten
%\RequirePackage[all]{xy}
% Tama vie paljon TeXin muistia! Parempi tehda kuvista erikseen 
% epsia ja kayttaa sitten graphicxia, tai sitten ottaa xy:sta vain
% se mita tarvitaan.

% Muulla tavalla piirrettyja kuvia varten

%Lisays 4.10.2007
\RequirePackage[dvips]{graphicx}

%Poisto 4.10.2007
%\RequirePackage[final]{graphicx}
\RequirePackage[abs]{overpic}

% Sivun muotoiluun
\RequirePackage{vpage}
%\RequirePackage{vmargin}
\RequirePackage{fancyheadings}

% Erilaisia luetteloja
\RequirePackage{enumerate}

%% Algoritmeja varten
%\RequirePackage[noend]{algorithmic}
%\renewcommand{\algorithmicrequire}{\textbf{Esiehto:}}
%\renewcommand{\algorithmicensure}{\textbf{Jalkiehto:}}
%\renewcommand{\algorithmicif}{\textbf{jos}}
%\renewcommand{\algorithmicthen}{}
%\renewcommand{\algorithmicelse}{\textbf{muuten}}
%\renewcommand{\algorithmicelsif}{\textbf{jos}}
%\renewcommand{\algorithmicfor}{\textbf{toista}}
%\renewcommand{\algorithmicforall}{\textbf{kaikille}}
%\renewcommand{\algorithmicdo}{\textbf{toista}}
%\renewcommand{\algorithmicwhile}{\textbf{niin kauan kuin}}
%\renewcommand{\algorithmicloop}{\textbf{toista}}
%\renewcommand{\algorithmicrepeat}{\textbf{toista}}
%\renewcommand{\algorithmicuntil}{\textbf{kunnes}}

% Ulkonakˆpaketteja: monipalstainen teksti, anfangit, tekstin
% vaistamat kuvat, tekstin sovittaminen annettuun kokoon
\RequirePackage{multicol}
%\RequirePackage{dropcaps}
\RequirePackage{picinpar}   % oli ennen {floatflt}
\RequirePackage{textfit}

% WWW-linkkien muodostamiseen
%\RequirePackage[dvips,pdfpagemode=None,colorlinks,urlcolor=blue,filecolor=blue]{hyperref}
\RequirePackage[dvips,pdfpagemode=None]{hyperref}

% Kehystetty minipage (LaTeX Companion, A.2.4)
\newsavebox{\fminibox}
\newlength{\fminilength}
\newenvironment{fminipage}[1][\linewidth]
 {\setlength{\fminilength}{#1-2\fboxsep-2\fboxrule}%
  \begin{lrbox}{\fminibox}\begin{minipage}{\fminilength}}
 {\end{minipage}\end{lrbox}\noindent\fbox{\usebox{\fminibox}}}

% Tehtavien ja ratkaisujen tekoon

\newenvironment{tehtratk}%
	{\begin{list}{\arabic{enumi}.}{\usecounter{enumi}%
	\setlength{\labelsep}{0.5em}%
	\settowidth{\labelwidth}{\arabic{enumi}.}%
	\setlength{\leftmargin}{\labelwidth+\labelsep}}}%
	{\end{list}}

\newenvironment{tehtratk10}%
	{\begin{list}{\arabic{enumi}.}{\usecounter{enumi}%
	\setlength{\labelsep}{0.5em}%
	\settowidth{\labelwidth}{1\arabic{enumi}.}%
	\setlength{\leftmargin}{\labelwidth+\labelsep}}}%
	{\end{list}}

\newenvironment{tehtiso}%
	{\begin{list}{\arabic{enumi}.}{\usecounter{enumi}%
	\setlength{\labelsep}{0.5em}%
	\settowidth{\labelwidth}{1.5\arabic{enumi}.}%
	\setlength{\leftmargin}{\labelwidth+\labelsep}}}%
	{\end{list}}

% Taustan tummennuksiin taulukoissa

\RequirePackage{colortbl}

% Laatikoita

\RequirePackage{boxedminipage}
\RequirePackage{fancybox}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Muotoillaan sivu

\setlength{\hoffset}{-1in}
\setlength{\voffset}{-1in}
\setpapersize{Afour}
\setmargins{1.95cm}{1.5cm}{17.15cm}{24.5cm}{12pt}{18pt}{0pt}{0pt}
% leftmargin, topmargin, textwidth, textheight,
% headheight, headsep, footheight, footskip


% Ala- ja ylareunat

\pagestyle{fancy}
\lhead[\small\arabic{page}]{\small Solmu 2/2008}
\rhead[\small Solmu 2/2008]{\small\arabic{page}}
\chead[]{}
\lfoot[]{}
\rfoot[]{}
\cfoot[]{}
%\setlength{\headrulewidth}{0pt}

% Palstojen vali
\setlength{\columnseprule}{\headrulewidth}
\addtolength{\columnsep}{1mm}

% Joitain matematiikkamakroja

% Matti Lehtisen kayttamat -- huomaa, etta \( ja \) ovat LaTeXin komentoja!
\def\as{^{\circ}}
\def\({\left(}
\def\){\right)}

% Kerkko Luoston kayttamat
\newcommand{\NN}{\mathbb{N}}
\newcommand{\osaj}{\subset}

\makeatletter
\def\joukko#1%
    {\relax\ifmmode\joukk@#1\rel@x!\rel@x\rel@x
           \else$\joukk@#1\rel@x!\rel@x\rel@x$\fi}
\let\rel@x\relax
\def\joukk@ #1!#2\rel@x #3\rel@x
    {\if!#3\{\,#1\mid#2\,\}\else
     \{#1\}\fi}
\makeatother


% Komentoja

% lainaus-ymparistˆ, paaasiassa lehdistˆkatsauksiin

\makeatletter
\newenvironment{lainaus}
               {\list{}{\itemindent 8em \leftmargin 0pt \rightmargin 0pt}
                \slshape%
                \item\relax}
               {\endlist}

% suora puolilainausmerkki
\font\plmfont=cmtt10
\def\plm{{\plmfont\symbol{'015}}}

% Luvut, aliluvut jne:
% \section = artikkeli

%kokeilu 4.10.2007
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                     {-3.5ex \@plus -1ex \@minus -.2ex}%
                                     {3.0ex \@plus.5ex \@minus .5ex}%
                                     {\normalfont\LARGE\bfseries\raggedright}}
                                     
%\renewcommand\section{\@startsection {section}{1}{\z@}%
%                                    {-3.5ex \@plus -1ex \@minus -.2ex}%
%                                   {3.0ex \@plus.5ex \@minus .5ex}%
%                                     {\normalfont\Huge\bfseries\raggedright}}


\renewcommand\thesection{\relax}

\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\Large\bfseries}}

\renewcommand\thesubsection{\@arabic\c@subsection}

\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries}}  



\makeatother


\newlength{\palstanleveys}
\setlength{\palstanleveys}{(\textwidth-\columnsep)/2}

\newcommand{\artikkeli}[1]{%
  \section*{#1}%
  \addcontentsline{toc}{section}{#1}%
}

\newcommand{\kirjoittanut}[1]{%
  \nopagebreak%
  \begin{flushleft}%
    #1
  \end{flushleft}}

\newcommand{\linkki}[2]{#1\footnote{\texttt{#2}}}
\newcommand{\anfangi}[1]{\bigdrop{0pt}{2}{ecrm24}{#1}}
\renewcommand{\emph}[1]{\textsl{#1\/}} % korostus

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
