# In inmargin innertheme, how to customize the block title width in the sidebar? [duplicate]

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.

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}
\newcommand{\blockbox}[2][\blockboxwidth]{
\frame{\parbox{#1}{\raggedleft #2}}
}

\begin{document}

\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 StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Mar 12 at 9:56

• 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

\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%
\hsize=\@tempdima%
\leftskip=0pt plus 1fill%
\rightskip=0pt\relax%
\leavevmode#1}\kern#2}%
}
\makeatother

\begin{document}

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


• 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