如何添加子节编号。它总是从 1 开始。但我想要 1.1 和 1.2 等。然后是子节 1.2.1 等。
\documentclass{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[mathscr]{eucal}
\usepackage[utf8]{inputenc}
\usepackage[croatian]{babel}
\usepackage{latexsym}
\usepackage{tabularx,pstricks,pst-plot,amsfonts,amsmath,tensor,amssymb}
\usepackage{etoolbox}
\usepackage{xpatch}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usetheme{Warsaw}
\usecolortheme{seahorse}
\usefonttheme{professionalfonts} % using non standard fonts for beamer
\setbeamertemplate{section in head/foot}{\hfill\insertsectionheadnumber.~\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{structure!50}\hfill\insertsectionheadnumber.~\insertsectionhead}
\setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\nN}{\mathbb{N}} % Oznaka za skup prirodnih brojeva
\newcommand{\zZ}{\mathbb{Z}} % Oznaka za skup cijelih brojeva
\newcommand{\rR}{\mathbb{R}} % Oznaka za skup realnih brojeva
\newcommand{\qQ}{\mathbb{Q}} % Oznaka za skup racionalnih brojeva
\newcommand{\iI}{\mathbb{I}} % Oznaka za skup iracionalnih brojeva
\newcommand{\cC}{\mathbb{C}} % Oznaka za skup kompleksnih brojeva
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\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]
\usepackage{multicol}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\AtBeginEnvironment{teorem}{%
\setbeamercolor{block title}{fg=white,bg=red}
\setbeamercolor{block body}{fg=black,bg=red!40}
}
\AtBeginEnvironment{definicija}{%
\setbeamercolor{block title}{fg=white,bg=blue}
\setbeamercolor{block body}{fg=black,bg=blue!40}
}
\AtBeginEnvironment{primjer}{%
\setbeamercolor{block title}{fg=white,bg=purple}
\setbeamercolor{block body}{fg=black,bg=purple!40}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtheorem{teorem}{Teorem}[section]
\newtheorem{definicija}{Definicija}[section]
\newtheorem{lema}{Lema}[section]
\newtheorem{primjer}{Primjer}[section]
\newtheorem{conjecture}{Konjektura}[section]
\renewcommand{\qedsymbol}{\ensuremath{\clubsuit}}
\newenvironment{rjesenje}{
\emph{\textbf{Rješenje:}}}{
$\qed $
}
\newenvironment{dokaz}{
\emph{\textbf{Dokaz:}}}{
$\spadesuit $
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\makeatletter
\patchcmd\beamer@@tmpl@frametitle{\insertframetitle}{\thesection.~\insertframetitle}{}{}
\makeatother
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Rekurzije}
\begin{frame}{Rekurzije}
\end{frame}
\subsection{Podjela ravni pravima. Podjela prostora ravnima.}
\begin{frame}{Podjela ravni pravima. Podjela prostora ravnima.}
\end{frame}
\subsection{Hanojski tornjevi}
\begin{frame}{Hanojski tornjevi}
\end{frame}
\end{document}
答案1
有点丑,但通过frametitle
定义中的三个条件,它可以给出所需的数字。
\documentclass{beamer}
\usepackage{etoolbox}
\usepackage{xpatch}
\usetheme{Warsaw}
\usecolortheme{seahorse}
\setbeamertemplate{section in head/foot}{\hfill\insertsectionheadnumber.~\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{structure!50}\hfill\insertsectionheadnumber.~\insertsectionhead}
\setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}
\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}
\makeatletter
\patchcmd\beamer@@tmpl@frametitle{\insertframetitle}{%
\ifnumgreater{\arabic{section}}{0}{%
\thesection.%
\ifnumgreater{\arabic{subsection}}{0}{%
\thesubsection.%
\ifnumgreater{\arabic{subsubsection}}{0}{%
\thesubsubsection.%
}{}%
}{}%
}{}%
~\insertframetitle{}{}%
}%
\makeatother
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\section{Rekurzije}
\begin{frame}{Rekurzije}
\end{frame}
\subsection{Podjela ravni pravima. Podjela prostora ravnima.}
\begin{frame}{Podjela ravni pravima. Podjela prostora ravnima.}
\end{frame}
\subsection{Hanojski tornjevi}
\subsubsection{test}
\begin{frame}{Hanojski tornjevi}
\end{frame}
\end{document}