Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a powerdot style that includes the following slide definition:

\pddefinetemplate[slide]{blackslide}{
  titlepos={.05\slidewidth,.93\slideheight},
  titlewidth=.9\slidewidth,
  titlefont=\bfseries\Large\color{pdcolor3}\raggedright,
  textpos={.05\slidewidth,.90\slideheight},
  textwidth=.9\slidewidth,
  textheight=.85\slideheight,
  textfont=\Huge\color{white}\centering,
}{%
  \psframe[linestyle=none,linewidth=0pt,fillstyle=solid,fillcolor=black](0,0)(\slidewidth,\slideheight)%
}

This style essentially gives me large text within a slide, horizontally centered. This isn't quite enough, however, and I would like to occasionally vertically center text. I put a command together to do this:

\newcommand\bigslide[1]{%
\begin{blackslide}{}
  \par\vspace*{\stretch{1}}%
  #1
  \vspace*{\stretch{1}}%
  \par
\end{blackslide}
}

This was based on the code for the vplace environment from the memoir class.

Unfortunately, this doesn't quite do the job -- text is vertically aligned, but it will ignore descenders. As a minimal example:

\bigslide{This is some text}
\bigslide{Text that happens to have descenders}

The text for the second slide is marginally higher than the text for the first, because the spacing is against the box rather than the baseline.

So my question: how can I get the text to vertically align sensibly, whether or not there are any descenders, and however many lines it has?

share|improve this question

1 Answer 1

I do not really understand what exactly you want. However, try it this way:

\documentclass{powerdot}
\pddefinetemplate[slide]{blackslide}{
  titlepos={.05\slidewidth,.93\slideheight},
  titlewidth=.9\slidewidth,
  titlefont=\bfseries\Large\color{pdcolor3}\raggedright,
  textpos={.05\slidewidth,.90\slideheight},
  textwidth=.9\slidewidth,
  textheight=.85\slideheight,
  textfont=\Huge\color{white}\centering,
}{%
  \psframe[linestyle=none,linewidth=0pt,fillstyle=solid,fillcolor=black](0,0)(\slidewidth,\slideheight)%
}
\newcommand\bigslide[1]{%
\begin{blackslide}{}
\rput(0,-0.5\textheight){\parbox{\textwidth}{\centering#1}}
\end{blackslide}}
\begin{document}
\bigslide{This is some text}
\bigslide{Text that happens to have descenders}
\end{document}

enter image description here enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.