I would like to design a beamer template in which the block
s are indented, i.e. their left outer margin is increased. How do I do this?
The width of the block can be set using
\addtobeamertemplate{block begin}{%
\setlength{\textwidth}{0.8\textwidth}%
}
The only solutions I found use columns
which will not work here (i.e. within addtobeamertemplate
). At least I think there should be an easier way?
Minimal not-working example:
\documentclass{beamer}
\usetheme{Antibes}
\begin{document}
\frame{
\setlength{\textwidth}{0.8\textwidth}% effectively increases right outer margin
% command to indent goes here: it would need to be something that I can use in addtobeamertemplate
\begin{block}{}
Indent me!
\end{block}
}
\end{document}
Best Answer
Solution
Instead of using
\hspace
you could set\leftskip=\blockleftindent
as suggested in the solution by @Herbert.Explanation
The problem is that you cannot achieve that using
\addtobeamertemplate
: if you look at how the template is defined inbeamerinnerthemedefault.sty
you see that if you add code at the beginning, you are acting just before a
\par
is issued. So, unless you want to use black magic to have your code swallow the\par
, you have to copy over the definition and change it according to your needs with\setbeamertemplate
. Here I achieve the indentation simply by putting some\hspace
before the twobeamercolorbox
es that contain the title and the contents. Other means to add that horizontal space may be used.The alternative with
\leftskip
could be implemented using\addtobeamertemplate
since the new\leftskip
value would be used later when creating thebeamerboxes
. However to change the indentation on the right you need to modify thewd
key of the beamer box environment, which requires again to use\setbeamertemplate
.