1
\begin{example}
Is there a way to modify the color of the word "Example 1" and also being able to tpye 
on the same line with the word Example 1?
\end{example}

enter image description here

Werner
  • 603,163
hochoi
  • 193

1 Answers1

1

Changing the foreground <colour> for the example environment is achieved using

\setbeamercolor{block title example}{fg=<colour>}

For using an "inline example", you can define your own environment, say inlineexample:

enter image description here

\documentclass{beamer}

\let\Tiny\tiny% http://tex.stackexchange.com/a/94159/5764
\setbeamertemplate{theorems}[numbered]

\newenvironment{inlineexample}
  {\par\vskip\medskipamount
   \refstepcounter{theorem}%
   {\usebeamercolor[fg]{block title example}\translate{Example}~\theexample}:}
  {\par\vskip\smallskipamount}

\begin{document}

\begin{frame}
  \frametitle{Frame title}

  \begin{example}
    Is there a way to modify the color of the word ``Example~\theexample'' and 
    also being able to type on the same line with the word Example~\theexample?
  \end{example}

  \setbeamercolor{block title example}{fg=red}
  \begin{example}
    Is there a way to modify the color of the word ``Example~\theexample'' and 
    also being able to type on the same line with the word Example~\theexample?
  \end{example}

  \begin{inlineexample}
    Is there a way to modify the color of the word ``Example~\theexample'' and 
    also being able to type on the same line with the word Example~\theexample?
  \end{inlineexample}

\end{frame}

\end{document}
Werner
  • 603,163