1

I cannot figure out how to set the font size of a particular beamercolorbox in Beamer. I have a beamercolorbox called "box" which I invoke with the following command:

\begin{beamercolorbox}[sep=4pt]{box} 

I would like to set the font size of the text in this box. I tried putting the following in the preamble:

\setbeamerfont{box}{size={10}{12}} 

But this does not produce any effect. What am I missing?

Here is a MWE:

\documentclass{beamer} \usepackage[utf8]{inputenc} \usecolortheme{beetle} \setbeamercolor{box}{fg=black,bg=gray!50} \begin{document} \begin{frame} \frametitle{Title of frame} \begin{beamercolorbox}[sep=4pt]{box} “A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote.” \end{beamercolorbox} \end{frame} \end{document} 

Here is the output:

enter image description here

I would like to reduce the font size of the beamercolorbox so that the long quotation fits more nicely on the page, not just for this particular box, but for all boxes of type "box".

Thanks in advance for your help!

1
  • 1
    Please provide MWE, that we can test a solution. Commented Jan 12, 2021 at 20:40

1 Answer 1

3

If you want to fix font size with {10}{12}, you have to use size* option. And the command \usebeamerfont where you want it.

If you want to apply this size to all box boxes, you can declare a newenvironment like mybox in following code.

\documentclass{beamer} \usepackage[utf8]{inputenc} \usecolortheme{beetle} \setbeamercolor{box}{fg=black,bg=gray!50} \setbeamerfont{box}{size*={10}{12}} \newenvironment<>{mybox}[1][]% {\begin{beamercolorbox}[#1]{box}\usebeamerfont{box}}{\end{beamercolorbox}} \begin{document} \begin{frame} \frametitle{Title of frame} \begin{mybox}[sep=4pt] “A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote. A long quote.” \end{mybox} \end{frame} \end{document} 

enter image description here

2
  • That works, thank you very much! A question about a detail: Why is there a little indent on the first line of the quote, and can this indent be eliminated? Commented Jan 13, 2021 at 18:28
  • 1
    @Wolfhart Add % after [sep=4pt] Commented Jan 14, 2021 at 9:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.