% % LaTeX slides macro % by Luis Cabral (luismbcabral@gmail.com) % (c) 2004-2008 % For the past few years, I have been working on this sty file. Ask me for the latest version. % % This is a very "light" macro that does a decent job and does not take up a lot of memory. % Unlike beamer and other macros, it is compatible with PicTeX and other memory intensive macros. % \usepackage{ifthen} \usepackage{color} \usepackage{graphicx} \usepackage[paperwidth=120mm,paperheight=90mm,pdftex,top=0in,bottom=0in,left=.35in,right=.35in]{geometry} % % Set boolean variables. % You turn these on by entering (in your document) % \setboolean{handout}{true}, etc % \newboolean{author} \newboolean{handout} \newboolean{slidenumber} % % Declare counters and indicators. % The ones you should worry about are: template and slidetype. % Both can be changed in the text. % \newcounter{template} \newcounter{slidetype} \newcounter{frame} \newcounter{itemnumber} % % Style declarations % Defines sanserif as default style. % You can change this or simply comment it out to get Times Roman instead. % \renewcommand{\familydefault}{\sfdefault} \raggedright % % Slide header and footer. % As a default, the footer only includes page number (if you turn slidenumber on). % In template 2, I redefine \slidefooter into something more complex. % \newcommand{\slideheader}[1]{\newpage\mbox{}\vspace*{-3.7ex}\par \hspace*{-6ex}\colorbox{titleshade}{\hspace*{2ex}\raisebox{5.0ex}{}\raisebox{-1ex}{}\color{title} {\Large\textbf{#1}}\hspace*{5in}}\vspace*{1ex}} \newcommand{\slidefooter}{\vfill \ifthenelse{\boolean{slidenumber}} {\hspace*{-4.5ex}\raisebox{1.05ex}{\parbox{2ex}{\tiny\thepage}}}{}} % % Item list and parameters. You can play around with these, % For example, the bullet character is set at $\bullet$, but you can change it. % Major, minor, and minorminor refers to the three levels of lists I consider. % \newenvironment{list1}{\begin{list}{\majoritembullet}{\majorlistparameters}}{\end{list}} \newenvironment{list2}{\vspace*{-.5ex}\begin{list}{\minoritembullet}{\minorlistparameters\small}}{\end{list}\normalsize} \newenvironment{list3}{\vspace*{-.5ex}\begin{list}{\minorminoritembullet}{\minorlistparameters\small}}{\end{list}\normalsize} \newcommand{\majoritembullet}{{\color{title}\raisebox{0.3ex}{\small$\bullet$}}} \newcommand{\minoritembullet}{{\color{title}\raisebox{0ex}{$-$}}} \newcommand{\minorminoritembullet}{{\color{title}\raisebox{0ex}{$\rightarrow$}}} \newcommand{\majoritembulletdimmed}{{\color{gray}\raisebox{0.3ex}{\small$\bullet$}}} \newcommand{\majorlistparameters}{\labelsep 1.5ex \leftmargin 3ex \labelwidth 2ex\itemsep .5ex \baselineskip 2.5ex}% \newcommand{\minorlistparameters}{\labelsep 1.5ex \leftmargin 3ex \labelwidth 2ex\itemsep .0ex \baselineskip 2.5ex}% % % Slide animation. This is the core of the sty file. % \repeatslide takes two "parameters": the number of repetitions, and the slide itself. % \newcommand{\repeatslide}[2]{% \ifthenelse{\boolean{handout}}{#2}{% \forloop{frame}{1}{\value{frame}<#1}{\setcounter{itemnumber}{0}#2\addtocounter{page}{-1}}% \setcounter{itemnumber}{0}#2% }} \newcommand{\atframe}[2]{\ifthenelse{\theframe=#1\or\boolean{handout}}{#2}{}} \newcommand{\beforeframe}[2]{\ifthenelse{\theframe=#1\or\theframe<#1\or\boolean{handout}}{#2}{}} \newcommand{\afterframe}[2]{\ifthenelse{\theframe=#1\or\theframe>#1\or\boolean{handout}}{#2}{}} \newcommand{\onlyonce}[1]{\ifthenelse{\boolean{handout}\or\theitemnumber=\theframe\or\theslidetype=0}{#1}{}} \newcommand{\backtoslide}[2]{% \ifthenelse{\boolean{handout}}{} {\setcounter{slidetype}{#1}\setcounter{frame}{#2}\setcounter{itemnumber}{0}\currentslide}} % % slideitem command: this is one of the key indicators % % 0. Show all items at all times (initial default) % 1. Show items sequentially % 2. Show one item at a time % 3. Show one item at a time even in handout % \newcommand{\slideitem}[1]{ \ifnum\theslidetype=0% Show all items at all times \addtocounter{itemnumber}{1} \item #1 \fi \ifnum\theslidetype=1% Show items sequentially \if\boolean{handout} \item #1 \else \addtocounter{itemnumber}{1} \ifthenelse{\theitemnumber<\theframe\or\theitemnumber=\theframe}{\item#1}{} \fi \fi \ifnum\theslidetype=2% Show one item at a time \if\boolean{handout} \item #1 \else \addtocounter{itemnumber}{1} \ifthenelse{\theitemnumber=\theframe}{\item #1}{\item[\majoritembulletdimmed]{\color{gray}#1}} \fi \fi \ifnum\theslidetype=3% Show one item at a time even in handout \addtocounter{itemnumber}{1} \ifthenelse{\theitemnumber=\theframe}{\item #1}{\item[\majoritembulletdimmed]{\color{gray}#1}} \fi } % % slideelement command: similar to slideitem but without bullet points % \newcommand{\slideelement}[1]{ \ifnum\theslidetype=0% Show all items at all times \addtocounter{itemnumber}{1} #1 \fi \ifnum\theslidetype=1% Show items sequentially \if\boolean{handout} #1 \else \addtocounter{itemnumber}{1} \ifthenelse{\theitemnumber<\theframe\or\theitemnumber=\theframe}{#1}{} \fi \fi \ifnum\theslidetype=2% Show one item at a time \if\boolean{handout} #1 \else \addtocounter{itemnumber}{1} \ifthenelse{\theitemnumber=\theframe}{#1}{{\color{gray}#1}} \fi \fi \ifnum\theslidetype=3% Show one item at a time even in handout \addtocounter{itemnumber}{1} \ifthenelse{\theitemnumber=\theframe}{#1}{{\color{gray}#1}} \fi } % % FOR loop. Used in \repeatslide command % \newcommand{\forloop}[5][1]{% \setcounter{#2}{#3}% \ifthenelse{#4}{% #5% \addtocounter{#2}{#1}% \forloop[#1]{#2}{\value{#2}}{#4}{#5}% }{}% }% % % Outline feature % \newcommand{\outline}[1]{% \setcounter{frame}{#1}% \setcounter{itemnumber}{0}% \setcounter{slidetype}{2}% \outlineslide% \setcounter{slidetype}{0}% } % % Miscellaneous commands % \newcommand{\shortnote}[1]{\ifthenelse{\boolean{author}}{\hfill{\framebox{\tiny #1}}}{}} \newcommand{\longnote}[1]{\ifthenelse{\boolean{author}}{\framebox{\parbox{65ex}{\tiny #1}}}{}} \newcommand{\pagenote}[1]{\ifthenelse{\boolean{author}}% {\newpage\addtocounter{page}{-1}\mbox{}\par\parbox{\textwidth}{{\parskip5pt\scriptsize#1}}} {} } \newcommand{\mytheorem}[2]{\par\vspace{.5\baselineskip}{\bf \color{title}{#1.}} {\sl #2}\par} % % Templates and slidetype % \newcommand{\slidetype}[1]{\setcounter{slidetype}{#1}} \newcommand{\template}[1]{% \ifthenelse{#1=1}{% regular seminar template \setcounter{template}{1} \renewcommand{\familydefault}{\sfdefault} \definecolor{background}{rgb}{.8,.8,.8} \definecolor{title}{rgb}{0.7,0.2,0.2} \definecolor{shade}{rgb}{.7,.7,.7} \definecolor{gray}{rgb}{.65,.65,.65} \definecolor{titleshade}{rgb}{.7,.7,.7} \pagecolor{background} }{}% \ifthenelse{#1=2}{% template for NYU Stern classes \setcounter{template}{2} \renewcommand{\familydefault}{\sfdefault} \definecolor{background}{rgb}{.8,.8,.8} \definecolor{title}{rgb}{.4,.1,.4} \definecolor{shade}{rgb}{.7,.7,.8} \definecolor{gray}{rgb}{.65,.65,.65} \definecolor{titleshade}{rgb}{.7,.5,.7} \pagecolor{background} \renewcommand{\slidefooter}{\vfill \hspace*{-4.5ex}\raisebox{1.05ex}{\parbox{2ex}{\tiny\thepage}}\hspace*{64ex}\raisebox{1ex}{\hbox{\resizebox{0.5in}{!}{\includegraphics{C://Cabral_I/LaTeX/sterngreylogo.pdf}}}}} }{}% } \template{1} % Make this the default template \endinput