\newcommand
为了使用减小的字体大小,我有以下操作:
\newcommand\Fontvi{\fontsize{6}{5.2}\selectfont}
因此我可以Fontvi
在整个文档中调用该减小的字体大小。
例如,我在每个部分、子部分和子子部分的开头插入Fontvi
以显示缩小的字体大小:toc
% Outline at the beginning of every section:
\AtBeginSection[]{\label{sec:\thesection}
\begin{frame}[allowframebreaks]{Outline}
\setcounter{tocdepth}{3}
\Fontvi % to make toc smaller
\tableofcontents[
currentsection,
sectionstyle=show/shaded,
subsectionstyle=shaded/shaded/shaded,
subsubsectionstyle=shaded/shaded/shaded/shaded
]
\end{frame}
}
% Outline at the beginning of each subsection:
\AtBeginSubsection[]
{
\begin{frame}[allowframebreaks]{Outline}
\Fontvi % to make toc smaller
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
% Outline at the beginning of each subsubsection:
\AtBeginSubsubsection[]
{
\begin{frame}[allowframebreaks]{Outline}
\Fontvi % to make toc smaller
\tableofcontents[currentsection,currentsubsection,currentsubsection]
\end{frame}
}
这似乎对子子部分不起作用:如下所示,子子部分目录的标题没有以缩小的尺寸显示:
最小工作示例:
\documentclass{beamer}
%
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{itemize items}[default]
\setbeamertemplate{itemize subitem}[ball]
}
\setbeamercolor{itemize item}{bg=blue}
\setbeamercolor{itemize subitem}{bg=green}
\makeatletter
\setbeamertemplate{itemize item}{\raise0.2pt\beamer@usesphere{itemize item}{bigsphere}}
\setbeamertemplate{itemize subitem}{\raise0.2pt\beamer@usesphere{itemize subitem}{smallsphere}}
\makeatother
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{adjustbox}
\usepackage{comment}
\usepackage{multirow}
\usepackage[multidot]{grffile}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{cancel}
\newcommand{\btVFill}{\vskip0pt plus 1filll}
\usepackage{pdfpages}
\usepackage{totcount}
\regtotcounter{section}
\usepackage{soul,xcolor}
\setstcolor{red}
\setbeamersize{text margin left=1.0mm,text margin right=1.0mm}
\usepackage{listings}
\usepackage{fancyvrb}
\usepackage{fvextra}
\usepackage{lmodern}
\newcommand\myheading[1]{%
\par\bigskip
{\Large\bfseries#1}\par\smallskip}
\usepackage{color}
\newcommand\Fontvi{\fontsize{6}{5.2}\selectfont}
\newcounter{prevsec}
% Outline at the beginning of every section:
\AtBeginSection[]{\label{sec:\thesection}
\begin{frame}[allowframebreaks]{Outline}
\setcounter{tocdepth}{3}
\Fontvi % to make toc smaller
\tableofcontents[
currentsection,
sectionstyle=show/shaded,
subsectionstyle=shaded/shaded/shaded,
subsubsectionstyle=shaded/shaded/shaded/shaded
]
\end{frame}
}
% Outline at the beginning of each subsection:
\AtBeginSubsection[]
{
\begin{frame}[allowframebreaks]{Outline}
\Fontvi % to make toc smaller
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
% Outline at the beginning of each subsubsection:
\AtBeginSubsubsection[]
{
\begin{frame}[allowframebreaks]{Outline}
\Fontvi % to make toc smaller
\tableofcontents[currentsection,currentsubsection,currentsubsection]
\end{frame}
}
\title[Your Short Title]{Title}
% to Insert sectiontitle in footer:
\setbeamertemplate{footline}{
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
\usebeamerfont{title in head/foot}%
\insertsection \hfill
% \insertshorttitle \hfill
\insertsubsection \hfill
\insertsubsubsection \hfill
\insertframenumber{} / \inserttotalframenumber
\end{beamercolorbox}}%
}
\setbeamerfont{caption name}{size=\tiny}
\begin{document}
\setstcolor{red}
\begin{frame}
\titlepage
\end{frame}
% Uncomment these lines for an automatically generated outline.
\begin{frame}[allowframebreaks]{Outline}
\Fontvi
\tableofcontents
\end{frame}
\section{Section 1}
\subsection{Sub-section 1.1}
\subsubsection{Sub-Sub-section 1.1.1}
\end{document}
答案1
可以使用命令设置目录中标题的字体\setbeamerfont
。
\setbeamerfont{section in toc}{size=\Fontvi}
\setbeamerfont{subsection in toc}{size=\Fontvi}
\setbeamerfont{subsubsection in toc}{size=\Fontvi}
\documentclass{beamer}
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{itemize items}[default]
\setbeamertemplate{itemize subitem}[ball]
}
\setbeamercolor{itemize item}{bg=blue}
\setbeamercolor{itemize subitem}{bg=green}
\makeatletter
\setbeamertemplate{itemize item}{\raise0.2pt\beamer@usesphere{itemize item}{bigsphere}}
\setbeamertemplate{itemize subitem}{\raise0.2pt\beamer@usesphere{itemize subitem}{smallsphere}}
\makeatother
\setbeamersize{text margin left=1.0mm,text margin right=1.0mm}
\usepackage{lmodern}
\newcommand\myheading[1]{%
\par\bigskip
{\Large\bfseries#1}\par\smallskip}
\newcommand\Fontvi{\fontsize{6}{5.2}\selectfont}
%**************************************** added <<<<<<<<<<<<<
\setbeamerfont{section in toc}{size=\Fontvi}
\setbeamerfont{subsection in toc}{size=\Fontvi}
\setbeamerfont{subsubsection in toc}{size=\Fontvi}
%**************************************************
\newcounter{prevsec}
% Outline at the beginning of every section:
\AtBeginSection[]{\label{sec:\thesection}
\begin{frame}[allowframebreaks]{Outline}
\setcounter{tocdepth}{3}
% \Fontvi % to make toc smaller % changed <<<<<<<<<<<<<<<<
\tableofcontents[
currentsection,
sectionstyle=show/shaded,
subsectionstyle=shaded/shaded/shaded,
subsubsectionstyle=shaded/shaded/shaded/shaded
]
\end{frame}
}
% Outline at the beginning of each subsection:
\AtBeginSubsection[]
{
\begin{frame}[allowframebreaks]{Outline}
% \Fontvi % to make toc smaller % changed <<<<<<<<<<<<<<<<
\tableofcontents[currentsection,currentsubsection]
\end{frame}
}
% Outline at the beginning of each subsubsection:
\AtBeginSubsubsection[]
{
\begin{frame}[allowframebreaks]{Outline}
% \Fontvi % to make toc smaller % changed <<<<<<<<<<<<<<<<
\tableofcontents[currentsection,currentsubsection,currentsubsection]
\end{frame}
}
\title[Your Short Title]{Title}
% to Insert sectiontitle in footer:
\setbeamertemplate{footline}{
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1.5ex,leftskip=2ex,rightskip=2ex]{page footer}%
\usebeamerfont{title in head/foot}%
\insertsection \hfill
% \insertshorttitle \hfill
\insertsubsection \hfill
\insertsubsubsection \hfill
\insertframenumber{} / \inserttotalframenumber
\end{beamercolorbox}}%
}
\setbeamerfont{caption name}{size=\tiny}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
% Uncomment these lines for an automatically generated outline.
\begin{frame}[allowframebreaks]{Outline}
% \Fontvi % changed <<<<<<<<<<<<<<<<
\tableofcontents
\end{frame}
\section{Section 1}
\subsection{Sub-section 1.1}
\subsubsection{Sub-Sub-section 1.1.1}
\end{document