%%
%% This is file `mps-poster.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mps-poster.dtx  (with options: `class')
%% =============================================
%% IMPORTANT NOTICE:
%% This is a generated file.
%% 
%% It is subject to the same copyright conditions (see below)
%% as in the original file: mps-poster.dtx.
%% It may not be distributed without mps-poster.dtx.
%% 
%% Full documentation can be obtained by LaTeXing that original file.
%% Only a few abbreviated comments remain here to describe the usage.
%% =============================================
%% Copyright 2010 Patrick W Daly
%% Max-Planck-Institut f\"ur Sonnensystemforschung
%% Max-Planck-Str. 2
%% D-37191 Katlenburg-Lindau
%% Germany
%% E-mail: daly@mps.mpg.de
%%
%% -------------------------------------------------
\NeedsTeXFormat{LaTeX2e}[1998/06/01]
\ProvidesClass{mps-poster}
          [2010/08/06 3.0 (PWD)]
 % MPAe Posters
 %
 % Use to make posters on A4 paper, which can be sent to A1/A0 printer with
 % magnification. Abstract in 2 columns, text in 2 or 3 automatically
 %
 % Loads packages  color, graphicx and multicol directly
 % Also uses the txfonts package
 % Must manually load (optionally) natbib, epsfig etc
 % Class options:
 %   portrait (default) for portrait format, and two columns
 %   landscape wide, and three columns;
 %   sans  (default) a sans serif font is used
 %   roman      roman (normal) font is used for text
 %   margin=<len>  sets the margin size, default 1cm
 %   a3paper, a2paper, a1paper, a0paper are other size options, default a4paper
 %
 % Extra commands:
 %   \posternumber[r|l]{text}   adds text to upper right or left (def) corner
 %                              of first page
 %   \meeting{text}    adds text to bottom of last column of last page.
 %
 % Normally figure and table environments do not work within multicols, but
 % here they are fixed up. However, they do not float, but appear there where
 % placed, causing spacing problems. Must manually adjust.
 %-----------------------------------------------------------
 % See documentation in the source .dtx file for more details.
\AtBeginDocument{\let\MProman=\rmdefault}
\DeclareOption{roman}{\AtBeginDocument{\let\rmdefault=\MProman\normalfont}}
\DeclareOption{sans}{\AtBeginDocument{\let\rmdefault=\sfdefault\normalfont}}
\DeclareOption{10pt}{\PassOptionsToClass{\CurrentOption}{article}}
\DeclareOption{11pt}{\PassOptionsToClass{\CurrentOption}{article}}
\DeclareOption{12pt}{\PassOptionsToClass{\CurrentOption}{article}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{geometry}}
\ExecuteOptions{sans,mps,mpg}
\PassOptionsToPackage{margin=1cm,portrait,a4paper}{geometry}
\ProcessOptions\relax

\LoadClass{article}
\RequirePackage[dvipsnames]{color}
\RequirePackage{multicol}
\RequirePackage{graphicx}
\RequirePackage{txfonts}
\RequirePackage[ignoreall]{geometry}

\ifdim\paperwidth>\paperheight
  \@ifundefined{pdfoutput}{\special{landscape}}{%
    \ifnum\pdfoutput<1 \special{landscape}%
    \fi
  }\fi

\ps@empty
\setlength\parindent{\z@}
\setlength\parskip{0.5\baselineskip}
\addtolength\parskip{0pt plus 2pt}
\newcommand{\posternumber}[2][l]{\def\@MPnum{#2}\def\@MPside{#1}}
\posternumber{}
\@onlypreamble{\posternumber}
\newcommand{\meeting}[1]{\def\@meeting{#1}}\meeting{}

\definecolor{MPname}{rgb}{.187,.613,.594}
\newlength\templen
\newlength\logowth
\newlength\titlesize
\newlength\authorsize
\newlength\thankssize
\newlength\MPem
\ifdim\paperwidth>\paperheight
  \setlength\logowth{\paperheight}\else\setlength\logowth{\paperwidth}\fi
\setlength\titlesize{0.021\logowth}
\newcommand\titlefont{\fontsize{\titlesize}{1.1\titlesize}%
  \usefont{\encodingdefault}{\sfdefault}{bx}{n}\mathversion{sfbold}}
\setlength\authorsize{0.6\titlesize}
\setlength\MPem{\authorsize}
\newcommand\authorfont{\fontsize{\authorsize}{1.1\authorsize}%
  \usefont{\encodingdefault}{\sfdefault}{n}{n}}
\setlength\thankssize{0.5\titlesize}
\newcommand\thanksfont{\fontsize{\thankssize}{1.1\thankssize}%
  \usefont{\encodingdefault}{\sfdefault}{n}{n}}
\setlength\logowth{0.18\logowth}
\definecolor{headbg}{gray}{.9}
\newcommand{\mpshead}{\noindent
 {\authorfont\makebox[\z@][l]{\parbox[b][\z@][b]{\textwidth}{%
      \makebox[\linewidth][\@MPside]{\authorfont\@MPnum}\vspace{5.5\MPem}}}%
  \setlength{\fboxsep}{1\MPem}%
  \renewcommand\footnotetext[2][]{\textsuperscript{##1}##2\hspace{0.5\MPem}}%
  \setlength\templen{\textwidth}\addtolength\templen{-2\fboxsep}%
  \colorbox{headbg}{%
  \makebox[\templen][s]{%
    \parbox[c]{\logowth}{\includegraphics[width=\logowth]{logo_mpg}}\hfill
    \parbox[c]{0.5\textwidth}{\centering
      {\titlefont \@title\par}\vspace{1\MPem}{\authorfont \@author\par}
      \ifx\@thanks\@empty\else{\vspace{.5\MPem}\thanksfont\@thanks}\fi
    }\hfill
    \parbox[c]{\logowth}{\includegraphics[width=\logowth]{mps_txt_color}}}%
}}}
\@onlypreamble{\title}
\@onlypreamble{\author}
\renewcommand{\maketitle}{%
  \mpshead
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\mpshead\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \startcols
}

\AtEndOfClass{\AtBeginDocument{\maketitle}}
\DeclareMathVersion{sfbold}
\SetSymbolFont{operators}{sfbold}{OT1}{txss}{bx}{n}
\SetSymbolFont{italic}{sfbold}{OT1}{txss}{bx}{it}
\SetMathAlphabet{\mathsf}{sfbold}{OT1}{txss}{b}{n}
\SetMathAlphabet{\mathtt}{sfbold}{OT1}{txtt}{b}{n}
\SetSymbolFont{letters}{sfbold}{OML}{txmi}{bx}{it}
\SetSymbolFont{symbols}{sfbold}{OMS}{txsy}{bx}{n}
\SetSymbolFont{largesymbols}{sfbold}{OMX}{txex}{bx}{n}
\definecolor{abscol}{named}{Red}
\renewenvironment{abstract}{%
   \begin{center}
   {\large\bfseries\textcolor{abscol}{\abstractname}}\\[3ex]
   \begin{minipage}{0.9\linewidth}
}{%
   \end{minipage}
   \end{center}
}
\newcommand{\startcols}{\begin{multicols}{\MPcols}}
\newcommand{\stopcols}{\end{multicols}}
\ifdim\paperwidth<\paperheight
  \newcommand*{\MPcols}{2}\else\newcommand{\MPcols}{3}\fi

  \definecolor{seccol}{named}{OliveGreen}
  \definecolor{subseccol}{named}{RedViolet}
\definecolor{subseccol}{named}{Thistle}
\definecolor{subsubseccol}{named}{CarnationPink}
\setcounter{secnumdepth}{0}
\renewcommand\section{\@startsection {section}{1}{\z@}%
        {-1.5ex \@plus -1ex \@minus -.2ex}%
        {1.3ex \@plus.2ex}%
        {\normalfont\Large\bfseries\textcolor{seccol}}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
        {-1.25ex\@plus -1ex \@minus -.2ex}%
        {0.5ex \@plus .2ex}%
        {\normalfont\large\bfseries\textcolor{subseccol}}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
        {-1.25ex\@plus -1ex \@minus -.2ex}%
        {0.5ex \@plus .2ex}%
        {\normalfont\normalsize\bfseries\textcolor{subsubseccol}}}

\renewcommand{\figure}[1][]{\noindent
  \begin{minipage}{\linewidth}
  \def\@captype{figure}}
\renewcommand{\endfigure}{\end{minipage}}
\expandafter\let\csname figure*\endcsname\figure
\@namedef{endfigure*}{\end{minipage}}

\renewcommand{\table}[1][]{\noindent
  \begin{minipage}{\linewidth}
  \def\@captype{table}}
\renewcommand{\endtable}{\end{minipage}}
\expandafter\let\csname table*\endcsname\table
\@namedef{endtable*}{\end{minipage}}
\definecolor{capcol}{named}{Blue}
\newcommand*{\MPfigfont}{\color{capcol}}

\renewcommand{\figurename}{Fig.}

\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{\MPfigfont#1: #2}%
  \ifdim \wd\@tempboxa >\hsize\MPfigfont
    #1: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\AtEndDocument{\par\vspace{1em}\noindent
  \makebox[\linewidth][r]{\small\@meeting}\end{multicols}}
%% 
%% <<<<< End of generated file <<<<<<
%%
%% End of file `mps-poster.cls'.
