%==============================================================================
% Beamer style for posters
% // based on 'cpbgposter' beamer theme //
%==============================================================================


\ProvidesPackage{beamerthemesharelatex}


\RequirePackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,calc}
\RequirePackage[T1]{fontenc}
\RequirePackage{lmodern}
\RequirePackage{textcomp}
\RequirePackage{amsmath,amssymb}
%\usefonttheme{professionalfonts}

\usepackage{ragged2e}

% normal math font
%\usepackage{mathptmx}
% funny math font
%\usepackage{euler}

%%% other text fonts
%\usepackage{palatino}
%\usepackage{bookman}
%\usepackage{utopia}
%\usepackage{tgpagella}
%\usepackage{tgheros}
%
%\renewcommand\rmdefault{qtm}
%\renewcommand\sfdefault{qhv}
%\renewcommand\ttdefault{qcr}
\renewcommand\ttdefault{lmvtt}

% multicols
\usepackage{multicol}
\setlength{\columnsep}{80pt}

% captions
\usepackage[justification=justified,listformat=simple,format=plain,labelformat=simple]{caption}

\usepackage{url}
\setlength{\marginparsep}{1in}

%==============================================================================
% define basic colors 
%==============================================================================
%==============================================================================

  \definecolor{color0}  {RGB}{0,0,0} %%% text color
  \definecolor{color1}  {RGB}{0,0,128} %%% title and subsection color
  \definecolor{color2}  {RGB}{13, 96, 155} %%% section color
  \definecolor{color3}  {RGB}{255,255,255} %%% background color
\definecolor{colorsec}  {RGB}{0, 0, 50} %%% background color
\definecolor{colorsub}  {RGB}{40, 116, 166} %%% background color



%==============================================================================
%==============================================================================

%set the basic colors palette
%   \setbeamercolor{palette primary}   {fg=color0,bg=color3}
%   \setbeamercolor{palette secondary} {fg=color0,bg=color3}
%   \setbeamercolor{palette tertiary}  {fg=color0,bg=color3}
%   \setbeamercolor{palette quaternary}{fg=color0,bg=color3}
  \setbeamercolor{structure}{fg=color1}
%   \setbeamercolor{titlelike}         {bg=color1,fg=color3}
%   \setbeamercolor{frametitle}        {bg=color2!10,fg=color2}
%
  \setbeamercolor{colorbar}{fg=white,bg=color2}
  \setbeamercolor{normal text}{fg=color0}

% background color
  \beamertemplatesolidbackgroundcolor{color3}
  %\beamertemplateshadingbackground{color3}{color3!70!color1}

%set the fonts
  \setbeamerfont{section in head/foot}{series=\bfseries,shape=\scshape}
  \setbeamerfont{block title}{series=\bfseries}
  \setbeamerfont{block alerted title}{series=\bfseries}
  \setbeamerfont{frametitle}{series=\bfseries}
  \setbeamerfont{frametitle}{size=\Large}
  \setbeamerfont{caption}{size=\normalsize}
  \setbeamerfont{caption name}{size=\normalsize}

%set some beamer theme options
  \setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
  \setbeamertemplate{sections/subsections in toc}[square]
  \setbeamertemplate{items}[circle]
  \setbeamertemplate{blocks}[width=0.0]
  \beamertemplatenavigationsymbolsempty
%set bibliography style
 \setbeamertemplate{bibliography item}[text]
 \setbeamercolor{bibliography item}{fg=color0,bg=color3}
 \setbeamercolor{bibliography entry author}{fg=color0,bg=color3}
 \setbeamerfont{bibliography item}{size=\small}
 \setbeamerfont{bibliography entry author}{size=\small}


%
%==============================================================================
% build the poster title
%==============================================================================
\setbeamertemplate{headline}{
 \leavevmode
  \begin{columns}
  	\begin{column}{0.7\linewidth}
  		\vskip1cm
  		\begin{flushleft}
  			\includegraphics[width=1\linewidth]{XMU2}
  		\end{flushleft}
  	\end{column}
%   \begin{column}{0.15\linewidth}
%    \begin{center}
%     \includegraphics[width=0.5\linewidth]{bucky}
%    \end{center}
%   \end{column}
%   \begin{column}{.7\linewidth}
%    \vskip1cm
%    \centering
%    %\usebeamercolor{title in headline}
%{\color{colorsec} \textbf{\huge{\inserttitle}}\\[1ex]}
%    \vskip 1.5cm
%    %\usebeamercolor{author in headline}
%{\color{colorsec} \Large{\insertauthor}\\[1ex]}
%    %\usebeamercolor{institute in headline}
%{\color{colorsec} \large{\insertinstitute}\\[1ex]}
%        \vskip1cm
%      \end{column}
%       \begin{column}{.15\linewidth}
%         \begin{center}
%           \includegraphics[width=0.5\linewidth]{bucky}
%         \end{center}
%       \end{column}
    \end{columns}
\vspace{1cm}
%%% additional bar under titles
\begin{beamercolorbox}[colsep=0.5cm]{colorbar}
\end{beamercolorbox}
\vskip1cm
}


%==============================================================================
% build the poster foot
%==============================================================================
\setbeamertemplate{footline}{
	\begin{beamercolorbox}[colsep=0.4in]{colorbar}
		\begin{center}
			\scshape \small Department of Mathematics and Applied Mathematics, Xiamen University Malaysia
		\end{center}
	\end{beamercolorbox}
}

%
%==============================================================================
% Section and subsection re-definitions

\renewcommand{\section}[1]{
\par\vskip1cm%
%
     \begin{flushleft}
     \begin{tikzpicture}[remember picture,overlay]
       \shade [inner color=color2,outer color=white] (0,0) rectangle (\columnwidth,0.3cm);
     \end{tikzpicture}
     \end{flushleft}
%
     \begin{center}
%     \vskip1cm
     {\color{colorsec} {\textbf{\large #1}}}
     {\parskip0pt\par}
     \end{center}
%
     \begin{flushleft}
     \vskip-1.6cm
     \begin{tikzpicture}[remember picture,overlay]
       \shade [inner color=color2,outer color=white] (0,0) rectangle (\columnwidth,0.3cm);
     \end{tikzpicture}
     \end{flushleft}
%
  {\parskip0pt\par}
  \justifying
}

%%%
\renewcommand{\subsection}[1]{
\par\vskip0.5in%
     \begin{flushleft}
     \vskip0.8cm
     {\color{colorsub} {\textsc{\large #1}}}
     {\parskip0pt\par}
     \end{flushleft}
%
  \justifying
}

%==============================================================================

