格式化自定义侧边栏尺寸以避免剪辑

格式化自定义侧边栏尺寸以避免剪辑

我正在尝试创建一个自定义侧边栏以包含在演示文稿的各部分内容中,并希望获得一些帮助来解决我遇到的一些问题。

首先,黄色框中是本文档的“步骤 1”文本所在的位置。我不想隐藏它,那么我该如何调整侧边栏的高度,使其低于顶部栏,以避免出现这种剪切?

评论中已经指出了此问题的解决方案:

要完成第一步,请尝试 \setbeamertemplate{sidebar left}{% \vspace*{\headheight}% 步骤 1 ... – samcarter

如果有一种方法可以定义实际的对象而不是向下移动对象内的文本,那么这将是更好的选择。

其次,我想清理侧边栏的格式,这样像素就不会像框架标题(蓝色带)和顶部导航栏的位置那样被切割。我确实想保留这两个其他功能。

下面是一张我所谈论内容的图片:

在此处输入图片描述

以下是我得到这个结果的代码:

\documentclass[14pt]{beamer}
\usetheme{Frankfurt}

\setbeamersize{sidebar width left=0.75cm}
\setbeamercolor{sidebar left}{bg=black, fg=green}
\setbeamertemplate{sidebar left}{%
    \vfill
    Step 1
    \vfill
    Step 2
    \vfill
    Step 3
    \vfill
    Step 4
    \vfill
    Step 5
    \vfill
    Step 6
    \vfill
    Step 7
    \vfill
    Step 8
    \vfill
    Step 9
    \vfill
    Step 10
    \vfill
    Step 11
    \vfill
    Step 12
    \vfill
    Step 13
    \vfill
    Step 14
    \vfill
    Step 15
    \vfill
    Step 16
    \vfill
    Step 17
    \vfill
    Step 18
    \vfill
    Step 19
    \vfill
    Step 20
    \vfill
}

\begin{document}
\section{Section 2}
\subsection{Section 2.1}
\subsubsection{Section 2.1.1}
\begin{frame}
    \frametitle{2.1.1 part A}
    This would be the start to the problem
\end{frame}
\begin{frame}
    \frametitle{2.1.1 part B}
    This would start the solution
\end{frame}
\begin{frame}
    \frametitle{2.1.1 part C}
    This would have the next step
\end{frame}
\begin{frame}
    \frametitle{2.1.1 part D}
    This next step process would continue here (and to further slides if needed)
\end{frame}

\subsection{Section 2.2}
\begin{frame}
    \frametitle{2.2.1}
\end{frame}
\begin{frame}
    \frametitle{2.2.2}
\end{frame}

\end{document}

答案1

两个警告:

  1. frametitle对于没有标题下方阴影的框架,我将其重新定义为侧边栏的背景颜色,因此丢失了

  2. 仍然存在:“像素沿着帧标题的位置剪切” - 我不确定,这是真实的还是查看器的问题。


\documentclass[14pt]{beamer}
\usetheme{Frankfurt}

\makeatletter
\AtBeginDocument{
    \colorlet{global.bg}{bg}
    \usebeamercolor{subsection in head/foot}
    \usebeamercolor{section in head/foot}
    \usebeamercolor{frametitle}
    \usebeamercolor{sidebar left}

    \pgfdeclareverticalshading{beamer@barshade}{\the\paperwidth}{%
        color(0ex)=(sidebar left.bg);%
        color(3ex)=(section in head/foot.bg)%
    }    
  }
\makeatother

\setbeamersize{sidebar width left=0.75cm}
\setbeamercolor{sidebar left}{bg=black, fg=green}
\setbeamertemplate{sidebar left}{%
    \vspace{\headheight}
    Step 1
    \vfill
    Step 2
    \vfill
    Step 3
    \vfill
    Step 4
    \vfill
    Step 5
    \vfill
    Step 6
    \vfill
    Step 7
    \vfill
    Step 8
    \vfill
    Step 9
    \vfill
    Step 10
    \vfill
    Step 11
    \vfill
    Step 12
    \vfill
    Step 13
    \vfill
    Step 14
    \vfill
    Step 15
    \vfill
    Step 16
    \vfill
    Step 17
    \vfill
    Step 18
    \vfill
    Step 19
    \vfill
    Step 20
    \vfill
}

\begin{document}
\section{Section 2}
\subsection{Section 2.1}
\subsubsection{Section 2.1.1}
\begin{frame}
    \frametitle{2.1.1 part A}
    This would be the start to the problem
\end{frame}
\begin{frame}
    \frametitle{2.1.1 part B}
    This would start the solution
\end{frame}
\begin{frame}
    \frametitle{2.1.1 part C}
    This would have the next step
\end{frame}
\begin{frame}
    \frametitle{2.1.1 part D}
    This next step process would continue here (and to further slides if needed)
\end{frame}

\subsection{Section 2.2}
\begin{frame}
    \frametitle{2.2.1}
\end{frame}
\begin{frame}
    \frametitle{2.2.2}
\end{frame}

\end{document}

在此处输入图片描述

相关内容