Beamer: 環境のカスタムスタイル

Beamer: 環境のカスタムスタイル

ビーマー、いくつかの定義済みの(色の)スタイルがあります。無地定理意味そして述べる私の最初の質問はこれらのスタイルのリストはどこにありますか?2つ目は自分独自のスタイルを作るにはどうすればいいでしょうか?例えば、私はオレンジコメントの色。

答え1

ここでは、新しいカスタマイズされた定理のようなブロックを簡単に定義する方法を示します。カスタマイズされた設定で新しいスタイルを定義し、この新しいスタイルを構造に使用するという考え方です。

\documentclass{beamer}
\usetheme{Warsaw}

\makeatletter
\def\th@mystyle{%
    \normalfont % body font
    \setbeamercolor{block title example}{bg=orange,fg=white}
    \setbeamercolor{block body example}{bg=orange!20,fg=black}
    \def\inserttheoremblockenv{exampleblock}
  }
\makeatother
\theoremstyle{mystyle}
\newtheorem*{remark}{Remark}

\begin{document}

\begin{frame}
\begin{theorem}[An important theorem]
    Some text
\end{theorem}

\begin{remark}[Some important remark]
    Some text
\end{remark}
\end{frame}

\end{document}

ここに画像の説明を入力してください

定理のような構造の定義に関連する設定:

ファイルには次のbeamerbasetheorems.sty内容が記載されています:

\def\th@example{\th@remark}

そして

\ifbeamer@countsect
  \newtheorem{theorem}{\translate{Theorem}}[section]
\else
  \newtheorem{theorem}{\translate{Theorem}}
\fi
\newtheorem{corollary}[theorem]{\translate{Corollary}}
\newtheorem{fact}[theorem]{\translate{Fact}}
\newtheorem{lemma}[theorem]{\translate{Lemma}}
\newtheorem{problem}[theorem]{\translate{Problem}}
\newtheorem{solution}[theorem]{\translate{Solution}}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{\translate{Definition}}
\newtheorem{definitions}[theorem]{\translate{Definitions}}

\theoremstyle{example}
\newtheorem{example}[theorem]{\translate{Example}}
\newtheorem{examples}[theorem]{\translate{Examples}}

つまり、exampleスタイルは注釈スタイルと同じであり、plain定理、系、補題、問題、解決に使用されます。スタイルはdefinition定義に適用され、exampleスタイルは例に適用されます。

また、関連するのは、

\def\inserttheoremheadfont{\the\thm@headfont}
  \def\inserttheoremblockenv{block}

  \def\th@example{%
    \normalfont % body font
    \def\inserttheoremblockenv{exampleblock}
  }

これは基本的に、例のスタイルではexampleblockが使用され、他のすべての定理のような構造ではblockが使用されることを示しています。

1つにはbeamerbaseauxtemplates.sty次のことが書かれています:

\defbeamertemplate{theorem begin}{ams style}
{%
  \begin{\inserttheoremblockenv}
    {%
      \inserttheoremheadfont
      \inserttheoremname
      \inserttheoremnumber
      \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
      \inserttheorempunctuation
    }%
}

\defbeamertemplate{theorem end}{ams style}
{\end{\inserttheoremblockenv}}


\defbeamertemplate{theorem begin}{numbered}
{%
  \begin{\inserttheoremblockenv}
    {%
      \inserttheoremname
      \inserttheoremnumber
      \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
    }%
}

\defbeamertemplate{theorem end}{numbered}
{\end{\inserttheoremblockenv}}


\defbeamertemplate{theorem begin}{normal font}
{
  \normalfont
  \begin{\inserttheoremblockenv}
  {%
    \inserttheoremname
    \ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
  }%
}

\defbeamertemplate{theorem end}{normal font}
{\end{\inserttheoremblockenv}}

関連情報