修改示例环境

修改示例环境
\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}

在此处输入图片描述

答案1

改变环境的f矿石g轮次是使用<colour>example

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

对于使用“内联示例”,您可以定义自己的环境,例如inlineexample

在此处输入图片描述

\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}

相关内容