[Tex/LaTex] Make a heading in beamer

beamersectioningthemes

I would like to have the ability to add "headings" to content in my beamer slides.
By heading I just mean slightly larger text that automatically breaks the row and adds some margins to the surrounding text.
Basically something that is exactly like the \section command when writing an article.

I have so far done this using the block environment like

\begin{block}{The heading}
The content goes here.
\end{block}

which worked with my previous theme since the block background was the same as the slide background.
But in my new theme I want to have the usual colored boxes, so some other method is required.

I tried implementing a new headingblock environment that is basically a block environment with new colors:

\newenvironment{headingblock}[1]{%
  \setbeamercolor{block body}{bg=white, fg=black}
  \setbeamercolor{block title}{bg=white, fg=liu_blue}
  \begin{block}{#1}}{\end{block}}

The problem is that everything else inside the block is affected by the \setbeamercolor calls which means I can't have another block inside the headingblock.
Also it feels kind of hackish.

What is the best way to implement this?

Edit
To be extra clear, I am not looking for a frame title, but subheadings within the frame. Something like:

\begin{frame}
  \frametitle{The slide}

  \myheading{The first heading}
  Some text and stuff that goes with the first heading

  \myheading{Second heading}
  More stuff goes here.
\end{frame}

Best Answer

You can define your own block structure in a similar way in which beamer defines exampleblock or alertblock, and set the block title and block body colors for this new block as desired. The original definitions can be found in the file beamerbaselocalstructure.sty. Here's a definition of such a block that you can adjust according to your needs:

\documentclass{beamer}

\newenvironment<>{headingblock}[1]{%
    \begin{actionenv}#2%
      \def\insertblocktitle{#1}%
      \par%
      \mode<presentation>{%
        \setbeamercolor{heading}{fg=black,bg=yellow}
      }%
     \setbeamercolor{block title}{fg=orange,bg=structure}
     %\setbeamercolor{block body}{fg=green,bg=orange} % to customize the colors of the block body
      \usebeamertemplate{block begin}}
    {\par%
      \usebeamertemplate{block end}%
    \end{actionenv}}

\begin{document}

\begin{frame}
\begin{headingblock}{A test heading}
Some test text.
\end{headingblock}
\end{frame}

\end{document}

enter image description here

If you are not interested in a block and want something simpler, you can do something along the following lines (again, adjust the settings according to your needs):

\documentclass{beamer}

\newcommand\myheading[1]{%
  \par\bigskip
  {\Large\bfseries#1}\par\smallskip}

\begin{document}

\begin{frame}
Some test text.
\myheading{A test heading}
Some test text.
\end{frame}

\end{document}

enter image description here