% ====================[ moderncvtheme-postmodern.sty  ]====================
%                     [ Time-stamp: "2009-04-18 19:29:36 leycec" ]
%
% --------------------( CHANGELOG                          )--------------------
% 2009-09-12  Cecil Curry  <http://raiazome.com>
%   * Created.

% ....................{ PROVIDES                           }....................
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvtheme-postmodern}%
  [2009/09/12 v0.0.1 moderncv theme for post-modernity]

% ....................{ PACKAGES                           }....................
% Include the "kvoptions" package. This handles multi-valued package and command
% options and arguments (e.g., those following a "key1=val,key2=val" format).
\RequirePackage{kvoptions}

% This theme is built atop the standard "moderncvthemecasual.sty" theme. Thus,
% this theme includes that theme first.
\RequirePackage[blue,roman]{moderncvthemecasual}

% Use TeX Gyre Pagella (i.e., UTF-8 Palatino) as the default serif font.
\RequirePackage{tgpagella}

% Use Bera Mono as the default monospace font.
\RequirePackage[scaled=0.85]{beramono}

% Use Euler-VM (i.e., a slightly more complete AMS Euler) as the default
% mathematical font.
\RequirePackage[euler-digits]{eulervm}

% Load the "hyperref" package if not already loaded.
%
% !!!!!!! IMPORTANT !!!!!!! 
% "hyperref" must be the last package to be loaded. So, please load no other
% packages following this. Very unpleasant things may mayhap happen; dragons
% abounding, and what not.
\@ifpackageloaded{hyperref}{}{%
  \ifpdf\RequirePackage[pdftex]{hyperref}%
  \else \RequirePackage[dvips] {hyperref}%
  \fi%
}

% ....................{ OPTIONS                            }....................
% The following sections define user-settable options as true or false booleans. 
% Please set these options in the "moderncv-lyx-conf.sty" file corresponding to
% your particular document.
%
% Note that all options defined below default to false unless otherwise stated.
% These defaults should produce aesthetically pleasing output across a wide
% variety of software platforms and "real world" thesis dictates; as such, they
% shouldn't need much tweaking on your behalf. (This is good. Spend your
% dilegency academically, rather than hacking academic LaTeX.)

% Initialize the "kvoptions" package specific to this package.
\SetupKeyvalOptions{family=mcvpm,prefix=mcvpm@}

% Declare a boolean option which, if true, instructs this package to format
% output appropriate for a letter: e.g., by delimiting paragraphs by horizontal
% indentation or vertical whitespace, as appropriate.
%
% This defaults to false.
\DeclareBoolOption{letter}

% Declare a boolean option which, if true, instructs this package to format
% output appropriate for printing: e.g., by preventing hyperlinks from being
% output in color.
%
% This defaults to false.
\DeclareBoolOption{printing}

%FIXME: This option is ignored at present: it's all blue! :)
% Declare an option for selecting which color variant of the above theme package
% to use. This is a multi-value option accepting these strings: "blue",
% "orange", "green", "red", and "grey".
\DeclareStringOption[blue]{themecolor}

% Declare void synonyms for the above string option: that is, interpret a
% passed "blue" option as a passed "themecolor=blue" option.
\DeclareVoidOption{blue}{\setkeys{mcvpm}{themecolor=blue}}

%FIXME: Ensure the above options are local rather than global.
% Process the above package options, as externally passed to us by our caller.
\ProcessKeyvalOptions*

% ....................{ FONTS                              }....................
% Redefine fonts defined by the above theme, as desired.

% Use Iwona as the default sans serif font.
\renewcommand{\sfdefault}{iwona}

% ....................{ COLORS                             }....................
% Redefine colors defined by the above theme, as desired.
\definecolor{firstnamecolor}       {rgb}{0.25,0.50,0.75}
\definecolor{familynamecolor}      {rgb}{0.15,0.35,0.60}
\definecolor{quotecolor}           {rgb}{0.35,0.35,0.35}
\definecolor{addresscolor}         {rgb}{0.35,0.35,0.35}
\definecolor{sectionrectanglecolor}{rgb}{0.45,0.70,0.95}
\definecolor{sectiontitlecolor}    {rgb}{0.00,0.45,0.55}
\definecolor{subsectioncolor}      {rgb}{0.30,0.50,0.75}
\definecolor{paragraphrulecolor}   {rgb}{0.05,0.25,0.50}
\definecolor{footersymbolcolor}    {rgb}{0.25,0.50,0.75}

% If printing, output "hyperref"-enabled hyperlinks in black; otherwise,
% output such hyperlinks in color.
\ifmcvpm@printing
  \hypersetup{colorlinks=false}
\else
  \definecolor{urlcolor}             {rgb}{0.00,0.20,0.45}
  \hypersetup{
    colorlinks=true,
    citecolor=webgreen,
    linkcolor=RoyalBlue,
    urlcolor=urlcolor,
  }
\fi

% ....................{ PAGINATION                         }....................
% Adjust page margins.
\RequirePackage[scale=0.8]{geometry}

% If you want to change the width of the column with the dates.
\setlength{\hintscolumnwidth}{3cm}

% Adjust paragraph separation.
\ifmcvpm@letter
  \RequirePackage{parskip}
\fi

% ....................{ SECTIONING                         }....................
% Define the height for section rules.
\newcommand*{\sectionruleheight}{0.25ex}

%FIXME: This command is structurally identical to that of the default \section
%command; it simply adds a reference to the new "\sectionruleheight" command.
%Submit a patch, yes?
% Redefine the \section command so as to produce a dimension-configurable rule:
% that is, a rule whose width and height are configurable.
\renewcommand*{\section}[1]{%
  \vspace*{2.5ex \@plus 1ex \@minus .2ex}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{part}{#1}%
  \parbox[b]{\hintscolumnwidth}{\raggedleft\hintfont%
    {\color{sectionrectanglecolor}\rule{\hintscolumnwidth}{\sectionruleheight}}}%
  \hspace{\separatorcolumnwidth}%
  \parbox[b]{\maincolumnwidth}{\sectionstyle{#1}}\\[1ex]}

\renewcommand*{\cventry@print}[4]{\textbf{#1}; #2; \textsc{#3, #4}.}

% ....................{ LYX                                }....................
% Redefine LyX-specific commands if operating under LyX.

% Colorize the LyX-specific command producing horizontal lines.
\ifthenelse{\isundefined{\lyxline}}{}{%
  \let\lyxline@old\lyxline%
  \renewcommand*{\lyxline}{{\color{paragraphrulecolor}\lyxline@old}}%
}

% ....................{ MODERNCV                           }....................
% Redefine moderncv-specific commands so as to produce stylized text.
\renewcommand*{\cvtext}[1]{\cvline{}{\small #1}}
\renewcommand*{\cvitem}[2]{\cvline{#1}{\small #2}}

\let\cvdoubleitem@old\cvdoubleitem
\renewcommand*{\cvdoubleitem}[4]{\cvdoubleitem@old{#1}{\small #2}{#3}{\small #4}}

% ....................{ LINKING                            }....................
% usage: \httplink[optional text]{link}
\renewcommand*{\httplink}[2][]{%
  \ifthenelse{\equal{#1}{}}%
    {\href{http://#2}{\textsc{http://}#2}}%
    {\href{http://#2}{\textsc{http://}#1}}}

% usage: \emaillink[optional text]{link}
\renewcommand*{\emaillink}[2][]{%
  \ifthenelse{\equal{#1}{}}%
    {\href{mailto:#2}{\textsc{mailto:}#2}}%
    {\href{mailto:#2}{\textsc{mailto:}#1}}}

% ....................{ END                                }....................
% Only for the classic theme, if you want to change the width of your name
% placeholder (to leave more space for your address details).
%\AtBeginDocument{\setlength{\maketitlenamewidth}{6cm}}

\endinput
% --------------------( COPYRIGHT AND LICENSE              )--------------------
% The information below applies to everything in this distribution,
% except where noted.
%              
% Copyleft 2009, 2010 by Cecil Curry.
%   
%   http://www.raiazome.com
% 
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
