inmargin insidetheme中,如何自訂側邊欄中的區塊標題寬度?

inmargin insidetheme中,如何自訂側邊欄中的區塊標題寬度?

下面的矩形指示的空間是空的,可用於文字本身。我意識到我可以透過設定 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}

在此輸入影像描述

相關內容