%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
%% Rakenteiden Mekaniikka class for LaTeX files - 10.4.2017 RK
%%                                             
%% \maketitle makes the first page automatically
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
  
\NeedsTeXFormat{LaTeX2e}  
\ProvidesClass{rmstyle}[2017/05/11 RM paper class]  
  
\DeclareOption{10pt}{\OptionNotUsed}  
\DeclareOption{11pt}{\OptionNotUsed}  
\DeclareOption{twocolumn}{\OptionNotUsed}  
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}  
  
\ProcessOptions\relax  
  
\LoadClass[12pt,a4paper]{article}  
  
%\RequirePackage[latin1]{inputenc}   % unix käyttäjille
\RequirePackage[ansinew]{inputenc}  % Windows käyttäjille
%\RequirePackage[cp1252]{inputenc}   % vaihtoehto Windows käyttäjille
%\RequirePackage[cp850]{inputenc}    % MS-DOS
%\RequirePackage[aplemac]{inputenc}  % Macintoshin käyttäjille


\RequirePackage{amsfonts,amssymb,amsbsy,amsmath}
\RequirePackage{bm}  
\RequirePackage{booktabs}  
\RequirePackage{calc}  
\RequirePackage{epsfig}
\RequirePackage{graphicx}
\RequirePackage{lastpage}
\RequirePackage{paralist}  
\RequirePackage{stmaryrd}
\RequirePackage{setspace}
\RequirePackage[colorlinks,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}
\RequirePackage{doi}

%\font\mathbbm=bbmb12
%\font\slbgreek=cmmib12

\setlength{\paperheight}{297mm}
\setlength{\paperwidth}{210mm}
\setlength{\headheight}{0mm}
\setlength{\headsep}{0mm}
\setlength{\topmargin}{0mm}
\setlength{\hoffset}{3mm}  
\setlength{\voffset}{5mm}  
\setlength{\oddsidemargin}{0mm}  
\setlength{\textheight}{245mm}  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% jostain syystä tämä tuottaa 150 mm leveän tekstin !!!!!
\setlength{\textwidth}{160mm}  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\textfloatsep}{12pt}  
\setlength{\abovedisplayskip}{6pt}  
\setlength{\belowdisplayskip}{6pt}  
\setlength{\parindent}{6mm}  
\setlength{\abovecaptionskip}{6pt}  
\setlength{\belowcaptionskip}{6pt}  
\setlength{\itemsep}{0pt}  


%% Title  
\renewcommand{\maketitle}{%  
 \newpage  
% \thispagestyle{empty}  
 \begin{spacing}{1.0}%  
  {\noindent\normalfont{Rakenteiden Mekaniikka (Journal of Structural Mechanics)} \\
   Vol. \@volume, No \@issue, \@year, pp. \thepage\ -- \pageref{LastPage} \\
   \url{http://rakenteidenmekaniikka.journal.fi/index} \\
   \url{https://doi.org/10.23998/rm.\@doilabel} \\
   \copyright The authors \@year. \\
   Open access under CC BY-SA 4.0 license.}
 \end{spacing}
  {%3  
   \mbox{}\vspace{15mm}\\  
   \fontsize{16}{19}\selectfont\sffamily
   \bfseries{\@title}  
   \par  
  }%3  
  \vspace{18pt}%  
  {%4  
   \noindent\normalfont\@author  
   \par  
  }%4  
  \vspace{14pt}%  
  {%5  
   \def\and{\\\vspace{14pt}}  
%   \normalfont\@address  
   \par  
  }%5  
% \end{center}  
}% End of \@maketitle  
  

\def\volume{\@getvolume}
\def\@getvolume#1{\gdef\@volume{#1}}
\def\issue{\@getissue}
\def\@getissue#1{\gdef\@issue{#1}}
\def\year{\@getyear}
\def\@getyear#1{\gdef\@year{#1}}
\def\doilabel{\@getdoilabel}
\def\@getdoilabel#1{\gdef\@doilabel{#1}}



\def\author{\@ifnextchar[{\@getshortauthor}{\@getauthor}}  
\def\@getauthor#1{\gdef\@author{#1}\gdef\@shortauthor{#1}}  
\def\@getshortauthor[#1]#2{\gdef\@shortauthor{#1}\gdef\@author{#2}}  
  
\newcommand{\address}[1]{\gdef\@address{#1}}  
  
  
%\def\sectionLevel{1}  
%\def\sectionIndent{0pt}  
%\def\sectionSpaceBefore{12pt}  
%\def\sectionSpaceAfter{6pt}  
%\def\sectionStyle{\normalsize\bfseries\MakeUppercase}  
  
%\renewcommand{\section}{%  
%  \@startsection{section}{\sectionLevel}{\sectionIndent}{\sectionSpaceBefore}%  
%                {\sectionSpaceAfter}{\sectionStyle}}%  

  
  
  
\renewcommand{\@makecaption}[2]{%  
  \vskip\abovecaptionskip  
  \sbox\@tempboxa{\normalsize\fontsize{10}{12}\selectfont #1. #2}%  
  \ifdim \wd\@tempboxa >\hsize  
    \normalsize\fontsize{10}{12}\selectfont #1. #2\par  
  \else  
    \global \@minipagefalse  
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%  
  \fi  
  \vskip\belowcaptionskip}  
  
\renewenvironment{thebibliography}[1]  
  {\section*{\refname\@mkboth{\refname}{\refname}}%  
   \list{\@biblabel{\@arabic\c@enumiv}}%  
        {\settowidth\labelwidth{\@biblabel{#1}}%  
         \leftmargin\labelwidth  
         \advance\leftmargin\labelsep  
         \@openbib@code  
         \usecounter{enumiv}%  
         \let\p@enumiv\@empty  
         \renewcommand\theenumiv{\@arabic\c@enumiv}}%  
   \sloppy  
   \clubpenalty4000  
   \@clubpenalty \clubpenalty  
   \widowpenalty4000%  
   \sfcode`\.\@m}  
  {\def\@noitemerr  
   {\@latex@warning{Empty `thebibliography' environment}}%  
   \endlist}  

  
  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\summary{
\begin{small}
%\fontsize{11}{12}
\begin{spacing}{0.8}
\paragraph{\sffamily{Summary.}}
}
%\def\endsummary{}
\def\endsummary{\end{spacing}\end{small}}
\mark{}


\newcommand\keywordssec{\@startsection{paragraph}{4}{\z@}{6pt}{-1.1ex}{\itshape}}

\def\keywords{
\begin{small}
\keywordssec{Key words:}
}
\def\endkeywords{\end{small}}
\mark{}

\renewcommand\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
 -.2ex}{1.5ex plus .2ex}{\normalsize\sffamily\bfseries}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus 
 -.2ex}{1.1ex plus .2ex}{\normalsize\sffamily\itshape}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus 
 -1ex minus -.2ex}{1.1ex plus .2ex}{\normalsize\itshape}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\renewcommand{\footnoterule}{\hrule width 0pt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bold Greek alphabets
\def\balpha{\ensuremath{\boldsymbol{\alpha}}}
\def\bbeta{\ensuremath{\boldsymbol{\beta}}}
\def\bsigma{\ensuremath{\boldsymbol{\sigma}}}
\def\bvepsilon{\ensuremath{\boldsymbol{\varepsilon}}}
\def\bepsilon{\ensuremath{\boldsymbol{\epsilon}}}
\def\blambda{\ensuremath{\boldsymbol{\lambda}}}
\def\bvtheta{\ensuremath{\boldsymbol{\vartheta}}}
\def\btheta{\ensuremath{\boldsymbol{\theta}}}
\def\bphi{\ensuremath{\boldsymbol{\phi}}}
\def\bvphi{\ensuremath{\boldsymbol{\varphi}}}
\def\bpsi{\ensuremath{\boldsymbol{\psi}}}
\def\bdelta{\ensuremath{\boldsymbol{\delta}}}
\def\bkappa{\ensuremath{\boldsymbol{\kappa}}}
\def\bgamma{\ensuremath{\boldsymbol{\gamma}}}
\def\bxi{\ensuremath{\boldsymbol{\xi}}}
\def\bet{\ensuremath{\boldsymbol{\eta}}}
\def\btau{\ensuremath{\boldsymbol{\tau}}}
\def\bomega{\ensuremath{\boldsymbol{\omega}}}
\def\bzeta{\ensuremath{\boldsymbol{\zeta}}}
\def\bmu{\ensuremath{\boldsymbol{\mu}}}
\def\bnu{\ensuremath{\boldsymbol{\nu}}}
\def\brho{\ensuremath{\boldsymbol{\rho}}}
\def\bchi{\ensuremath{\boldsymbol{\chi}}}
%
\def\bGamma{\ensuremath{\boldsymbol{\Gamma}}}
\def\bDelta{\ensuremath{\boldsymbol{\Delta}}}
\def\bTheta{\ensuremath{\boldsymbol{\Theta}}}
\def\bLambda{\ensuremath{\boldsymbol{\Lambda}}}
\def\bPi{\ensuremath{\boldsymbol{\Pi}}}
\def\bXi{\ensuremath{\boldsymbol{\Xi}}}
\def\bSigma{\ensuremath{\boldsymbol{\Sigma}}}
\def\bPhi{\ensuremath{\boldsymbol{\Phi}}}
\def\bPsi{\ensuremath{\boldsymbol{\Psi}}}
\def\bOmega{\ensuremath{\boldsymbol{\Omega}}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% some operators
\newcommand{\ddp}{\ensuremath{\boldsymbol{:}\,}}
\newcommand{\bo}[1]{\mbox{\boldmath${\mathit{#1}}$}}
\newcommand{\bu}[1]{\mbox{$\mathbf{#1}$}}
\newcommand{\jump}[1]{\mbox{$\left[\hspace{-2pt}\left[{#1}\right]\hspace{-2pt}\right]$}}
\newcommand{\enorm}[1]{\,|\!|\!| {{#1}} |\!|\!|}

\newcommand{\Div}{\operatorname{Div}}
\newcommand{\diver}{\operatorname{div}}
\newcommand{\grad}{\operatorname{grad}}
\newcommand{\Grad}{\operatorname{Grad}}
\newcommand{\dev}{\operatorname{dev}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\dd}[1]{\mbox{${\mathrm d}{#1}$}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
\AtBeginDocument{%  
%  \pagestyle{empty}  
  \maketitle  
  \let\maketitle\relax  
\setcounter{secnumdepth}{-2}
}  
  
\endinput  
