Re: centering vertically...

Erwan Le Pennec <[email protected]>
Newsgroups gmane.comp.tex.latex.prosper.user
Message-ID <[email protected]>
	Hello,

On Wed, 4 Jun 2003, Peter Møller Neergaard wrote:

> On Wed, Jun 04, 2003 at 11:29:32AM +0200, Mathieu CLABAUT wrote:
> 
> >  how can I make text be centered vertically on a slide ?
> >  I've tried to use \vfill and \vspace{\stretch{1}} around the text, but
> >  none of them work.
> 
> It would be great if I could be proven wrong, but I don't think that
> there is an easy way to achieve this in a general manner.  
> 
> The problem is that slides are typeset inside a minipage environment.
> Since a minipage does not have a specific size (unlike a page) none of
> a \vfill will not make any difference.
> 
[snip]
> /Peter
> 
> 

	A minipage has an optional length argument. I've manage using this
trick to obtain a vertically centered slide template. It is far from
perfect and I've to use in some case some manual space correction in the
itemize environment but it works for me. If you want to try it, please 
feel free ;-)

	Erwan

PS : You'll probably have to modify the PPR file a little as it does a 
little more than this (fonts change bu example).
PS2 : In case you have something strange in a itemize environment, you can 
try to put a \correct statement inbetween the  \item where \correct is 
define as
providecommand{\correct}{\strut\vspace*{-1.4\baselineskip}}
to "eat" the elastic vertical space.
PPRcentered.sty (text/plain, 6.3 KB)
%==============================================================================
% Prosper -- (PPRlaurent.sty) Style file
% A LaTeX class for creating slides
% Author: anonymous
% 
% Permission is hereby granted, without written agreement and without
% license or royalty fees, to use, copy, modify, and distribute this
% software and its documentation for any purpose, provided that the
% above copyright notice and the following two paragraphs appear in
% all copies of this software.
% 
% IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 
% SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF 
% THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED 
% OF THE POSSIBILITY OF SUCH DAMAGE.
% 
% THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES,
% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
% AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
% ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATION TO
% PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
%
% CVSId : $Id: PPRdefault.sty,v 1.1 2001/01/23 15:46:35 exupery Exp $
%==============================================================================
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{PPRcentered}[2000/11/30]
\typeout{`centered' style for Prosper ---}
\typeout{CVSId: $Id: PPRdefault.sty,v 1.1 2001/01/23 15:46:35 exupery Exp $}
\typeout{ }

% Loading packages necessary to define this slide style.
% none

\newgray{grayb}{.5}

\FontTitle{%
  \usefont{T1}{ptm}{b}{n}\fontsize{20.74pt}{18pt}\selectfont\blue}{%
  \usefont{T1}{ptm}{b}{n}\fontsize{20.74pt}{18pt}\selectfont\blue}
\FontText{%
  \black\usefont{T1}{aess}{m}{n}\fontsize{12.4pt}{12pt}\selectfont}{%
  \black\usefont{T1}{aess}{m}{n}\fontsize{12.4pt}{12pt}\selectfont}


% Positionning of the title of a slide.
\newcommand{\slidetitle}[1]{%
  \rput[c](5.25,4.4){\fontTitle{#1}}
}

% Positionning for a logo
\LogoPosition{-1,-1.1}

% Definition of this style for slides.

\newcommand{\BasicFrame}[1]{%
%\ifinColor
%\else
%\fi
\psline[linewidth=.5pt,linecolor=grayb](-1,-.5)(-1,-1.1)(-0.4,-1.1)
\psline[linewidth=.5pt,linecolor=grayb](11,-1.1)(11.6,-1.1)(11.6,-.5)
\psline[linewidth=.5pt,linecolor=grayb](-1,6.7)(-1,7.3)(-0.4,7.3)
\psline[linewidth=.5pt,linecolor=grayb](11.6,6.7)(11.6,7.3)(11,7.3)
%  \PutLogo % Mandatory
 {#1}}
\newcommand{\setfirstitem}[1]{\setcounter{item@step}#1}

\newlength{\slideHeight}
%81.7mm
\setlength{\slideHeight}{81.7mm}


\renewenvironment{SlideNormal}[2][\@defaultTransition]{%
  \stepcounter{trueSlideCounter}%
  \PDFtransition{#1}%
  \begin{slide@seminar}%
    \def\@tempa {#2}%
    \ifx\@tempa\@empty%
    \else
       \@addBookmarkOnSlide{0}{#2}%
       \slidetitle{#2}%
    \fi
    \begin{posit@Box}%
      \begin{minipage}[t][\slideHeight]{\slideWidth}%
        \vfill%
        \begin{minipage}[c][\slideHeight]{\slideWidth}%
        \@DefMyItem%
        \ifinColor\@fontTextColor\else\@fontTextBW\fi%
        }{%
    \end{minipage}%
    \vfill%
  \end{minipage}%
  \end{posit@Box}\end{slide@seminar}}%
                                % Slides in overlays
\renewenvironment{SlideOverlay}[2][\@defaultTransition]{%
  \ifDVItoPS%
  \begin{slide@seminar}%
        \slidetitle{#2}%
        \begin{posit@Box}%
          \vfill%
          \begin{minipage}[t][\slideHeight]{\slideWidth}%
            \vfill%
            \begin{minipage}[c][\slideHeight]{\slideWidth}%
            \@DefMyItem%
            \ifinColor\@fontTextColor\else\@fontTextBW\fi%
  \else%% DVI -> PDF
      \stepcounter{trueSlideCounter}%
      \PDFtransition{#1}%
      \begin{slide@seminar}%
        \@prepareResetCounters %
        \def\@tempa{#2}% 
        \ifx\@tempa\@empty%
        \else%
          \@ifundefined{@okForBookmark}{%
            \gdef\@okForBookmark{}%
            \@addBookmarkOnSlide{\number\c@limitOverlays}{#2}%
          }{\@addBookmarkOnSlide{0}{#2}}%
          \slidetitle{#2}%
        \fi%
        \begin{posit@Box}%
          \begin{minipage}[t][\slideHeight]{\slideWidth}%
            \vfill%
             \begin{minipage}[c][\slideHeight]{\slideWidth}%
            \@DefMyItem%
            \ifinColor\@fontTextColor\else\@fontTextBW\fi%
            {\overlay{1}}%
  \fi%
  }{%
  \ifDVItoPS%
      \end{minipage}\vfill\end{minipage}\end{posit@Box}\end{slide@seminar}%
  \else %% DVI -> PDF
      \end{minipage}\vfill\end{minipage}\end{posit@Box}\end{slide@seminar}%
        \addtocounter{slide}{-1}%
  \fi
}
\let\slide=\SlideNormal
\let\endslide=\endSlideNormal



\renewcommand{\NewSlideStyle}[4][11cm]{%
  \setlength{\slideWidth}{#1}%
  \global\pslongbox{posit@Box}{\rput[#2](#3)}%
  \newslideframe{the#4}{\csname #4\endcsname{##1}}%
  \slidepagestyle{GenericPageStyleB}
  \slideframe{the#4}%
}

\newpagestyle{GenericPageStyleB}{\hfill }{}
%5.215,-.05
%123.8
\NewSlideStyle[120mm]{c}{5.215,-0.5}{BasicFrame}

\PDFCroppingBox{0 0 595 842}


\myitem{1}{\includegraphics[width=.4cm]{red-bullet-on-white.ps}}
\myitem{2}{\includegraphics[width=.3cm]{green-bullet-on-white.ps}}
\myitem{3}{\includegraphics[width=.3cm]{yellow-bullet-on-white.ps}}

\newcommand{\maketitlee}{%
  %% Tests whether the 'french' style from B. Gaulle is loaded
  \expandafter\ifx\csname frenchTeXmods\endcsname\relax%
  \else 
  \PackageWarning{prosper}{This page intentionnally left blank to overcome an incompatibility bug between B. Gaulle 'french' package and the seminar class.}
  \begin{center}
    {\black\small
  \textsf{prosper} class: page intentionnally left blank to overcome an incompatibility bug between B. Gaulle 'french' package and the seminar class.}%
  \end{center}
  \clearpage \setcounter{page}{0}%
  \fi
  \begin{slide}{}%
    \ptsize{10}%
    \begin{center}%
    \normalfont
    {\ifinColor\@fontTitleColor\else\@fontTitleBW\fi\@Title\par}%
    \ifx\@Subtitle\@empty\else

    {\ifinColor\@fontSubtitleColor\else\@fontSubtitleBW\fi\@Subtitle\par}
    \fi

    \vskip.5em
    \@Author

    \ifx\@email\@empty\else
    \vskip-5pt
    {\fontsize{7}{7}\selectfont\texttt{\@email}}
    \fi
    \ifx\@institution\@empty%
    \else
    \vskip.8em
    \@institution
    \fi
    \end{center}
  \end{slide}
}

\endinput

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.