% (c) 2002 Matthew Boedicker <mboedick@mboedick.org> (original author)
%     http://mboedick.org
% (c) 2003-2007 David J. Grant <davidgrant-at-gmail.com> http://www.davidgrant.ca
% (c) 2008 Nathaniel Johnston <nathaniel@nathanieljohnston.com>
%     http://www.nathanieljohnston.com
%
% This work is licensed under the Creative Commons Attribution-Noncommercial-Share
% Alike 2.5 License. To view a copy of this license, visit
% http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to Creative
% Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
{% raw %}
\documentclass[letterpaper,11pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage{tocloft}
\usepackage[backend=bibtex,maxnames=99]{biblatex}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}

%-----------------------------------------------------------
% Hyperlink setup
\hypersetup{
    colorlinks=true,        % false: boxed links; true: colored links
    linkcolor=SteelBlue,          % color of internal links
    citecolor=green,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=SteelBlue            % color of external links
}

%-----------------------------------------------------------
%Edit these values as you see fit

% Width of border outside of title bars
\setlength{\outerbordwidth}{3pt}
% Outer background color of title bars (0 = black, 1 = white)
\definecolor{shadecolor}{gray}{0.75}
% Inner background color of title bars
\definecolor{shadecolorB}{gray}{0.93}


%-----------------------------------------------------------
%Margin setup

\setlength{\evensidemargin}{-0.25in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\tabcolsep}{0in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.3in}
\setlength{\topskip}{0in}
\setlength{\voffset}{0.1in}


%-----------------------------------------------------------
%Custom commands
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[1]{\vspace{8pt}
  \parbox{\textwidth}{\setlength{\fboxsep}{\outerbordwidth}
    \begin{shaded}
    \setlength{\fboxsep}{0pt}\framebox[\textwidth][l]{\setlength{\fboxsep}{4pt}\fcolorbox{shadecolorB}{shadecolorB}{\textbf{\sffamily{\mbox{~}\makebox[6.762in][l]{\large #1} \vphantom{p\^{E}}}}}}
    \end{shaded}
  }\vspace{-5pt}
}

\newcommand{\ressubheadingshort}[3]{
    \begin{center}
    \begin{tabular*}{6.5in}{l@{\extracolsep{\fill}}r}
        \multicolumn{2}{c}{\textbf{#1} \cftdotfill{\cftdotsep} #2} \\
        \textit{#3} & \\
        \vphantom{E}
    \end{tabular*}
    \end{center}
    \vspace{-24pt}
}

\newcommand{\ressubheading}[4]{
    \begin{center}
    \begin{tabular*}{6.5in}{l@{\extracolsep{\fill}}r}
        \multicolumn{2}{c}{\textbf{#1} \cftdotfill{\cftdotsep} #2} \\
        \multicolumn{2}{c}{\textit{#3} \cftdotfill{\cftdotsep} \textit{#4}} \\
        \vphantom{E}
    \end{tabular*}
    \end{center}
    \vspace{-24pt}
}

\newcommand{\ressubheadingitems}[5]{
    \begin{center}
    \begin{tabular*}{6.5in}{l@{\extracolsep{\fill}}r}
        \multicolumn{2}{c}{\textbf{#1} \cftdotfill{\cftdotsep} #2} \\
        \multicolumn{2}{p{6.5in}}{\textit{#3} \cftdotfill{\cftdotsep} \textit{#4}} \\
        \vphantom{E}
    \end{tabular*}
    \end{center}
    \vspace{-32pt}
    \begin{itemize}\renewcommand{\labelitemi}{}
        \item\begin{itemize}
        #5
        \end{itemize}
    \end{itemize}
}

%-----------------------------------------------------------
{% endraw %}

% Bibliography
\bibliography{ {{-p['_id']-}} }{}
%\bibliographystyle{plain}

\begin{document}


\begin{tabular*}{7in}{l@{\extracolsep{\fill}}r}
\textbf{\Large {{p['title']}} {{p['name']}}} & \textbf{\today} \\
{{employment[0]['organization']}} & {{p['email']}} \\
\end{tabular*}
\\

{%if len(pubs) > 0%}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Publication listing {{- p['qualifiers'] }}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{enumerate}
{% for pub in pubs %}
    \item \fullcite{ {{-pub['_id']-}} }
{% endfor %}
\end{enumerate}
{% endif %}
\end{document}
