0

This question already has an answer here:

The space indicated by the rectangle below is empty and could be used for the text itself. I realize that I can reduce it by setting lesser sidebar width left, but I would like the titles of block to be long.

enter image description here

For this reason, I tried to create a custom box \blockbox that will be by default equal to the width of sidebar width left less 3mm. However, the output above shows that the box is indeed has nearly the same width of the but is misaligned. Thus, one possible solution is to simply shift this box in the environment definition, but I do not know how to do this.

A more optimal solution is to redefine the width available for block title which is approximately 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}

marked as duplicate by user36296 beamer Mar 12 at 9:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • While you wait for an answer to this question, can you go back to your previous ones and look if the answers solve your problems and accept them, if they do? – user36296 Mar 12 at 9:44
  • see my solution to your previous question tex.stackexchange.com/a/478855/36296 You need to redefine \beamer@putleft and not mess with the box itself. Alternatively you could use the dev version of beamer from github.com/josephwright/beamer I made a pull request yesterday to fix the problem. – user36296 Mar 12 at 9:56
0

Just repeating my answer to your previous question:

\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}

enter image description here

  • Ah, for some reason, I did something wrong that the solution did not work when I tried it before. Anyway. Can you explain what these macros mean? – Al-Motasem Aldaoudeyeh Mar 12 at 17:00
  • @Al-MotasemAldaoudeyeh What \beamer@putleft basically does is create a box for the text that should go in the margin. It is used internally by beamer and in its previous version the width of said box was hard-coded. I changed it to look up the width of the sidebar and use this width. – user36296 Mar 12 at 20:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.