[powerdot] Re: how to get variable name and number of a section?

  • From: "Hendri Adriaens" <spotje@xxxxxxxxx>
  • To: powerdot@xxxxxxxxxxxxx
  • Date: Sun, 13 Aug 2006 19:50:32 +0200

Is there a counter for section and a variable for the name of the current section?

Yes, no, but this info can be retrieved from the toc file which it reads back in, or can be gained by redefining \pd@section, see below, but that only works for the slides following each section. If you want to use the title of a section in the entire presentation, see the docs how to retrieve the info from memory. You may want to know that the entire source has been documented almost line by line. Look for the dtx and produce the full source code docs (see the docs how to do this).

Best,
-Hendri.

\documentclass{powerdot}
\makeatletter
\let\ORIGpd@section\pd@section
\def\pd@section[#1]#2{%
 \def\currentsectionname{#2}%
 \ORIGpd@section[#1]{#2}%
 \edef\currentsectionnumber{\the\c@pd@section}%
}
\makeatother
\begin{document}
\begin{slide}{1}
\end{slide}
\section{2}
\begin{slide}{3}
current section name: \currentsectionname\\
current section number: \currentsectionnumber
\end{slide}
\begin{slide}{4}
current section name: \currentsectionname\\
current section number: \currentsectionnumber
\end{slide}
\end{document}

Other related posts: