3

I'm trying to specify a given height for a beamer block. I tried to specify a new environment based on an example I found elsewhere on this forum (reproduced below), but failed miserably.. What I would like to do is to specify, each time, the height of the block (instead of its width). Any suggestions? Thanks in advance.

Andy

Example code:

\newenvironment<>{varblock}[2][.9\textwidth]{%
  \setlength{\textwidth}{#1}
  \begin{actionenv}#3%
  \def\insertblocktitle{#2}%
   \par%
   \usebeamertemplate{block begin}}
{\par%
\usebeamertemplate{block end}%
\end{actionenv}}
3

Probably not what you want, but in case you don't find a better solution, tcolorbox could help.

enter image description here

\documentclass{beamer}
\usetheme{warsaw}
\usepackage[most]{tcolorbox}

\begin{document}
\begin{frame}
\begin{tcolorbox}[beamer,title=tcolorbox,height=3cm]
Some text
\end{tcolorbox}

\begin{tcolorbox}[beamer,title=tcolorbox,height=4cm, width=5cm]
Some text
\end{tcolorbox}
\end{frame}
\end{document}
  • 1
    Any reason for the downvote? If downvoters explain what's wrong with answers, authors can improve them. – Ignasi Jun 28 '17 at 10:05
  • The problem is what you already acknowledge "Probably not what you want". In Stack, it's a good practice to answer exactly the author question, to fulfil the author requirements and, potentially, the requirements of all the people that later will find the question and answer. Anyway, your solution works, and if it is not better way to do it, it's okay. – Alber8295 Jun 21 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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