% Style file for NSTX-U presentation in beamer 
% created by N. Bertelli (July 18 2014)

\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shadings}
\definecolor{secinhead}{RGB}{249,196,95}
\definecolor{shadowbg}{RGB}{51,51,51}
\definecolor{dr}{RGB}{192,0,0}
\definecolor{shadowgray}{RGB}{191,191,191}
\definecolor{blue_ppt}{RGB}{51,51,204}
\definecolor{blue_new}{RGB}{51,102,153}
\definecolor{red_new}{RGB}{146,0,0}


\setbeamercolor{secsubsec}{fg=secinhead,bg=black}
\setbeamercolor{shadow}{fg=secinhead,bg=shadowbg}

\renewcommand{\rmdefault}{phv} % Arial


% Shade definition
\pgfdeclareverticalshading{mytopshade}{\paperwidth}{%
    color(0pt)=(gray!40);
    color(10pt)=(gray)}
    
%\usefonttheme{Arial} 
\usepackage[scaled]{uarial}
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc} 




% delete the navigation symbol in each slides
\setbeamertemplate{navigation symbols}{}


% define the headline only in the title page
\defbeamertemplate{headline}{title1page}{%
 \hbox{%
\begin{tikzpicture}
\tikzset{
    mynode/.style={rectangle, top color=white,bottom color=shadowbg!25, minimum width = \paperwidth, minimum height = 1.18cm} 
        } 
\node[mynode, color = blue_ppt, font = \Large] {\insertframetitle};
%\node at (-4.1,0){\pgftext{\includegraphics[scale=0.15]{doe-ofes-logo-transparent.png}}};
\node at (-4.6,0) {\pgftext{\includegraphics[scale=0.15]{NSTX-U_logo_thick_font_transparent.png}}};
\node at (4.1,0){\pgftext{\begin{minipage}{5cm}\begin{center}{\bf NSTX-U is sponsored by the}\\ {\bf U.S. Department of Energy Office of Science}\\{\bf Fusion Energy Sciences}\end{center}\end{minipage}}};
\end{tikzpicture}
      }% 
  \hbox{%
  \tikz\draw[draw=none,top color= red_new, bottom color= red_new] (0,0) rectangle (\paperwidth,0.06);
       }% 
}


\makeatletter
\define@key{beamerframe}{title1page}[true]{%
  \setbeamertemplate{headline}[title1page]%
}
\makeatother




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

 \setbeamertemplate{title page}
 {
 \begin{center}          
 {\it\bf\LARGE{\color{blue_new}\inserttitle}} \\ 
 {\it\bf\large{\color{black}\insertauthor}}\\
 {\it{\color{black}\insertinstitute}}\\
 {{\color{red_new}\insertdate}}
 \end{center}%
 }


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Banner for each slides following PPT NSTX-U template
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setbeamertemplate{frametitle}
{
\leavevmode%
 \hbox{%
 \hspace{-1.145cm}
\begin{tikzpicture}
\tikzset{
    mynode/.style={rectangle, top color=white,bottom color=shadowbg!25, minimum width = \paperwidth, minimum height = 1.28cm}
        } 
\node[mynode, color = blue_new, font = \Large\bf ] {\insertframetitle};
\end{tikzpicture}
      }%   
\vskip-16.5pt
  \hbox{%
  \hspace{-1.145cm}
  \tikz\draw[draw=none,top color= red_new, bottom color= red_new] (0,0) rectangle (\paperwidth,0.05);
       }%
       
}



 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% footer in each slide
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 
\setbeamertemplate{footline}
{
% \ifnum \insertpagenumber=1
%       \leavevmode%
%       \hbox{%
%       \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,center]{}%
%         % empty environment to raise height
%       \end{beamercolorbox}}%
%       \vskip0pt%
\ifnum \insertpagenumber=1
      \leavevmode%
      \hbox{%
      \begin{tikzpicture}
      \centering
%      \tikzset{
%              mynode3/.style={minimum width = 5cm, minimum height = 2.5cm}          
%                  }
       \node[minimum width = 3cm, minimum height = 2.5cm] at (-4,1.5)  {\pgftext{\includegraphics[scale=.25]{PPPL-LOGO.jpg} }};
       \node[minimum width = 5cm, minimum height = 3cm] at (1,1.5) {\pgftext{\includegraphics[scale=.25]{foto2.pdf} }};
% scale 0.09 {NSTXU_team_photo.jpg} }};
       \node[minimum width = 4cm, minimum height = 3cm] at (5.8,1.5) {\pgftext{\includegraphics[scale=0.19]{NSTX-U_cutaway_high_res.png}}};
       \end{tikzpicture}
}%
      \vskip0pt%

\else
      \vskip-2pt
      \hbox{%
       \tikz\draw[draw=none,top color= red_new, bottom color= red_new] (0,0) rectangle (\paperwidth,0.082);
       }%
      \vskip-1pt
%      \vskip-5pt
      \leavevmode%
       \hbox{%
        \begin{tikzpicture}
          \tikzset{
              mynode2/.style={rectangle, top color=shadowbg!25,bottom color=white, minimum width = \paperwidth, minimum      height = 0.35cm}              
                  } 
           \node[mynode2, color = blue_new, font = \tiny]{      
           \insertshortauthor~|~\insertshorttitle~|~\insertshortdate
%    \insertframenumber/\inserttotalframenumber 
          ~|~\tiny{\insertframenumber{}}};
          \node at (-5.75,0) {\pgftext{\includegraphics[scale=0.055]{NSTX-U_logo_thick_font_transparent.png}}};
%          \node at (-5.65,0) {\pgftext{\it{\color{blue_ppt}NSTX-U}}};
        \end{tikzpicture}
            }% 
 
\fi
}




