5

I am trying to include overlaid expex glossed examples in a beamer presentation. However when changing between overlays, the example numbering for the same examples also changes. The code below is a pair of such examples.

\documentclass[x11names]{beamer} 
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tipa}
\usepackage{tipx}
\usepackage{multicol} 
\usetheme{Boadilla}
\usecolortheme{seahorse}
\useinnertheme{rectangles}
\setbeamercovered{transparent}
\usepackage{expex}


\begin{document}
\begin{frame}
\frametitle{\phantom{}} 
    \onslide<1>{\pex[interpartskip=1ex]~\textcolor{DarkOrchid4}{el francés}
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla Pourquoi (cela$_i$) la gênera *(-t {-\textcolor{red}{il}$_i$) ?} //
            \glb {por qué} eso {\sc cl}.ac.3sg.f. molestar-fut.ind.3sg. {'t' «eufónica»} {\sc cl}.nom.3sg.m./n. //
            \glft «¿Por qué le molestará (eso)?» //
            \endgl
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla *(Cela$_i$/\textcolor{red}{il}$_i$) (*\textcolor{red}{il}$_i$) la gêne(*-t-\textcolor{red}{il}$_i$) pour le sujet. //
            \glft «Le molesta eso por el tema» //
            \endgl
            \xe
            }
            \vspace{-1cm}
    \onslide<2>{\pex[interpartskip=1ex]~\textcolor{DarkOrchid4}{el francoprovenzal friburgués}
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla Portyè *(\textcolor{red}{i}) travayè? //
            \glb {por qué} {\sc cl}.nom.1sg./1pl./3sg./3pl. trabajar-pres.ind.3sg. //
            \glft «¿Por qué trabaja?» //
            \endgl
            \a 
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla (Djan$_i$/li$_i$) (\textcolor{red}{i}$_i$) travayè din na fretyire. //
            \glb Juan/{\sc pr}.nom.3sg.m. {\sc cl}.nom.1sg./1pl./3sg./3pl. trabajar-pres.ind.3sg. en una {granja lechera} //
            \glft «(Juan) trabaja en una granja lechera» //
            \endgl
            \xe
            }
\end{frame}
\end{document}

I have tried changing the scope of the \onslide command, thinking that maybe I was including too much of the expex example commands (\pex) therein, but no luck. On the other hand, if I don't overlay (removing the \onslide commands), the numbering stays nicely put between frame changes in the original (larger) document (which of course one would expect, since changing from frame to frame changes the examples that are seen).

I have looked for threads on similar topics that might help me, but quite frankly I haven' found a single one, despite a few promising titles (1, 2, 3). Maybe my issue is the result of something silly that I, a novice user, have been doing and that other more knowledgable users know to avoid. Please help.

4

The problem is that you are using commands and environments which are not 'overlay-specification aware' as beamer would put it. That is, when you use e.g. an enumerate environment in beamer this is a specially adapted version which knows about overlays. For example, it knows not to increment the counter for the first item on every slide of a single frame. That ensures it gives you the expected result i.e. the same item gets the same number on every slide.

beamer provides a set of commands for making existing commands and environments aware of overlays. In this case, the easiest solution is probably to add the following to your preamble:

\resetcountonoverlays{excnt}

Basically, this tells beamer to keep the value of excnt the same on every slide of every frame. For details see page 87 of the user manual.

\documentclass[x11names]{beamer}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tipa}
\usepackage{tipx}
\usepackage{multicol}
\usetheme{Boadilla}
\usecolortheme{seahorse}
\useinnertheme{rectangles}
\setbeamercovered{transparent}
\usepackage{expex}

\resetcountonoverlays{excnt}

\begin{document}
\begin{frame}
\frametitle{\phantom{}}
    \onslide<1>{\pex[interpartskip=1ex]~\textcolor{DarkOrchid4}{el francés}
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla Pourquoi (cela$_i$) la gênera *(-t {-\textcolor{red}{il}$_i$) ?} //
            \glb {por qué} eso {\sc cl}.ac.3sg.f. molestar-fut.ind.3sg. {'t' «eufónica»} {\sc cl}.nom.3sg.m./n. //
            \glft «¿Por qué le molestará (eso)?» //
            \endgl
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla *(Cela$_i$/\textcolor{red}{il}$_i$) (*\textcolor{red}{il}$_i$) la gêne(*-t-\textcolor{red}{il}$_i$) pour le sujet. //
            \glft «Le molesta eso por el tema» //
            \endgl
            \xe
            }
            \vspace{-1cm}
    \onslide<2>{\pex[interpartskip=1ex]~\textcolor{DarkOrchid4}{el francoprovenzal friburgués}
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla Portyè *(\textcolor{red}{i}) travayè? //
            \glb {por qué} {\sc cl}.nom.1sg./1pl./3sg./3pl. trabajar-pres.ind.3sg. //
            \glft «¿Por qué trabaja?» //
            \endgl
            \a
            \begingl[everygl=,everygla=\it\footnotesize,everyglb=\tiny,
            everyglft=\footnotesize,aboveglftskip=0pt]
            \gla (Djan$_i$/li$_i$) (\textcolor{red}{i}$_i$) travayè din na fretyire. //
            \glb Juan/{\sc pr}.nom.3sg.m. {\sc cl}.nom.1sg./1pl./3sg./3pl. trabajar-pres.ind.3sg. en una {granja lechera} //
            \glft «(Juan) trabaja en una granja lechera» //
            \endgl
            \xe
            }
\end{frame}

\end{document}

then produces:

resetting counts to get the numbers right

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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