Math & Sciencebeamer | Sub-numbering for Equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
econstudent
Posts: 3
Joined: Sun Dec 04, 2011 1:50 am

beamer | Sub-numbering for Equations

Post by econstudent »

I am writing a beamer document in which I would like to subnumber the formulas within an array.

It is supposed to look like the following

a = (b*c)*d^(-2) (3')
= (b*c)/d^2 (3'')

Instead of (3') and (3'') it could also read (3a) and (3b)

Any helpful ideas would be appreciated!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

beamer | Sub-numbering for Equations

Post by Stefan Kottwitz »

Hi,

better use align instead of eqnarray.

For sub-numbering, there's the subequation environment of amsmath. However it's not suitable for alignment. At least you could tag manually, such as

Code: Select all

\documentclass{beamer}
\usepackage{amsmath}
\begin{document}
\begin{frame}
\begin{align}
  a &= (b*c)*d^{-2} \tag{3a}\\
    &= (b*c)/d^2 \tag{3b}
\end{align}
\end{frame}
\end{document}
Stefan
LaTeX.org admin
econstudent
Posts: 3
Joined: Sun Dec 04, 2011 1:50 am

Re: beamer | Sub-numbering for Equations

Post by econstudent »

Thanks Stefan for the swift reply. It looks good indeed, but there are 2 problems.

I want to blend in the 2 equations sequentially. It normally works with \pause, but in the align environment \pause does not seem to work.

Equations (3a) and (3b) are part of a series of equations in the document. This means I'll have further equations after (3b), which are supposed to be numbered accordingly. What I mean is that the next equation would have to be numbered with (4), which it does not do when I insert the 2 equations with align.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

beamer | Sub-numbering for Equations

Post by localghost »

Stefan_K wrote:[…] For sub-numbering, there's the subequation environment of amsmath. However it's not suitable for alignment. […]
Somehow I don't see a problem.

Code: Select all

\documentclass[smaller]{beamer}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage{mathtools}   % loads »amsmath«

\begin{document}
  \begin{frame}
    \begin{subequations}
      \begin{align}
        a &= (b\cdot c)\cdot d^{-2} \\
          &= (b\cdot c)/d^2
      \end{align}
    \end{subequations}
  \end{frame}
\end{document}

Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

beamer | Sub-numbering for Equations

Post by Stefan Kottwitz »

Hi Thorsten,

correct, works fine! I just was used to subequations combined with equations, not aligning.

\pause does not work with align, however you could work with \uncover instead:

Code: Select all

\documentclass[smaller]{beamer}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage{mathtools}   % loads »amsmath«
\begin{document}
  \begin{frame}
    \begin{subequations}
      \begin{align}
        a &= (b\cdot c)\cdot d^{-2} \\
        \uncover<2->{&= (b\cdot c)/d^2}
      \end{align}
    \end{subequations}
  \end{frame}
\end{document}
However, the numbering will be seen on the right side before uncovering.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

beamer | Sub-numbering for Equations

Post by localghost »

Stefan_K wrote:[…] However, the numbering will be seen on the right side before uncovering. […]
Still a bit annoying. But there seems to exist a workaround for this issue [1]. This could be useful here, too.

[1] {TeX} SX – Using align in beamer with overlays
econstudent
Posts: 3
Joined: Sun Dec 04, 2011 1:50 am

beamer | Sub-numbering for Equations

Post by econstudent »

Thanks to everyone for the suggestions!

Unfortunately the combination of \subequations, \align and \uncover does not work well together with the rest I have on the slide. I am copying the code below, so you can see yourself what's wrong (which is easier than me explaining in words):

Code: Select all


\begin{frame}
    \begin{itemize}
    \item Ex ante price for product under design $A$:   
        \begin{subequations}
        \begin{align}
        p(b^{*}) & = c + \sigma(v-c-\hat{\rho}(b^{*})\Delta) \\
        \uncover<2->{& = c + \sigma(v-c-\hat{\rho}(b^{*})a)- \hat{\rho}(b^{*})h}
        \end{align}
        \end{subequations}
    \item bla  
    \item bla bla
    \pause
    \begin{equation}
    f = \sigma(v-c-\hat{\rho}(b^{*})a)- \hat{\rho}(b^{*})h
    \end{equation}
    \end{itemize}
 \end{frame}

Could IEEEtrantools be the solution?

BTW:
The option posted by localghost (changing the equation directly in its own line) is actually quite nice. Even though I will not use it here its good to know for later use. So thanks for suggesting!
Post Reply