% Document class for Journal of Computer Security submissions
% Andrew Myers, Cornell University
%
% Usage: \documentclass[options]{jcssubmit}
%
% Options: [12pt]

\NeedsTeXFormat{LaTeX2e}[2.09]
\ProvidesClass{jcssubmit}[2013/10/10 v1.2 JCS submission template]

\DeclareOption{11pt}{\twelveptfalse}
\DeclareOption{12pt}{\twelvepttrue}
\DeclareOption*{\ClassWarning{jcssubmit}{Unknown option `\CurrentOption'}}

\newif\iftwelvept\twelveptfalse

\ProcessOptions\relax

\iftwelvept
    \PassOptionsToClass{12pt}{article}
\else
    \PassOptionsToClass{11pt}{article}
\fi

\LoadClass{article}


%%%%%
% Set the size of the text block

\textheight 22.9cm
\textwidth 13.3cm
\headheight 0pt
\headsep 0pt

%%%%%%
% Use 15pt interline spacing instead of 13.6
\iftwelvept
    \renewcommand\baselinestretch{1.034}
    \textwidth 14.5cm
\else
    \renewcommand\baselinestretch{1.103}
\fi

%%%%%
% compute margins automatically from text height and width
\oddsidemargin 0.5\pdfpagewidth
\advance \oddsidemargin -0.5\textwidth

\topmargin 0.5\pdfpageheight
\advance \topmargin -0.5\textheight

\footskip \pdfpageheight
\advance \footskip -\textheight
\iftwelvept
    \advance \footskip -12pt % font height
\else
    \advance \footskip -11pt % font height
\fi
\footskip 0.25\footskip

% Correct margins for LaTeX gratuitousness
\advance \oddsidemargin -1in
\advance \topmargin -1in
\evensidemargin \oddsidemargin

%\marginparwidth 0pt         % Margin pars are not allowed.
%\marginparsep 11pt          % Horizontal space between outer margin and 
                             % marginal note

%%%%%%%%%%%%%%
% font choices
%
% Use Times Roman as the standard Roman font, rather than Computer Modern Roman.
\renewcommand{\rmdefault}{ptm}

% Use txtt as the typewriter font, since it supports bold.
\renewcommand{\ttdefault}{txtt}
\DeclareMathAlphabet{\mathtt}{OT1}{txtt}{m}{n}
\SetMathAlphabet{\mathtt}{bold}{OT1}{txtt}{b}{n}
