\NeedsTeXFormat{LaTeX2e}[1996/06/01]
\ProvidesPackage{manuscript}[2002/05/17 v0.3 emulate typesetting
	of typewriter]

\RequirePackage{ifthen}
\newboolean{MS@ps} \setboolean{MS@ps}{false}
\DeclareOption{ps}{\setboolean{MS@ps}{true}}
\ProcessOptions

% somehow I am still not able to create proper quotes
%\setboolean{MS@ps}{true}

% another needed packages
\RequirePackage{setspace}
\RequirePackage[T1]{fontenc}
\RequirePackage[NewCommands]{ragged2e}

% set-up fonts
% italic is not clear with tt fonts -- it is better to keep
% a typewriter tradition alive
\ifthenelse{\boolean{MS@ps}}
{%
	\renewcommand{\rmdefault}{pcr}
}{
	\renewcommand{\rmdefault}{aett}
	\catcode96=13
	\gdef``{{\usefont{OT1}{cmss}{m}{n}\symbol{92}}}
	\catcode39=13
	\gdef''{{\usefont{OT1}{cmss}{m}{n}\symbol{125}}}
	\catcode96=11 \catcode39=11
}
\renewcommand{\sfdefault}{\rmdefault}
\renewcommand{\ttdefault}{\rmdefault}

\RequirePackage{soul}
\renewcommand{\emph}[1]{\ul{#1}}

% setup another additional characteristics of typewriter
% koma-script doesn't work well with komascript
\@ifundefined{typearea}
	{\RequirePackage{fullpage}}
	{\typearea[0sp]{13}}

\let\footnotesize\@empty
\doublespacing
\AtBeginDocument{%
	\raggedright
	\spaceskip .333333 em plus .333333 em minus .111111 em
}

% standard titlehead of the document is really ugly when
% doublespaced
% Polished to work both with standard article and koma-script
\let\my@maketitle=\@maketitle
\def\@maketitle{%
	\singlespacing
	\hyphenpenalty=5000
	% This is ugly hack, but it should be robust enough
	\let\huge\LARGE
	\my@maketitle
}
