7

I would to set custom numbering for my theorems and propositions, using decimal points. For example, I would the code below to dislpay "Proposition 3.1":

\documentclass[xcolor=x11names,compress]{beamer}

\usepackage{xcolor}
\usepackage{framed}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}

\colorlet{shadecolor}{blue!15}

\newtheorem{prop}{Proposition}
\newenvironment{propc}[1]
{\begin{shaded}\begin{prop}}
        {\end{prop}\end{shaded}}

\begin{document}

\begin{frame}
\begin{propc}
    Proposition here.
\end{propc}
\end{frame}

\end{document}

Thanks.

1 Answer 1

5

You're almost there: the environment should have an argument, but the inner theorem environment should be declared with \newtheorem*, with a “variable part” in the name that's set when the environment is opened.

\documentclass[xcolor=x11names,compress]{beamer}

\usepackage{xcolor}
\usepackage{framed}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}

\colorlet{shadecolor}{blue!15}

\newcommand{\propnumber}{} % initialize
\newtheorem*{prop}{Proposition \propnumber}
\newenvironment{propc}[1]
  {\renewcommand{\propnumber}{#1}%
   \begin{shaded}\begin{prop}}
  {\end{prop}\end{shaded}}

\begin{document}

\begin{frame}
\begin{propc}{3.1}
    Proposition here.
\end{propc}
\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 .