3

I wrote a theorem in beamer with \enumerate. Then I need to write "Idea of proof of 1", with "1" which should be written the same way it appears in the theorem, ie a blue dot with a 1 inside. Also "1" must be written next to "Idea of proof of" and not at the head.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\title{example}
\author[...]{...}
\usetheme{AnnArbor}
\useoutertheme[right]{sidebar}
\setbeamercovered{dynamic}
\theoremstyle{definition}
\newtheorem{definizione}{Definizione}
\theoremstyle{plain}
\newtheorem{theoremmm}{Theorem}

\begin{document}


\begin{frame}
\begin{theoremmm}
\begin{enumerate}
\item ...
\item ...
\end{enumerate}
\end{theoremmm}

Idea of proof of 1

\end{frame}
\end{document}

enter image description here

What written here (enumerate in itemize environment, no new line) solves my problem in LaTex, but the proposed solutions use \ enumitem, which does not work in Beamer.

10

2 Answers 2

9

You can use \usebeamertemplate{enumerate item} to show item label, for numbering the template use enumi counter.

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\title{example}
\author[...]{...}
\usetheme{AnnArbor}
\useoutertheme[right]{sidebar}
\setbeamercovered{dynamic}
\theoremstyle{definition}
\newtheorem{definizione}{Definizione}
\theoremstyle{plain}
\newtheorem{theoremmm}{Theorem}

\newcommand{\itemnum}[1]{%
\setcounter{enumi}{#1}\usebeamertemplate{enumerate item}% 
}

\begin{document}


\begin{frame}
\begin{theoremmm}
\begin{enumerate}
\item ...
\item ...
\end{enumerate}
\end{theoremmm}

Idea of proof of \itemnum{1} ...


\end{frame}
\end{document}
1
  • +1 Very nice solution !
    – AndréC
    Commented Aug 11, 2020 at 12:23
2

The enumerate bullet is defined in the beamer source code in the file beamerbaseauxtemplates.sty. You can copy the code from there and use it in a new command, where you supply an argument instead of the enumerate counter. The commands are listed as \defbeamertemplate{enumerate item}{ball} for the sphere, \defbeamertemplate{enumerate item}{circle} for the circle, and \defbeamertemplate{enumerate item}{square} for the square template.

For the circle template there is an additional font setting (with a \usebeamerfont command). You need to add a group (a pair of {} within the command) to prevent the font setting from taking effect outside of the command.

MWE:

\documentclass{beamer}

% sphere shape
\newcommand{\enumbullet}[1]{%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
    \usebeamercolor{item projected}
    {\pgftransformscale{1.75}\pgftext{\normalsize\pgfuseshading{bigsphere}}}
    {\pgftransformshift{\pgfpoint{0pt}{0.5pt}}
      \pgftext{%
        \usebeamerfont*{item projected}%
        \color{fg}#1}}
  \end{pgfpicture}%
}

% circle shape
\newcommand{\enumcircle}[1]{%
  {\usebeamerfont*{item projected}%
  \usebeamercolor[bg]{item projected}%
  \begin{pgfpicture}{-1ex}{0ex}{1ex}{2ex}
    \pgfpathcircle{\pgfpoint{0pt}{.75ex}}{1.2ex}
    \pgfusepath{fill}
    \pgftext[base]{\color{fg}#1}
  \end{pgfpicture}}%
}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\title{example}
\author[...]{...}
\usetheme{AnnArbor}
\useoutertheme[right]{sidebar}
\setbeamercovered{dynamic}
\theoremstyle{definition}
\newtheorem{definizione}{Definizione}
\theoremstyle{plain}
\newtheorem{theoremmm}{Theorem}

\begin{document}

\begin{frame}
\begin{theoremmm}
\begin{enumerate}
\item ...
\item ...
\end{enumerate}
\end{theoremmm}

Idea of proof of \enumbullet{1} and \enumbullet{2}

\end{frame}

\setbeamertemplate{enumerate item}[circle]
\begin{frame}
\begin{theoremmm}
\begin{enumerate}
\item ...
\item ...
\end{enumerate}
\end{theoremmm}

Idea of proof of \enumcircle{1} and \enumcircle{2}

\end{frame}

\end{document}

Result:

enter image description here

enter image description here

5
  • +1 Very nice answer! Can you add the exact name of the command you are using in your answer?
    – AndréC
    Commented Aug 10, 2020 at 18:20
  • Thank you very much. What if I had to draw a circle with a "1" inside instead of a sphere with a "1" inside?
    – user222167
    Commented Aug 10, 2020 at 20:54
  • @user222167 that is defined in the same template file, see edit.
    – Marijn
    Commented Aug 11, 2020 at 7:10
  • Thank you very much. Why is "and" on the last line written in blue and not black?
    – user222167
    Commented Aug 11, 2020 at 7:24
  • @user222167 I didn't see that, but Teepeemm was right, an extra group prevents the font setting from having effects outside of the command.
    – Marijn
    Commented Aug 11, 2020 at 14:00

You must log in to answer this question.

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