4

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

1 Answer 1

4

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}
2
  • 1
    Any reason for the downvote? If downvoters explain what's wrong with answers, authors can improve them.
    – Ignasi
    Commented Jun 28, 2017 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
    Commented Jun 21, 2019 at 8:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .