I have a beamer presentation and an alert block. I want to insert a horizontal ruler to seperate text. To fit into the style of the presentation, it should match the color of the surrounding alert block. How can I use the color of the alert blocks title line? At the moment I am just using a color that matched okay-ish in my opinion.
\begin{center}
\textcolor{BrickRed}{\hrulefill}
\end{center}
I am aware of the command \usebeamercolor[fg]{structure} text
, but I do not know what to put for fg
and structure
to give be the desired color (yes, I checked the beamer documentation).
Extra: At the moment, the exact vertical positioning of the \hrulefill
is achieved by two (annoyingly fine-tuned) \vspace
-commands, one before and one after the ruler. Without these, there are huge gaps between the text and the ruler. Is there a better way to achieve a nice positioning?
Update
The problem with the color seems to be solved by the answer of samcarter. For the positioning problem I was pointed out to provide an MWE:
\documentclass[pdf]{beamer}
\usetheme{Malmoe}
\usecolortheme{beaver}
\usecolortheme{orchid}
\usefonttheme{professionalfonts}
\begin{document}
\begin{frame}{Frenet equations}
\begin{alertblock}{\textbf{Theorem:} Frenet equations}
For the Frenet frame $(\bf t,\bf n)$ of a curve holds
\begin{align*}
\bf t'(t) &= \phantom+\kappa(t)\bf n(t),\\
\bf n'(t) &= -\kappa(t)\bf t(t).
\end{align*}
%
\vspace{-3em}
\begin{center}
\usebeamercolor[bg]{block title alerted}\hrulefill
\end{center}
%
\vspace{-0.5em}
The equations can be written in \emph{matrix form}:
$$
\begin{pmatrix}
\bf t'\\\bf n'
\end{pmatrix}=\begin{pmatrix}
\phantom-0&\kappa\\-\kappa&0
\end{pmatrix}\begin{pmatrix}
\bf t\\\bf n
\end{pmatrix}.
$$
\end{alertblock}
\end{frame}
\end{document}
Best Answer
You can access the colour with
\usebeamercolor[bg]{block title alerted}
The large vertical spacing mainly comes from the
center
environment, which is not necessary anyway for an element which spans the whole line.