3

I have a thesis class document with about 200 definitions, theorems and lemmas along with a beamer presentation. While I’m presenting, my audience will be referring to the document. How can I have beamer use the same numbering as the document in my presentation?

If I do nothing, beamer assigns new numbers to all of the definitions, theorems, and lemmas, which will be confusing. And because there’s so many items, manually numbering them isn’t an option.

3
  • \setcounter{theorem}{yournumber} before the theorems does not work, where yournumber is the the theorem number decreased by one?
    – user31729
    May 21, 2015 at 16:05
  • I precisely want an automatic numbering, the manually method isn't what I want; I have about 200 definitions, theorems and lemmas! and I down't want to bring numbers from the thesis and put them them manually.
    – hachemy
    May 21, 2015 at 16:48
  • it may be possible to do something with the label information recorded in the .aux file{s} from the main thesis run. you'll have to preserve the \newlabel lines; put them into a file thesis-labels.tex and input that file to the beamer run. you'll have to figure out yourself how to format the output, and you need to make sure the number of arguments to \newlabel agrees with what beamer expects; the number of arguments differs if hyperref is or is not used, and there may also be other conditions under which that number differs. May 21, 2015 at 17:35

1 Answer 1

6

You could directly refer to the number of the theorem in your thesis using the xr package.

Let's say your thesis looks like this:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\newtheorem{theorem}{Theorem}

\begin{document}
\section{Introduction}
Theorems can easily be defined

\begin{theorem}
Let $f$ be a function whose derivative exists in every point, then $f$ 
is a continuous function.
\end{theorem}

\begin{theorem}
\label{mytheo}
Let $f$ be a function whose derivative exists in every point, then $f$ 
is a continuous function.
\end{theorem}

Refering: \ref{mytheo}
\end{document}

Then you can use the labels with in your presentation:

\documentclass{beamer}

\usepackage{xr}
\externaldocument{document2}

\setbeamertemplate{theorems}[numbered]
\usepackage{refcount}


\begin{document}
\begin{frame} 
test \ref{mytheo}


\setcounterref{theorem}{mytheo}
\addtocounter{theorem}{-1}
\begin{theorem}
Let $f$ be a function whose derivative exists in every point, then $f$ 
is a continuous function.
\end{theorem}

\end{frame}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .