1

I am using the shaded environment instead of block; however, the shaded environment is too less tight. I could try to tighten it by hand but then weird things happen; does anyone know how to do it elegantly? enter image description here

\documentclass{beamer}

\usepackage{multicol}
\usepackage{framed, color}
\definecolor{shadecolor}{RGB}{228,230,231}
%Zitate und todos
\usepackage{url}
\usepackage{todonotes}

% Reelle, Natürliche, Ganze, Rationale Zahlen
\newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\N}{\ensuremath{\mathbb{N}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\Q}{\ensuremath{\mathbb{Q}}}

% Fraktur für Strukturen
\newcommand{\A}{\ensuremath{\mathfrak A}}
\newcommand{\B}{\ensuremath{\mathfrak B}}
\newcommand{\C}{\ensuremath{\mathfrak C}}
\newcommand{\D}{\ensuremath{\mathfrak D}}
\newcommand{\I}{\ensuremath{\mathfrak I}}

% Makros für logische Operatoren
\newcommand{\xor}{\ensuremath{\oplus}} %exklusives oder
\newcommand{\impl}{\ensuremath{\rightarrow}} %logische Implikation
\newcommand{\Impl}{\ensuremath{\Rightarrow}}

% Meistens ist \varphi schöner als \phi, genauso bei \theta
\renewcommand{\phi}{\varphi}
\renewcommand{\theta}{\vartheta}
\renewcommand{\epsilon}{\varepsilon}
\newcommand{\w}{\omega}
%\newcommand{\a}{\alpha}
%\newcommand{\b}{\beta}
%\newcommand{\c}{\gamma}
%\newcommand{\d}{\delta}

%sonstige Makros
\renewcommand{\*}{\cdot}
%\usepackage{enumitem,cleveref} incompatible with beamer
%\usepackage{enumitem} incompatible with beamer

\usetheme[progressbar=frametitle]{metropolis} %wie weit man ist
\setbeamertemplate{frame numbering}[fraction]
\useoutertheme{metropolis}
\useinnertheme{metropolis}
\usecolortheme{spruce}
\setbeamercolor{background canvas}{bg=white}

\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{microtype}
\usepackage{stmaryrd}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{lmodern}

\definecolor{mygreen}{rgb}{.125,.5,.25}
\usecolortheme[named=mygreen]{structure}


\begin{document}
    \metroset{block=fill}
    \begin{frame}[t]{}
        \begin{block}{}
            $\mathcal{A} = (Q,\Sigma, \delta, q_0, F) $
        \end{block}
        \begin{shaded*}{
        \vspace{-0.4cm}
        $\mathcal{A} = (Q,\Sigma, \delta, q_0, F) $} 
        \vspace{-0.4cm}
        \end{shaded*}
    \end{frame}
\end{document}
2
  • 1
    Wouldn't it make more sense to stick to the usual block environment and remove the empty title's background using the approach in the following answer? tex.stackexchange.com/a/377781/134144
    – leandriis
    Feb 7, 2021 at 10:34
  • Excellent! I had not found that before! Thank you!
    – sorry
    Feb 7, 2021 at 11:13

2 Answers 2

1

Does setting of \FrameSep in preamble is acceptable to you?

\documentclass{beamer}
\usepackage{framed}
\setlength\FrameSep{1ex} % <---

\definecolor{shadecolor}{RGB}{228,230,231}
\definecolor{mygreen}{rgb}{.125,.5,.25}

\usetheme[progressbar=frametitle]{metropolis} %wie weit man ist
\setbeamertemplate{frame numbering}[fraction]
\useoutertheme{metropolis}
\useinnertheme{metropolis}
\usecolortheme{spruce}
\setbeamercolor{background canvas}{bg=white}
\usecolortheme[named=mygreen]{structure}


\begin{document}
    \metroset{block=fill}
\begin{frame}[t]{}
    \begin{block}{}
        $\mathcal{A} = (Q,\Sigma, \delta, q_0, F) $
    \end{block}
    \begin{shaded*}
    {
    $\mathcal{A} = (Q,\Sigma, \delta, q_0, F) $
    }
    \end{shaded*}
\end{frame}
\end{document}

As you can see, I convert your document example to MWE /Minimal Working Example).

enter image description here

1
  • Thank you very much!
    – sorry
    Feb 7, 2021 at 21:56
0

With the tcolorbox inner theme v0.5 or newer, you can keep using the beamer block environment and just switch off the empty title area:

\documentclass{beamer}

\usepackage{todonotes}
\usetheme[progressbar=frametitle]{moloch}% modern fork of the metropolis theme
\usecolortheme{spruce}

\setbeamercolor{block title}{%
  use=normal text,
  fg=normal text.fg,
  bg=normal text.bg!80!fg
}
\setbeamercolor{block body}{
  use={block title, normal text},
  bg=block title.bg!50!normal text.bg
}

\setbeamercolor{background canvas}{bg=white}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{stmaryrd}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\definecolor{mygreen}{rgb}{.125,.5,.25}
\usecolortheme[named=mygreen]{structure}

\useinnertheme[showtitle=false]{tcolorbox}

\begin{document}
    \begin{frame}[t]{}
        \begin{block}{}
            $\mathcal{A} = (Q,\Sigma, \delta, q_0, F) $
        \end{block}
    \end{frame}
\end{document}

enter image description here

You must log in to answer this question.

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