tcolorboxパッケージを用いたカラフルな定理環境

ソースコード

      
        \usepackage{tcolorbox}
        \tcbuselibrary{theorems,skins,breakable}

        \tcbset{
          thmstyle/.style={
            colframe=blue!50!black,
            colback=blue!50!black!2!white,
            colbacktitle=blue!50!black,
            boxrule=0pt,
            left*=1\zw,
            right*=1\zw,
            sharp corners,
            before skip=1\zw,
            after skip=1\zw,
            before upper={\setlength{\parindent}{1\zw}},
            breakable,
          },
          defstyle/.style={
            colframe=red!50!black,
            colback=red!50!black!2!white,
            colbacktitle=red!50!black,
            boxrule=0pt,
            left*=1\zw,
            right*=1\zw,
            sharp corners,
            before skip=1\zw,
            after skip=1\zw,
            before upper={\setlength{\parindent}{1\zw}},
            breakable,
          }
        }

        \newtcbtheorem{thm}{Theorem}{thmstyle}{thm}
        \newtcbtheorem{defi}{Definition}{defstyle}{defi}
      
      

解説