shortsection title in header or footline

455 views
Skip to first unread message

Ignasi

unread,
Jul 24, 2010, 6:31:07 AM7/24/10
to LaTeX Beamer class
Hi all,

I would like to use short section or subsection titles in a footline
or headline. I know commands \insertsection
and \insertsubsection but they insert the 'long' title. I've seen in
manual about \insertshortlecture but only for lectures.
There also exist \inserttocsection and \inserttocsubsection but I
don't know how tu use. Could you help me?

Ignasi

Vedran Miletić

unread,
Jul 24, 2010, 1:21:16 PM7/24/10
to LaTeX Beamer class
Does \secname and \subsecname help?

Regards,
Vedran

Ignasi Furió

unread,
Jul 26, 2010, 7:39:56 AM7/26/10
to beamer...@googlegroups.com
El Sat, 24 Jul 2010 19:21:16 +0200, Vedran Miletić <riv...@gmail.com> vau
escriure:

No. Here you have my test.

%------------------------------
\documentclass{beamer}

\newcommand{\footA}{\insertsection --- \insertsubsection}
\newcommand{\footB}{\inserttocsection --- \inserttocsubsection}
\newcommand{\footC}{\secname --- \subsecname}

\setbeamertemplate{footline}{%
\begin{beamercolorbox}[leftskip=15pt,rightskip=15pt,ht=2.5ex,dp=1ex]{footline}
\hspace*{-15pt}{\usebeamercolor{separation
line}\rule[1ex]{\paperwidth}{1pt}}\\
\usebeamerfont{footline}\footA %-> Change footA with footB or footC
\par
\vspace{2ex}
\end{beamercolorbox}%
}

\begin{document}
\section*{Outline}
\begin{frame}{Outline}
\tableofcontents
\end{frame}
\section[short section name]{very long section name}
\subsection[short subsection name]{very long subsection name}
\begin{frame}
First frame
\end{frame}
\begin{frame}
Second frame
\end{frame}
\end{document}
%------------------------------

with \footB says --

! Undefined control sequence.
\footB ->\inserttocsection
--- \inserttocsubsection
l.16 \begin{document}

with \footC says --


! Undefined control sequence.
\footC ->\secname
--- \subsecname
l.16 \begin{document}


Thank you,

Ignasi

--
----------------------------------------------------------------------
Ignasi Furió Caldentey
Universitat de les Illes Balears
Escola Politècnica Superior
Dep. Matematiques i Informatica
Cra. Valldemossa, km. 7,5. 07122-Palma. SPAIN
tel: (34) 971.259.970 fax: (34) 971.173.003
e-mail: ignasi dot furio at uib dot cat
http://www.uib.cat
----------------------------------------------------------------------

Vedran Miletić

unread,
Jul 28, 2010, 8:16:30 AM7/28/10
to beamer...@googlegroups.com
2010/7/26 Ignasi Furió <ignasi...@uib.cat>:

I see. Well, \secname (\subsecname) doesn't get defined yet since you
have no sections (subsections) yet. You can workaround this with:
\def \secname {}
\def \subsecname {}
which will get overwritten when they get defined by Beamer (after the
first section or subsection).

Hope it helps,

--
Vedran Miletić

Vedran Miletić

unread,
Jul 28, 2010, 8:17:41 AM7/28/10
to beamer...@googlegroups.com
Datuma 28. srpnja 2010. 14:16 Vedran Miletić <riv...@gmail.com> je napisao/la:
> I see. Well, \secname (\subsecname) doesn't get defined yet since you
> have no sections (subsections) yet. You can workaround this with:
> \def \secname {}
> \def \subsecname {}
> which will get overwritten when they get defined by Beamer (after the
> first section or subsection).
>

By the way, this is a bit ugly workaround. I will see what can be done
for Beamer 3.11 to make it work nicer.

Regards,

--
Vedran Miletić

Axel Berger

unread,
Jul 28, 2010, 11:14:04 AM7/28/10
to LaTeX Beamer class
Vedran Miletic wrote:
> By the way, this is a bit ugly workaround.

You can make it slightly less ugly and much less prone to breaking
future changes by using \providecommand instead of \def.

Axel
Reply all
Reply to author
Forward
0 new messages