%% 
%% pdflatex: ad hoc slide making using pdlatex
%% 
\ProvidesPackage{pdftalk}

% To use, insert in the preamble: \usepackage{pdftalk}
% 
% If sans-serif fonts is to be used (better for slides), use \sf right
% after \begin{document}
%
% To insert graphics:
% - convert *.eps to *.pdf using `epstopdf'.
% - *.jpeg and *.tiff, *.png can be used readily
% - \usepackage{graphics} and use \includegraphics{filename}.
%   Don't specify filename extension (*.pdf, etc.) because \includegraphics
%   do it automatically, and it makes it easier to use both latex and pdflatex
%   (by providing both *.eps and *.pdf version of the graphic file).
%
% To print: toggle the color (dark over white).
% - Use acroread printing to convert to *.ps (remember to 'print-to-file')
% - ps2ps <thefile.ps> <fixedfile.ps>
% - psnup -2 -W9in -H12in -m0in -pa4 -f inputfile.ps outputfile.ps


%% These are included here for convenience. We almost always use them.
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphics}

%% colors. There should be an easy switch for printed slides.
\usepackage{color}

%default colors
\definecolor{bg}{rgb}{0,.2,.5}
\definecolor{hi}{rgb}{1,1,.5}
\definecolor{fg}{rgb}{1,1,1}

\pagecolor{bg}
\color{fg}

\pdfoutput=1
\setlength{\hoffset}{-120pt}
\setlength{\voffset}{-116pt}

% Screendisplay size
% \pdfpagewidth=280pt
% \pdfpageheight=210pt
% adjust margins. these are broken if 12pt or 11pt options is used in \documentclass
% \setlength{\textwidth}{250pt}
% \setlength{\textheight}{190pt}

% 10% bigger dimensions:
% Screendisplay size
% \pdfpagewidth=308pt
% \pdfpageheight=231pt
% \setlength{\textwidth}{275pt}
% \setlength{\textheight}{209pt}

% 20% bigger dimensions:
% Screendisplay size
\pdfpagewidth=336pt
\pdfpageheight=252pt
\setlength{\textwidth}{300pt}
\setlength{\textheight}{228pt}

% paragraphs don't need indent and should have longer skip

\setlength{\parindent}{0pt}
\setlength{\parskip}{1.5ex plus 0.5ex minus 0.2ex}

% Fix section headers to use sans serif.
% These sectioning commands are stolen from the `article.cls' file.
% In addition to sans-serif, the size are made smaller.
\renewcommand\section{\@startsection{section}{1}{\z@}%
			{-3.5ex \@plus -1ex \@minus -.2ex}%
			{2.3ex \@plus .2ex}%
			{\sffamily\large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
			{-3.25ex\@plus -1ex \@minus -.2ex}%
			{1.5ex \@plus .2ex}%
			{\sffamily\normalsize\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
			{-3.25ex\@plus -1ex \@minus -.2ex}%
			{1.5ex \@plus .2ex}%
			{\sffamily\normalsize}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
			{3.25ex \@plus1ex \@minus.2ex}%
			{-1em}%
			{\bfseries\normalsize}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
			{3.25ex \@plus1ex \@minus .2ex}%
			{-1em}%
			{\bfseries\normalsize}}
\renewcommand*\descriptionlabel[1]{\hspace\labelsep
      \bfseries #1}
% Use small verbatim font
\makeatletter
\renewcommand\verbatim@font
{\ttfamily\scriptsize\catcode`\<=\active\catcode`\>=\active}
\makeatother

% Often need to use typewriter style, \| can be used to
% break discretionally in side the \q{  } block
\newcommand\q[1]{\texttt{\def\|{\discretionary{}{}{}}#1}}

% convenient macros for lists
\newcommand\BI{\begin{itemize}}
\newcommand\EI{\end{itemize}}
\newcommand\BE{\begin{enumerate}}
\newcommand\EE{\end{enumerate}}
\newcommand\BD{\begin{description}}
\newcommand\ED{\end{description}}
\newcommand\I\item
\newcommand\BC{\begin{center}}
\newcommand\EC{\end{center}}

%%
%% Make it easy to create new slides
%%
\newenvironment{slide}[1]
%before
{\begin{center}\sffamily\large\bfseries
\textcolor{hi}{#1}
\end{center}\sf\raggedright}
%after
{\newpage}
\newcommand\BS[1]{\begin{slide}{#1}}
\newcommand\ES{\end{slide}}

%% Title slide
%%
\newcommand\titleslide[3]
{
\vspace*{\stretch{1}}
\BC\sf
\textcolor{hi}{\Large\textbf{#1}}\\[20pt]
{\large\textbf{#2}}\\[8pt]
{#3}
\EC
\vspace{\stretch{.75}}
\newpage
}

