Beamer - 计数定理和块的颜色

Beamer - 计数定理和块的颜色

为什么它无法对我新定义的定理块进行计数。我可以更改块的颜色吗?

\documentclass{beamer}
\newtheorem{teorem}{Teorem}[section]
\newtheorem{definicija}{Definicija}[section]
\newtheorem{lema}{Lema}[section]
\newtheorem{primjer}{Primjer}[section]
\newtheorem{conjecture}{Konjektura}[section]
\usepackage[mathscr]{eucal}
\usepackage[utf8]{inputenc} 
\usepackage[croatian]{babel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{hyperref}
\usepackage{color,tabularx,pstricks,pst-plot,amsfonts,amsmath,tensor,amssymb,graphicx,graphics}
\usetheme{Warsaw}
\usecolortheme{default}
\title{Fibonaccijevi brojevi i zlatni rez. Rekurzije. Fraktali}
\author{Amar Bapić, Merjem Vikalo, Irma Zenunović}
\date{}
\institute{Univerzitet u Tuzli\\Prirodno - matematički fakultet\\ Odsjek Matematika}
\begin{document}
\begin{frame}[plain]
  \titlepage
\end{frame}
\section{Fraktali}
\begin{frame}{Fraktali}
\begin{teorem}
\end{teorem}
\end{frame}
\end{document} 

答案1

Beamer 有一个内置数字定理选项,你可以使用以下命令激活它\setbeamertemplate{theorems}[numbered]

如何上色的问题已经有答案了https://tex.stackexchange.com/a/87219/36296

\documentclass{beamer}
\usepackage{etoolbox}
\newtheorem{teorem}{Teorem}[section]
\newtheorem{definicija}{Definicija}[section]
\newtheorem{lema}{Lema}[section]
\newtheorem{primjer}{Primjer}[section]
\newtheorem{conjecture}{Konjektura}[section]
\usepackage[mathscr]{eucal}
\usepackage[utf8]{inputenc} 
\usepackage[croatian]{babel}
\usepackage{latexsym}
\usepackage{tabularx,pstricks,pst-plot,amsfonts,amsmath,tensor,amssymb}
\usetheme{Warsaw}
\usecolortheme{default}
\title{Fibonaccijevi brojevi i zlatni rez. Rekurzije. Fraktali}
\author{Amar Bapić, Merjem Vikalo, Irma Zenunović}
\date{}
\institute{Univerzitet u Tuzli\\Prirodno - matematički fakultet\\ Odsjek Matematika}

\setbeamertemplate{theorems}[numbered]

\AtBeginEnvironment{teorem}{%
    \setbeamercolor{block title}{fg=white,bg=red}
    \setbeamercolor{block body}{fg=black,bg=red!40}
}

\begin{document}
    \begin{frame}[plain]
        \titlepage
    \end{frame}
    \section{Fraktali}
    \begin{frame}{Fraktali}
        \begin{teorem}
            test
        \end{teorem}
    \end{frame}
\end{document} 

在此处输入图片描述

评论

  • 请不要加载两次包,例如\usepackage{amsfonts}, \usepackage{amssymb}

  • 由于 beamer 本身已经提供了这些功能,因此无需加载hyperref, color, graphicx, graphics


编辑

要在标题中显示章节编号,请尝试

\usepackage{xpatch}
\makeatletter
\patchcmd\beamer@@tmpl@frametitle{\insertframetitle}{\thesection.~\insertframetitle}{}{}
\makeatother

在此处输入图片描述

相关内容