2

I'm currently working on a presentation using the beamer class and I've stumbled upon a problem that I don't know how to solve. Consider the follwoing MWE:

\documentclass{beamer}

\mode<presentation> {
\usetheme{Madrid}
\setbeamertemplate{footline}{}} 

\usepackage{graphicx} 
\usepackage{booktabs} 
\usepackage[english]{babel}
\usepackage{amssymb, amsthm, mathtools}

\usefonttheme{serif}

\begin{document}
\begin{frame}\frametitle{Useful relations to keep in mind}
\begin{align*}
A&=B+C& U&=\psi(x)\\
G&= AA& C&=\partial^\nu\\
B&=A+B& F&=BB
\end{align*}
\end{frame}
\end{document}

This gives enter image description here but I'd like it to be enter image description here

I'm honestly a bit lost at how one could achieve this since I never had to work with "filling" things in Latex with color...

EDIT: Just to make it clear, this should only apply to one frame, all other frames should stay normal!

  • 3
    Welcome to TeX.SE! – Kurt Mar 18 at 21:28
  • Off-topic: you don't need graphicx with beamer – user36296 Mar 18 at 21:32
3

Welcome. How about

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\mode<presentation> {
\usetheme{Madrid}
\setbeamertemplate{footline}{}} 

\usepackage{graphicx} 
\usepackage{booktabs} 
\usepackage[english]{babel}
\usepackage{amssymb, amsthm, mathtools}

\usefonttheme{serif}

\begin{document}
\begin{frame}[t]
\frametitle{Useful relations to keep in mind}
\begin{align*}
A&=B+C& U&=\psi(x)\\
G&= AA& C&=\partial^\nu\\
B&=A+B& F&=BB\tikzmark{aux}
\end{align*}
\begin{tikzpicture}[overlay,remember picture]
\fill ([yshift=-1ex]pic cs:aux) coordinate (aux) (current page.south west) rectangle 
(aux-|current page.east);
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

You can, of course, move the equations up and it still works.

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\mode<presentation> {
\usetheme{Madrid}
\setbeamertemplate{footline}{}} 

\usepackage{graphicx} 
\usepackage{booktabs} 
\usepackage[english]{babel}
\usepackage{amssymb, amsthm, mathtools}

\usefonttheme{serif}

\begin{document}
\begin{frame}[t]
\frametitle{Useful relations to keep in mind}
\vspace*{-3em}
\begin{align*}
A&=B+C& U&=\psi(x)\\
G&= AA& C&=\partial^\nu\\
B&=A+B& F&=BB\tikzmark{aux}
\end{align*}
\begin{tikzpicture}[overlay,remember picture]
\fill ([yshift=-1ex]pic cs:aux) coordinate (aux) (current page.south west) rectangle 
(aux-|current page.east);
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

  • First of all, thanks for the answer! This is very close to what I'm looking for... Would it be possible to shift the align environment up a bit (closer to the title) and fill the rest with black? – Marius Jaeger Mar 19 at 10:28
  • @MariusJaeger Of course. I added a version that does that. – marmot Mar 19 at 14:10
  • Works perfectly! Thank you very much! – Marius Jaeger Mar 19 at 16:14

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.