TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use a custom Beamer theme for my presentations. In my presentations I'd like to use blocks (\begin{block}…\end{block}). These blocks are rendered slightly too wide to fit into my theme. Is there a way how I can set the default width of blocks, e.g. to .9\textwidth?

share|improve this question
up vote 16 down vote accepted

If you do not require a new block environment with customizable width, but simply want to change the width of the original block environments, add the following to your preamble:

\addtobeamertemplate{block begin}{%

\addtobeamertemplate{block alerted begin}{%

\addtobeamertemplate{block example begin}{%
share|improve this answer
Is there a way to do this but to make the block centered? For me it sticks to the left of the page. – mrbrich Aug 26 '14 at 14:31

You could define your own block environment with an optional parameter for its width and provide a default value such as .9\textwidth.

Here's an example:


    \usebeamertemplate{block begin}}
    \usebeamertemplate{block end}%


  Normal block
\begin{varblock}[4cm]{New block}
  Variable width, here 4cm
\begin{varblock}{New block}
  If no width was given, .9\textbackslash textwidth will be used


variable blocks example

I posted this example here in 2008.

share|improve this answer
(+1) I initially provided a link to this thread. Definitively better that you answered yourself. – chl Mar 3 '11 at 12:56
@chl: thanks for the link! I noticed your comment right after posting. I just remembered that earlier thread. In addition to the older post I took the chance to create and post a screenshot. – Stefan Kottwitz Mar 3 '11 at 13:12
Thanks for your answer! I'll definitely remember it for when I need something like this. However, the answer which I accepted does exactly what I desired right now. – tobyS Mar 3 '11 at 14:18
For the sake of completeness, in order to center the shortened block, one has to surround it with \begin{cenetr}\begin{minipage}{block_width}<shortened block> \end{minipage}\end{center} – Dror Jan 27 '12 at 9:38
@Dror: Well, that way one can even use the regular block environment ... – user25287 Jan 31 '13 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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