在 inmargin innertheme 中,如何自定义侧边栏中的块标题宽度?

在 inmargin innertheme 中,如何自定义侧边栏中的块标题宽度?

下方矩形所指示的空间是空的,可用于文本本身。我意识到我可以通过设置 lesser 来减少它sidebar width left,但我希望块的标题更长。

在此处输入图片描述

出于这个原因,我尝试创建一个\blockbox默认宽度sidebar width left小于 3mm 的自定义框。但是,上面的输出显示该框的宽度确实与 几乎相同,但未对齐。因此,一种可能的解决方案是在环境定义中简单地移动此框,但我不知道如何做到这一点。

更优的解决方案是重新定义标题的可用宽度block,大约为3.5cm

\documentclass[aspectratio=169, xcolor={x11names}]{beamer}


\usecolortheme{crane}

\usefonttheme{structurebold}

\useinnertheme{inmargin}

\useoutertheme[]{split}

    \setbeamersize{text margin left=2mm, text margin right=2mm}

    \newlength{\sidebarWidth}
    \setlength{\sidebarWidth}{5cm}  
    \setbeamersize{sidebar width left=\sidebarWidth, sidebar width right=0cm}

    \newlength{\blockboxwidth}
    \setlength{\blockboxwidth}{\sidebarWidth}
    \addtolength{\blockboxwidth}{-3mm}
    \newcommand{\blockbox}[2][\blockboxwidth]{
        \frame{\parbox{#1}{\raggedleft #2}} 
                                            }

\begin{document}

\begin{frame}{Showing Contents Gradually}

    \begin{block}{Why is induction motor very common}
        Induction motors are very practical for the following reasons

        \begin{description}[<+->]
            \item[Rigid] Rigid
            \item[Cheap] Cheap
            \item[Low Maintenance] Low Maintenance
            \item[Self-Starting] Self-starting
            \item[No Excitation Needed] No Excitation Needed
        \end{description}

    \end{block}

    \begin{block}{\blockbox{Why is induction motor very common} Why is induction motor very common}

        Induction motors are very practical for the following reasons

        \begin{description}[<+->]
            \item[Rigid] Rigid
            \item[Cheap] Cheap
            \item[Low Maintenance] Low Maintenance
            \item[Self-Starting] Self-starting
            \item[No Excitation Needed] No Excitation Needed
        \end{description}

    \end{block}

\end{frame}

\end{document}

答案1

只是重复我对你上一个问题的回答:

\documentclass[aspectratio=169, xcolor={x11names}]{beamer}

\usecolortheme{crane}
\usefonttheme{structurebold}
\useinnertheme{inmargin}
\useoutertheme{split}

\newlength{\sidebarWidth}
\setlength{\sidebarWidth}{5cm}  
\setbeamersize{sidebar width left=\sidebarWidth, sidebar width right=0cm}


\makeatletter
\renewcommand\beamer@putleft[2]{%
  \hbox to 0pt{\hss\vtop{%
      \normalsize%
      \@tempdima=\beamer@leftsidebar%
      \advance\@tempdima by-3ex%
      \hsize=\@tempdima%
      \leftskip=0pt plus 1fill%
      \rightskip=0pt\relax%
      \leavevmode#1}\kern#2}%
}
\makeatother


\begin{document}

\begin{frame}{Showing Contents Gradually}

    \begin{block}{Why is induction motor very common\linebreak Induction motors are very practical for the following reasons}

        \begin{description}[<+->]
            \item[Rigid] Rigid
            \item[Cheap] Cheap
            \item[Low Maintenance] Low Maintenance
            \item[Self-Starting] Self-starting
            \item[No Excitation Needed] No Excitation Needed
        \end{description}

    \end{block}

    \begin{block}{Why is induction motor very common\linebreak Why is induction motor very common}

        Induction motors are very practical for the following reasons

        \begin{description}[<+->]
            \item[Rigid] Rigid
            \item[Cheap] Cheap
            \item[Low Maintenance] Low Maintenance
            \item[Self-Starting] Self-starting
            \item[No Excitation Needed] No Excitation Needed
        \end{description}

    \end{block}

\end{frame}

\end{document}

在此处输入图片描述

相关内容