Commits

Anonymous committed 24e2b73

Columns can now be top-aligned or centered

  • Participants
  • Parent commits 48590a8

Comments (0)

Files changed (11)

+2003-01-19 Till Tantau <tantau@users.sourceforge.net>
+
+	- Added placement options to columns and column commands.
+	- Added \column command.
+	- Changed lyx layout to use new command \column.
+
+2003-01-19 Till Tantau <tantau@users.sourceforge.net>
+
+	Version 1.21
+	- Fixed bug in \insertverticalnavigation that made sidebar themes
+	  unusable. 
+	
 2004-01-16 Till Tantau <tantau@users.sourceforge.net>
 
 	Version 1.20
 beamer/doc/themelined2.pdf
 beamer/doc/themeplain.pdf
 beamer/doc/themeplain2.pdf
+beamer/doc/themeshadow.pdf
+beamer/doc/themeshadow2.pdf
 beamer/doc/themesidebar.pdf
 beamer/doc/themesidebar2.pdf
 beamer/doc/themesidebardark.pdf
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesClass{beamer}
-[2004/01/17 v1.20 Class for Typesetting a Beamer Presentation]
+[2004/01/19 v1.21 Class for Typesetting a Beamer Presentation]
 
 % Copyright 2003 by Till Tantau <tantau@users.sourceforge.net>.
 %

base/beamerbaseframecomponents.sty

 % Columns
 %
 %
+\define@key{beamer@col}{onlytextwidth}[true]{%
+  \def\beamer@colentrycode{\hbox to\textwidth\bgroup\ignorespaces}%
+  \def\beamer@colexitcode{\unskip\egroup}}
+\define@key{beamer@col}{totalwidth}{%
+  \def\beamer@colentrycode{\hbox to#1\bgroup\ignorespaces}%
+  \def\beamer@colexitcode{\unskip\egroup}}
+\define@key{beamer@col}{c}[true]{\def\beamer@colalign{c}}
+\define@key{beamer@col}{t}[true]{\def\beamer@colalign{t}}
+\define@key{beamer@col}{b}[true]{\def\beamer@colalign{b}}
 
-\newenvironment{columns}{%
-  \leavevmode%
-  \hskip-\beamer@leftmargin%
-  \nobreak%
-  \beamer@tempdim=\textwidth%
-  \advance\beamer@tempdim by\beamer@leftmargin%
-  \advance\beamer@tempdim by\beamer@rightmargin%
-  \hbox to\beamer@tempdim\bgroup%
-  \hbox{}\hfill\ignorespaces}%
-  {\egroup%
+\newenvironment{columns}[1][]{%
+  \def\beamer@colentrycode{%
+    \hbox to\textwidth\bgroup%
+    \leavevmode%
+    \hskip-\beamer@leftmargin%
     \nobreak%
-    \hskip-\beamer@rightmargin}
+    \beamer@tempdim=\textwidth%
+    \advance\beamer@tempdim by\beamer@leftmargin%
+    \advance\beamer@tempdim by\beamer@rightmargin%
+    \hbox to\beamer@tempdim\bgroup%
+    \hbox{}\hfill\ignorespaces}%
+  \def\beamer@colexitcode{\egroup%
+    \nobreak%
+    \hskip-\beamer@rightmargin\egroup}%
+  \ifbeamer@centered\setkeys{beamer@col}{c}\else\setkeys{beamer@col}{t}\fi%
+  \setkeys{beamer@col}{#1}%
+  \par%
+  \beamer@colentrycode%
+  \def\beamer@colclose{}\ignorespaces}%
+  {\beamer@colclose\def\beamer@colclose{}\beamer@colexitcode}%
   
 \newenvironment{columnsonlytextwidth}%
-  {\leavevmode\hbox to\textwidth\bgroup\ignorespaces}
-  {\unskip\egroup}
+  {\begin{columns}[onlytextwidth]}{\end{columns}}
 
-\newenvironment{column}[1]{%
-  \ifbeamer@centered%    
-  \begin{minipage}[c]{#1}%
+
+\newenvironment{beamer@columnenv}[2][\beamer@colalign]{%
+  \beamer@colclose\def\beamer@colclose{}%
+  \begin{minipage}[#1]{#2}%
+    \raggedright}
+  {\end{minipage}\hfill\@ignoretrue}
+\let\endcolumn\endbeamer@columnenv
+
+\def\beamer@columnname{column}
+\def\column{%
+  \ifx\@currenvir\beamer@columnname%
+  \let\beamer@next=\beamer@columnenv%
   \else%
-  \begin{minipage}[t]{#1}%
+  \let\beamer@next=\beamer@columncom%
   \fi%
+  \beamer@next}
+
+\newcommand\beamer@columncom[2][\beamer@colalign]{%
+  \beamer@colclose%
+  \def\beamer@colclose{\end{minipage}\hfill\ignorespaces}%
+  \begin{minipage}[#1]{#2}%
     \raggedright}
-  {\end{minipage}\hfill\ignorespaces}
-
+      
 
 %
 %

base/beamerbasenavigation.sty

           \else
             \beamer@sectionsidenohilight%
           \fi}}%
-      \currentsubsection=1\relax\fi}%
+      \beamer@currentsubsection=1\relax\fi}%
     \def\slideentry##1##2##3##4##5##6{%
       \ifnum##6=\c@part%
-      \ifnum##2=\currentsubsection%
-      \advance\currentsubsection by1%
+      \ifnum##2=\beamer@currentsubsection%
+      \advance\beamer@currentsubsection by1%
       \def\insertsubsectionhead{##5}%
       \hbox{\beamer@link(##4){%
           \ifnum\thesection=##1%
             \beamer@subsectionsidenohilight%
           \fi}}%
       \fi\fi}%
-    \currentsubsection=1\relax%
+    \beamer@currentsubsection=1\relax%
     \dohead%
   }}
 

doc/beameruserguide.pdf

Binary file modified.

doc/beameruserguide.tex

 
 \begin{document}
 
-\title{User's Guide to the Beamer Class, Version 1.20\\
+\title{User's Guide to the Beamer Class, Version 1.21\\
 \Large\href{http://latex-beamer.sourceforge.net}{\texttt{http://latex-beamer.sourceforge.net}}}
 \author{Till Tantau\\
   \href{mailto:tantau@users.sourceforge.net}{\texttt{tantau@users.sourceforge.net}}}
 \subsection{Step Five: Test Your Presentation}
 
 \emph{Always} test your presentation. For this, you should
-vocalize or subvocalize your talk in a quite environment. Typically,
+vocalize or subvocalize your talk in a quiet environment. Typically,
 this will show that your talk is too long. You should then remove
 parts of the presentation, such that it fits into the allotted time
 slot. Do \emph{not} attempt to talk faster in order to squeeze the
   upper part of the box in a different color, which also depends on
   the scheme. The following options can be given:
   \begin{itemize}
-  \item |scheme=|\meta{name} causes the color scheme \meta{name} to be
+  \item \declare{|scheme=|\meta{name}} causes the color scheme \meta{name} to be
     used. A color scheme must previously be defined using the command
     |\beamerboxesdeclarecolorscheme|.
-  \item |width=|\meta{dimension} causes the width of the text inside
+  \item \declare{|width=|\meta{dimension}} causes the width of the text inside
     the box to be the specified \meta{dimension}. By default, the
     |\textwidth| is used. Note that the box will protrude 4pt to the
     left and right.
-  \item |shadow=|\meta{true or false}. If set to |true|, a shadow will
+  \item \declare{|shadow=|\meta{true or false}}. If set to |true|, a shadow will
     be drawn.    
   \end{itemize}
   A color scheme dictates the background colors used in the head part
 |columns|. Inside this environment, you can place several
 |column| environments. Each will create a new column.
 
-\begin{environment}{{columns}}
+\begin{environment}{{columns}\oarg{options}}
   A multi-column area. Inside the environment you should place only
-  |column| environments.
+  |column| environments or |\column| commands (see below). The
+  following \meta{options} may be given: 
+  \begin{itemize}
+  \item
+    \declare{|b|} will cause the bottom lines of the columns to be
+    vertically aligned.
+  \item
+    \declare{|c|} will cause the columns to be centered vertically
+    relative to each other. Default, unless the global option
+    |slidestop| is used. 
+  \item
+    \declare{|onlytextwidth|} is the same as |totalwidth=\textwidth|.
+  \item
+    \declare{|t|} will cause the first lines of the columns to be
+    aligned. Default if global option |slidestop| is used.
+  \item
+    \declare{|totalwidth=|\meta{width}} will cause the columns to occupy
+    not the whole page width, but only \meta{width}, all told.
+  \end{itemize}
+    
   \example
 \begin{verbatim}
-\begin{columns}
+\begin{columns}[t]
   \begin{column}{5cm}
-    First column.
+    Two\\lines.
   \end{column}
   \begin{column}{5cm}
-    Second column.
+    One line (but aligned).
+  \end{column}
+\end{columns}
+\end{verbatim}
+  
+  \example
+\begin{verbatim}
+\begin{columns}[t]
+  \column{5cm}
+    Two\\lines.
+
+  \column{5cm}
+    One line (but aligned).
+\end{columns}
+\end{verbatim}
+\end{environment}
+
+To create a column, you can either use the |column| environment or the
+|\column| command. 
+
+\begin{environment}{{column}\oarg{placement}\marg{column width}}
+  Creates a single column of width \meta{column width}. The vertical
+  placement of the enclosing |columns| environment can be overruled by
+  specifying a specific \meta{placement} (|t| for top, |c| for
+  centered, and |b| for bottom). 
+
+  \example The following code has the same effect as the above examples:
+\begin{verbatim}
+\begin{columns}
+  \begin{column}[t]{5cm}
+    Two\\lines.
+  \end{column}
+  \begin{column}[t]{5cm}
+    One line (but aligned).
   \end{column}
 \end{columns}
 \end{verbatim}
 \end{environment}
 
-\begin{environment}{{columnsonlytextwidth}}
-  This command has the same effect as |columns|, except that the
-  columns will not occupy the whole page width, but only the text
-  width. 
-\end{environment}
-
-
-\begin{environment}{{column}\marg{column width}}
-  Creates a single column of width \meta{column width}. The column is
-  centered vertically relative to the other columns.
-\end{environment}
-
+\begin{command}{{\column}\oarg{placement}\marg{column width}}
+  Starts a single column. The parameters and options are the same as
+  for the |column| environment. The column automatically ends with the
+  next occurence of |\column| or of a |column| environment or of the
+  end of the current |columns| environment.
+
+  \example 
+\begin{verbatim}
+\begin{columns}
+  \column[t]{5cm}
+    Two\\lines.
+  \column[t]{5cm}
+    One line (but aligned).
+\end{columns}
+\end{verbatim}
+\end{command}
 
 
 

examples/beamerexample1.pdf

Binary file modified.

examples/beamerexample1.tex

   \frametitle{The Standard Model of Linear Space}
 
   \begin{columns}
-    \begin{column}{4.5cm}
+    
+    \column{4.5cm}
       \begin{pgfpicture}{-0.5cm}{1cm}{4cm}{7cm}
         \pgfonly<1| trans:1>{
           \putmachine{\pgfxy(1.75,3)}{Turing machine}
           \tape{\pgfxy(0,5)}{\$}{\$}{\$}{\$}{\$}{\$}{\$}{\$}
           \selectpos{5}}      
      \end{pgfpicture}
-    \end{column}
-    \begin{column}{6cm}
+    
+    \column{6cm}
       \begin{block}{Characteristics}
       \begin{itemize}
       \item
         Tape alphabet \alert{is larger than}\\ input alphabet
       \end{itemize}
       \end{block}
-    \end{column}
   \end{columns}
 } 
 \noteitems{
   \transdissolve<7>[duration=0.2]
   
   \begin{columns}
-    \begin{column}{4.5cm}
+
+    \column{4.5cm}
       \begin{pgfpicture}{-0.5cm}{1cm}{4cm}{7cm}
         \pgfonly<1| trans:1>{%
           \putmachinea{\pgfxy(1.75,3)}{Turing machine}%
           \pgfnodecircle{n3}[virtual]{\pgfxy(1.25,5)}{2pt}%
           \selectpos{3}}%      
       \end{pgfpicture}
-    \end{column}
-    \begin{column}{6cm}
+
+    \column{6cm}
       \begin{overprint}
       \onslide<1-6| trans:1-3| handout:1>
         \begin{block}{Characteristics}
           \end{itemize}
         \end{alertblock}
       \end{overprint}
-    \end{column}
   \end{columns}
 }
 \note{Point out that no markers are used.}
   \frametitle{Palindromes Can be Accepted in an Overhead-Free Way}
 
   \begin{columns}
-    \begin{column}{4.5cm}
+
+    \column{4.5cm}
       \begin{pgfpicture}{-0.5cm}{1cm}{4cm}{7cm}
         \pgfonly<1| trans:1>{
           \putmachinea{\pgfxy(1.75,3)}{overhead-free machine}
           \tape{\pgfxy(0,5)}{0}{0}{0}{1}{1}{0}{0}{0}
           \selectpos{5}}      
       \end{pgfpicture}
-    \end{column}
-    \begin{column}{6cm}
+
+    \column{6cm}
       \begin{block}{Algorithm}
         \vskip1em
 
         \quad \alert<8,12,16| handout:0| trans:0>{Advance right end marker}
         
       \end{block}
-    \end{column}
   \end{columns}
 }
 \note{Use 3 minutes.}

lyx/layouts/beamer.layout

   EndFont
 End
 
+Style Column
+  Margin		Static
+  LatexType		Command
+  LatexName		column
+  ParSkip               0.5
+  TopSep                1
+  BottomSep             1
+  ParSep                0
+  Align			Left
+  LabelType		Static
+  LabelSep              xx
+  LabelString		"start column of width: " 
+  OptionalArgs		1
+  LeftMargin        MMMMMMMMM
 
-Style Column
+  # standard font definition
+  LabelFont 
+    Family		Roman
+    Color               latex
+  EndFont
+End
+
+
+Style Columns
+
   KeepEmpty             1
-  Margin		First_Dynamic
+  Margin		Static
   LatexType		Environment
   NextNoIndent		0
   ParIndent		MM
   LabelType		Static
   LabelSep              xx
 
-  LatexName	 	column
-  LabelString		"column of width: " 
+  LatexName	 	columns
+  LabelString		"columns" 
+  LeftMargin        columns
 
   ParSkip           0.5
   TopSep            1
   BottomSep         1
   ParSep            0
 
+
   # font & label font definition
 
   LabelFont 
   EndFont
 End
 
-
-Style Columns
+Style ColumnsCenterAligned
   KeepEmpty             1
-  Margin		First_Dynamic
+  Margin		Static
   LatexType		Environment
   NextNoIndent		0
   ParIndent		MM
-  Align			Left
+  Align			left
   LabelType		Static
   LabelSep              xx
 
-  LatexName	 	columns
-  LabelString		"columns" 
+  LatexName	 	centercolumns
+  LabelString		"columns (center aligned)" 
+  LeftMargin            "columns (center aligned)"
 
   ParSkip           0.5
   TopSep            1
   BottomSep         1
   ParSep            0
 
+  Preamble
+  \newenvironment{centercolumns}{\begin{columns}[c]}{\end{columns}}
+  EndPreamble
+  # font & label font definition
+
+  LabelFont 
+    Family		Roman
+    Color               latex
+  EndFont
+End
+
+Style ColumnsTopAligned
+  KeepEmpty             1
+  Margin		Static
+  LatexType		Environment
+  NextNoIndent		0
+  ParIndent		MM
+  Align			left
+  LabelType		Static
+  LabelSep              xx
+
+  LatexName	 	topcolumns
+  LabelString		"columns (top aligned)" 
+  LeftMargin            "columns (top aligned)"
+
+  ParSkip           0.5
+  TopSep            1
+  BottomSep         1
+  ParSep            0
+
+  Preamble
+  \newenvironment{topcolumns}{\begin{columns}[t]}{\end{columns}}
+  EndPreamble
   # font & label font definition
 
   LabelFont 

lyx/templates/beamerpresentation.lyx

 \layout BeginFrame
 
 <Frame Title>
-\layout Columns
+\layout ColumnsTopAligned
 
 \begin_deeper 
 \layout Column
 
-
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-{5cm}
-\end_inset 
-
-
-\begin_deeper 
+5cm
 \layout Theorem
 
 
 \end_inset 
 
 In left column.
-\end_deeper 
-\layout Standard
-
 \layout Column
 
-
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-{5cm}
-\end_inset 
-
-
-\begin_deeper 
+5cm
 \layout Corollary
 
 
 \end_inset 
 
 In right column.
-\end_deeper 
+\newline 
+New line
 \end_deeper 
 \layout EndFrame