1. Vedran Miletić
  2. beamer

Commits

Till Tantau  committed 5c913f9

\article and \common macros added

  • Participants
  • Parent commits 039f4cc
  • Branches default

Comments (0)

Files changed (6)

File ChangeLog

View file
+2001-11-04 Till Tantau <tantau@users.sourceforge.net>
+
+	- Added \article, \common, \presentation macros for creating an
+	  article version of a presentation from the same file.
+	- Corrected several examples in the user guide.	
+
 2003-10-28 Till Tantau <tantau@users.sourceforge.net>
 
 	Version 0.92:

File TODO

View file
 5) Put internal macros in beamer.cls into a namespace
 6) "Cleanup" beamer.cls
 7) Document some of the commands for creating headline and footlines.
+8) Add option to create an article from the same file as the
+   main document.

File beamer.cls

View file
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesClass{beamer}
-[2003/10/23 v0.92 Class for Typesetting a Beamer Presentation]
-
-\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+[2003/10/23 v0.92-dev Class for Typesetting a Beamer Presentation]
 
 % Copyright 2003 by Till Tantau <tantau@cs.tu-berlin.de>.
 %
 % of the LaTeX Project Public License Distributed from CTAN
 % archives in directory macros/latex/base/lppl.txt.
 
+%
+% Presentation/article stuff
+%
+% Copyright notice: Part of the following code is taken from the
+% package comment.sty by Victor Eijkhout
+%
+
+
+%
+% Comment stuff. This will also be needed, if we switch to another
+% class, so define it here already.
+%
+\newif\ifbeamer@inpresentation
+\beamer@inpresentationtrue
+
+\def\beamer@makeinnocent#1{\catcode`#1=12 }
+\def\beamer@startcomment{%
+    \begingroup%
+    \let\do\beamer@makeinnocent\dospecials%
+    \beamer@makeinnocent\^^L% and whatever other special cases
+    \endlinechar`\^^M \catcode`\^^M=12 \beamer@ignore}
+
+{\catcode`\^^M=12\endlinechar=-1%
+ \gdef\beamer@ignore#1^^M{%
+    \expandafter\beamer@processline}
+ \gdef\beamer@processline#1^^M{%
+   \def\beamer@test{#1}%
+    \ifx\beamer@test\beamer@stoparticle%
+      \let\next=\article%
+    \else%
+      \ifx\beamer@test\beamer@stoppresentation%
+        \let\next=\presentation%
+      \else%
+        \ifx\beamer@test\beamer@stopcommon%
+          \let\next=\common%
+        \else%
+          \ifx\beamer@test\beamer@stopdocument%
+            \let\next=\beamer@enddocument%
+          \else
+            \ifx\beamer@test\beamer@begindocument%
+              \let\next=\beamer@startdocument%
+            \else
+              \let\next=\beamer@processline%
+          \fi%  
+          \fi%  
+        \fi%
+      \fi%
+    \fi%
+    \next}
+}
+\def\article{\beamer@closer%
+  \ifbeamer@inpresentation%
+    \let\next=\beamer@startcomment%
+    \gdef\beamer@closer{\endgroup}%
+  \else%
+    \let\next=\relax%
+    \gdef\beamer@closer{}%
+  \fi%
+  \next}  
+
+\def\presentation{\beamer@closer%
+  \ifbeamer@inpresentation%
+    \let\next=\relax%
+    \gdef\beamer@closer{}%
+  \else%
+    \let\next=\beamer@startcomment%
+    \gdef\beamer@closer{\endgroup}%
+  \fi%
+  \next}
+\def\common{\beamer@closer\gdef\beamer@closer{}}
+\def\beamer@enddocument{\beamer@closer\end{document}}
+\def\beamer@startdocument{\beamer@closer\begin{document}\def\beamer@closer{}\presentation}
+\def\beamer@closer{}
+{\escapechar=-1\relax%
+  \xdef\beamer@stoparticle{\string\\article}
+  \xdef\beamer@stoppresentation{\string\\presentation}
+  \xdef\beamer@stopcommon{\string\\common}
+  \xdef\beamer@stopdocument{\string\\end\string\{document\string\}}
+  \xdef\beamer@begindocument{\string\\begin\string\{document\string\}}
+}
+\newbox\beamer@commentbox
+\def\beamer@startcommentinframe{%
+  \begingroup%
+  \edef\beamer@closer{\egroup\beamer@closer}%
+  \setbox\beamer@commentbox=\vbox\bgroup\leavevmode}
+
+
+
+
+%
+% Check whether we should initiate transfer to another class
+%
+
+% Extract class name, if present
+\def\beamer@classname{}
+\def\beamer@classoptions{}
+\def\beamer@findclassname#1,#2!{
+  \def\beamer@temp{#1}
+  \ifx\beamer@temp\@empty
+  \else
+    \beamer@parseclass#1=!
+  \fi
+  \def\beamer@temp{#2}
+  \ifx\beamer@temp\@empty
+    \let\next=\@gobble 
+  \else
+  \let\next=\beamer@findclassname
+  \fi
+  \next#2!}
+\def\beamer@classnamename{class}
+\def\beamer@optionname{option}
+\def\beamer@parseclass#1=#2!{
+  \def\beamer@temp{#1}
+  \ifx\beamer@temp\beamer@classnamename
+    \beamer@extractclassname#2
+  \else
+    \ifx\beamer@temp\beamer@optionname
+      \beamer@extractoption#2
+    \fi
+  \fi  
+}
+\def\beamer@extractclassname#1={
+  \def\beamer@classname{#1}
+}
+\def\beamer@extractoption#1={
+  \ifx\beamer@classoptions\@empty
+    \def\beamer@classoptions{#1}
+  \else
+    \edef\beamer@classoptions{\beamer@classoptions,#1}  
+  \fi
+}
+
+\def\beamer@transfer{
+  \beamer@inpresentationfalse
+  \edef\beamer@classwhat{[\beamer@classoptions]{\beamer@classname}}
+  \expandafter\LoadClass\beamer@classwhat
+  \endinput
+  }
+
+\expandafter\beamer@findclassname\@classoptionslist,!
+\ifx\beamer@classname\@empty
+  \let\next=\relax
+\else
+  % Need to transfer to another class soon
+  \let\next=\beamer@transfer
+\fi
+\next
+
+
+
 
 %
 %
 \long\def\@@section#1{\@section[#1]{#1}}
 \long\def\@section[#1]#2{%
   \refstepcounter{section}%
-  \@ifempty{#2}{\long\def\secname{#1}}{\long\def\secname{#2}\addtocontents{toc}{\protect\sectionintoc{\thesection}{#2}{\thepage}}}%
+  \@ifempty{#2}{\long\def\secname{#1}}{\long\def\secname{#2}\addtocontents{btoc}{\protect\sectionintoc{\thesection}{#2}{\thepage}}}%
   \addtocontents{head}{\protect\headcommand{\protect\sectionentry{\thesection}{#1}{\thepage}{\secname}}}%
   {\let\\=\relax\xdef\sectionlink{{Navigation\thepage}{\noexpand\secname}}}%
   \def\insertsection{\expandafter\hyperlink\sectionlink}%
   \def\insertsubsection{}%
   \def\lastsubsection{}%
-  \Hy@writebookmark{\thesection}{\secname}{Outline\thesection}{1}{toc}%
+  \Hy@writebookmark{\thesection}{\secname}{Outline\thesection}{1}{btoc}%
   \hyper@anchorstart{Outline\thesection}\hyper@anchorend}%
 \def\insertsection{}
 \def\lastsubsection{}
     \long\def\subsecname{#2}%
     \long\def\lastsubsection{#1}%
     \ifbeamer@inappendix%
-    \addtocontents{toc}{\protect\appendixsubsectionintoc{\thesection}{\thesubsection}{#2}{\thepage}}%
+    \addtocontents{btoc}{\protect\appendixsubsectionintoc{\thesection}{\thesubsection}{#2}{\thepage}}%
     \else%
-    \addtocontents{toc}{\protect\subsectionintoc{\thesection}{\thesubsection}{#2}{\thepage}}%
+    \addtocontents{btoc}{\protect\subsectionintoc{\thesection}{\thesubsection}{#2}{\thepage}}%
     \fi%
   }%
   \edef\subsectionlink{{Navigation\thepage}{\noexpand\subsecname}}%
   \def\insertsubsection{\expandafter\hyperlink\subsectionlink}
-  \Hy@writebookmark{\thesubsection}{#1}{Outline\thesection.\thesubsection.\thepage}{2}{toc}%
+  \Hy@writebookmark{\thesubsection}{#1}{Outline\thesection.\thesubsection.\thepage}{2}{btoc}%
   \hyper@anchorstart{Outline\thesection.\thesubsection.\thepage}\hyper@anchorend}
 
 
   \hypersetup{pdfpagetransition=R}%
   \hypersetup{pdfpageduration=}%
   \xdef\beamer@frameendpage{\thepage}% every time
+  \let\beamer@startcomment=\beamer@startcommentinframe%
   \beamer@entrycode\vspace*{-\baselineskip}\begin{pauses}\vfill}%
   {\beamer@exitcode\vskip0pt plus 1.5fill\end{pauses}}
 
   \beamer@inappendixtrue%
   \refstepcounter{section}%
   \long\edef\secname{\appendixname}%
-  \addtocontents{toc}{\protect\appendixtoc{\thesubsection}{\appendixname}{\thepage}}
+  \addtocontents{btoc}{\protect\appendixtoc{\thesubsection}{\appendixname}{\thepage}}
   \addtocontents{head}{\protect\headcommand{\protect\appendixsectionentry{\thesection}{\secname}{\thepage}{\secname}}}%
   \xdef\sectionlink{{Navigation\thepage}{\noexpand\secname}}%
   \def\insertsection{\expandafter\hyperlink\sectionlink}%
   \def\insertsubsection{}%
   \def\lastsubsection{}%
-  \Hy@writebookmark{\thesection}{\secname}{Outline\thesection}{1}{toc}%
+  \Hy@writebookmark{\thesection}{\secname}{Outline\thesection}{1}{btoc}%
   \hyper@anchorstart{Outline\thesection}\hyper@anchorend}%
 
 
     \def\appendixsubsectionintoc##1##2##3##4{}%
     \fi%
     \begin{pauses}[0]%
-      \@input{\jobname.toc}%
+      \@input{\jobname.btoc}%
     \end{pauses}\vfill}%
   \normalcolor
   }
     \if@filesw
       \newwrite\tf@head
       \immediate\openout\tf@head\jobname.head\relax
-      \newwrite\tf@toc
-      \immediate\openout\tf@toc\jobname.toc\relax
+      \newwrite\tf@btoc
+      \immediate\openout\tf@btoc\jobname.btoc\relax
     \fi
 }
 
   {\small\structure{\insertcaptionname:} \insertcaption}}
 
 
-
 %
 % Notes
 %
 % Default Theme
 %
 %
-
-  
+ 
                                 % Title page  
 \usetitlepagetemplate{
   \vbox{}
 
 
 
+

File doc/beamerexample.pdf

Binary file modified.

File doc/beamerexample.tex

View file
   Technical University of Berlin}
 \date[DLT 2003]{Developments in Language Theory Conference, 2003}
 
+
 \begin{document}
 
 \frame{\titlepage}

File doc/beameruserguide.tex

View file
 
 
 
-\subsubsection{Verbatim Commands inside Frames}
-
-The \verb!\verb! command and the verbatim environment work only in
-frames that contain a single slide. Furthermore, you must explicitly
-specify that the frame contains only one slide; like this:
+\subsubsection{Verbatim Commands and Listings inside Frames}
+
+The \verb!\verb! command, the verbatim environment, the lstlisting
+environment, and related environments work only in frames that contain
+a single slide. Furthermore, you must explicitly specify that the
+frame contains only one slide; like this: 
 \begin{verbatim}
 \frame[all:1]
 {
   \frametitle{Our Search Procedure}
 
-  \begin{verbatim}
+\begin{verbatim}
   int find(int* a, int n, int x)
   {
     for (int i = 0; i<n; i++)
 \Command{defverbatim}
 \Parameters{
 \item command name (including a backslash)
-\item a normal parameter that contains a \texttt{verbatim} or
-  \texttt{verbatim*} environment.
+\item a normal parameter that contains a \texttt{verbatim},
+  \texttt{verbatim*}, \texttt{lstlisting}, or a related environment. 
 }
 \Description{
   Declares a verbatim environment for later use. The declaration
 
 \Command{usetemplatetocsection}
 \Parameters{
-\item a template for a section name in the table of contents.
-\item a template for a grayed section name in the table of contents.
+\item A color mix-in specification for grayed sections names. This
+parameter is optional and given in square brackets. If present, the
+normal parameter for the grayed section name must be omitted.
+\item A template for a section name in the table of contents.
+\item A template for a grayed section name in the table of contents.
   }
 \Example
 \begin{verbatim}
 \usetemplatetocsection
 {\color{structure}\inserttocsection}
-{\color{structureshaded}\inserttocsection}
+{\color{structure!50}\inserttocsection}
+
+\usetemplatetocsection[50!averagebackgroundcolor]
+{\color{structure}\inserttocsection}
 \end{verbatim}
 
 \Command{usetemplatetocsubsection}
 \Parameters{
-\item a template for a subsection name in the table of contents.
-\item a template for a grayed subsection name in the table of contents.
+\item A color mix-in specification for grayed subsections names. This
+parameter is optional and given in square brackets. If present, the
+normal parameter for the grayed subsection name must be omitted.
+\item A template for a subsection name in the table of contents.
+\item A template for a grayed subsection name in the table of contents.
   }
 \Example
 \begin{verbatim}
 \usetemplatetocsubsection
 {\leavevmode\leftskip=1.5em\color{black}\inserttocsubsection\par}
-{\leavevmode\leftskip=1.5em\color{shaded}\inserttocsubsection\par}
+{\leavevmode\leftskip=1.5em\color{black!50}\inserttocsubsection\par}
+
+\usetemplatetocsection[50!averagebackgroundcolor]
+{\leavevmode\leftskip=1.5em\color{black}\inserttocsubsection\par}
 \end{verbatim}
 
 
   \usebibliographyblocktemplate
   {\color{structure}}
   {\par\color{black}}
-  {\par\color{structuremedium}}
-  {\par\color{structuremedium}}
+  {\par\color{structure!75}}
+  {\par\color{structure!75}}
 \end{verbatim}
 
 
   }
 \Example
 \begin{verbatim}
-\usefoottemplate{\hfil\tiny{\color{shaded}\insertpagenumber}}
+\usefoottemplate{\hfil\tiny{\color{black!50}\insertpagenumber}}
 \end{verbatim}
 or
 \begin{verbatim}
 \usefoottemplate{%
   \vbox{%
-    \tinycolouredline{structuremedium}%
+    \tinycolouredline{structure!75}%
       {\color{white}\textbf{\insertshortauthor\hfill\insertshortinstitute}}%
     \tinycolouredline{structure}%
       {\color{white}\textbf{\insertshorttitle}\hfill}%
 \useheadtemplate{%
   \vbox{%
   \vskip3pt%
-  \line{\insertnavigation{\paperwidth}}%
+  \beamerline{\insertnavigation{\paperwidth}}%
   \vskip1.5pt%
-  \insertvrule{0.4pt}{structureshaded}}%
+  \insertvrule{0.4pt}{structure!50}}%
 }
 \end{verbatim}
 
   \dp\tempbox=2pt%
   \wd\tempbox=\beamer@sidebarwidth%
   \box\tempbox}
-{\setbox\tempbox=\hbox{\color{structuremedium}\tiny{\kern3pt\insertsectionhead}}%
+{\setbox\tempbox=\hbox{\color{structure!75}\tiny{\kern3pt\insertsectionhead}}%
   \ht\tempbox=8pt%
   \dp\tempbox=2pt%
   \wd\tempbox=\beamer@sidebarwidth%
   \dp\tempbox=2pt%
   \wd\tempbox=\beamer@sidebarwidth%
   \box\tempbox}
-{\setbox\tempbox=\hbox{\color{structuremedium}\tiny{\kern3pt\insertsectionhead}}%
+{\setbox\tempbox=\hbox{\color{structure!75}\tiny{\kern3pt\insertsectionhead}}%
   \ht\tempbox=8pt%
   \dp\tempbox=2pt%
   \wd\tempbox=\beamer@sidebarwidth%
 \begin{verbatim}
 \usesectionheadtemplate
 {\color{structure}\tiny\insertsectionhead}
-{\color{structureshaded}\tiny\insertsectionhead}
+{\color{structure!50}\tiny\insertsectionhead}
 \end{verbatim}
 
 
 \begin{verbatim}
 \usesubsectionheadtemplate
 {\color{structure}\tiny\insertsubsectionhead}
-{\color{structureshaded}\tiny\insertsubsectionhead}
+{\color{structure!50}\tiny\insertsubsectionhead}
 \end{verbatim}
 
 
     \vrule height\boxsize width0.4pt%
   }
   {%
-    \color{structureshaded}%
+    \color{structure!50}%
     \vrule height\boxsize width0.4pt%
   }
   {.1cm}