4

While copy-pasting the following code from my article to one of the frames in my beamer presentation (along with all the packages), I get 11 errors that are mostly "undefined control sequence" and "missing number, treated as zero". Could you explain what is wrong and what additional packages I may have to include in the preamble?

\documentclass{beamer}
\usetheme{Warsaw}
\title{HH Decisions}
\author{Abhimanyu Arora}
\institute{Doctoral workshop}
\date{}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{comment}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{pgfplots}
\usepackage[capposition=top]{floatrow}
\pgfplotsset{compat=newest}
\usetikzlibrary{pgfplots.groupplots}
\usetikzlibrary{positioning}
\newtheorem{proposition}[theorem]{Proposition}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}{Results (contd.)}

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
title=Share of expenditure,
xlabel={$z$},
ylabel={$S(z)$},
]
\addplot [blue,domain=0:10]{(2*(0.45+x*0.55))/(2*(0.45+x*0.55)+0.55+x*0.45)};
\addplot [red,domain=0:10]{(2*(0.1+x*0.9))/(2*(0.1+x*0.9)+0.9+x*0.1)};
\legend{Case 1, Case 2}
\end{axis}
\end{tikzpicture}
\floatfoot{Case 1:$\alpha_W=\beta_H=0.55=1-\alpha_H=1-\beta_W$, Case 2:$\alpha_W=\beta_H=0.9=1-\alpha_H=1-\beta_W$}
\label{fig:share}
\end{figure}

\end{frame}


\end{document}
  • It will be very difficult to explain what is wrong and tell you any additional packages without seeing what is in your preamble currently... please post a complete document, starting at \documentclass{...} and ending with \end{document} – darthbith May 26 '14 at 17:38
  • Where does \floatfoot come from? Which package defines it? If it is a user command, are you including the definition in your preamble? – Gonzalo Medina May 26 '14 at 17:43
  • Thank you @darthbith. I have editted the code to include the preamble. The article seems to compile fine but not the presentation – Abhimanyu Arora May 26 '14 at 17:46
  • @GonzaloMedina: Thanks, have editted to include the preamble. But as you might notice, there are errors – Abhimanyu Arora May 26 '14 at 17:47
  • @AbhimanyuArora Thanks for providing the example code. I provided an answer below. – Gonzalo Medina May 26 '14 at 18:07
4

The floatrow package is not compatible with beamer; don't load this package with the beamer document class; in this case, you can't use \floatfoot, but you can use \caption instead or just a simple paragraph of text:

\documentclass{beamer}
\usepackage{comment}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{pgfplots.groupplots}
\usetikzlibrary{positioning}

\usetheme{Warsaw}

\newtheorem{proposition}[theorem]{Proposition}

\title{HH Decisions}
\author{Abhimanyu Arora}
\institute{Doctoral workshop}
\date{}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}{Results (contd.)}

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
  title=Share of expenditure,
  xlabel={$z$},
  ylabel={$S(z)$},
  height=6cm
]
\addplot [blue,domain=0:10]{(2*(0.45+x*0.55))/(2*(0.45+x*0.55)+0.55+x*0.45)};
\addplot [red,domain=0:10]{(2*(0.1+x*0.9))/(2*(0.1+x*0.9)+0.9+x*0.1)};
\legend{Case 1, Case 2}
\end{axis}
\end{tikzpicture}
\caption{Case 1:$\alpha_W=\beta_H=0.55=1-\alpha_H=1-\beta_W$, Case 2:$\alpha_W=\beta_H=0.9=1-\alpha_H=1-\beta_W$}
\label{fig:share}
\end{figure}

\end{frame}

\begin{frame}{Results (contd.)}

\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
  title=Share of expenditure,
  xlabel={$z$},
  ylabel={$S(z)$},
  height=6cm
]
\addplot [blue,domain=0:10]{(2*(0.45+x*0.55))/(2*(0.45+x*0.55)+0.55+x*0.45)};
\addplot [red,domain=0:10]{(2*(0.1+x*0.9))/(2*(0.1+x*0.9)+0.9+x*0.1)};
\legend{Case 1, Case 2}
\end{axis}
\end{tikzpicture}\par
Case 1:$\alpha_W=\beta_H=0.55=1-\alpha_H=1-\beta_W$, Case 2:$\alpha_W=\beta_H=0.9=1-\alpha_H=1-\beta_W$
\end{figure}

\end{frame}

\end{document}

enter image description here

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.