hohei’s diary

備忘録?

tikzlingsパッケージで作るフレームの紹介

はじめに

いささか狂気を感じる tikzlingsパッケージを用いて作成したフレームを紹介します。

以下のページを参考というか,ほぼ丸パクリして作りました。

tex.stackexchange.com

tikzlingsパッケージのマニュアルを参照することで,イカしたフレームが少しの変更で作れると思います。

フレームたち

\begin{animal1}
  \sampleex
\end{animal1}

f:id:hohei3108:20220215220741p:plain

\begin{animal2}
  \sampleex
\end{animal2}

f:id:hohei3108:20220215220805p:plain

\begin{animal3}
  \sampleex
\end{animal3}

f:id:hohei3108:20220215221323p:plain

\begin{animal4}
  \sampleex
\end{animal4}

f:id:hohei3108:20220215221344p:plain

\begin{animal5}
  \sampleex
\end{animal5}

f:id:hohei3108:20220215221358p:plain

\begin{animal6}
  \sampleex
\end{animal6}

f:id:hohei3108:20220215221412p:plain

プリアンブルでの記述

問題番号のカウント

\newcounter{mynumcnt}
\setcounter{mynumcnt}{0}% カウントキャンセル
\newcommand{\mynum}{\themynumcnt\refstepcounter{mynumcnt}}

フレームで囲む問題

\newcommand{\sampleex}{%
\textbf{問題\mynum}\quad
次の複素数$z_1$$z_2$の積$z_1 z_2$を極形式で表せ。
  \begin{enumerate}
  \item $z_1=4\qty(\cos{\dfrac{\pi}{6}}+i\sin{\dfrac{\pi}{6}})$\quad $z_2=2\qty(\cos{\dfrac{\pi}{4}}+i\sin{\dfrac{\pi}{4}})$
  \item $z_1=\cos{\dfrac{\pi}{3}}+i\sin{\dfrac{\pi}{3}}$\quad $z_2=3\qty(\cos{\dfrac{\pi}{6}}+i\sin{\dfrac{\pi}{6}})$
  \end{enumerate}
}

フレーム

\newtcolorbox{animal1}[1][]{%
  enhanced,
  before skip=30ex,after skip=10ex,
  colback=yellow,frame hidden,
  overlay={%
    \begin{scope}
      \clip (frame.north west) -- (frame.north east) -- ++(0,+10ex) -- ++(-\linewidth,0) -- cycle;
      \marmot[shift={([yshift=-7ex]frame.north)},whiskers,teeth]
      \koala[shift={([yshift=-7ex,xshift=-5em]frame.north)}]
      \mouse[shift={([yshift=-7ex,xshift=5em]frame.north)}]
    \end{scope}
    %
    \begin{scope}
      \clip (frame.south west) -- (frame.south east) -- ++(0,-10ex) -- ++(-\linewidth,0) -- cycle;
      \marmot[shift={([yshift=-4ex]frame.south)},whiskers,teeth]
      \koala[shift={([yshift=-4ex,xshift=-5em]frame.south)}]
      \mouse[shift={([yshift=-4ex,xshift=5em]frame.south)}]
    \end{scope}}}

\newtcolorbox{animal2}[1][]{%
  enhanced,
  before skip=30ex,after skip=10ex,
  colback=yellow,frame hidden,
  overlay={%
    \begin{scope}
      \clip (frame.north west) -- (frame.north east) -- ++(0,+10ex) -- ++(-\linewidth,0) -- cycle;
      \cat[shift={([yshift=-7ex]frame.north)},eye=green]
      % \bat[shift={([yshift=-7ex,xshift=-5em]frame.north)}]
      % \bee[shift={([yshift=-7ex,xshift=5em]frame.north)}]
    \end{scope}
    %
    \begin{scope}
      \clip (frame.south west) -- (frame.south east) -- ++(0,-10ex) -- ++(-\linewidth,0) -- cycle;
      \cat[shift={([yshift=-4ex]frame.south)}]
      % \bat[shift={([yshift=-4ex,xshift=-5em]frame.south)}]
      % \bee[shift={([yshift=-4ex,xshift=5em]frame.south)}]
    \end{scope}}}

\newtcolorbox{animal3}[1][]{%
  enhanced,
  before skip=30ex,after skip=10ex,
  colback=yellow,frame hidden,
  overlay={%
    \begin{scope}
      \clip (frame.north west) -- (frame.north east) -- ++(0,+10ex) -- ++(-\linewidth,0) -- cycle;
      \owl[shift={([yshift=-7ex]frame.north)},
       bill=pink,speech={Yes!},bubblecolour=gray!30!white]
      % \bat[shift={([yshift=-7ex,xshift=-5em]frame.north)}]
      % \bee[shift={([yshift=-7ex,xshift=5em]frame.north)}]
    \end{scope}
    %
    \begin{scope}
      \clip (frame.south west) -- (frame.south east) -- ++(0,-10ex) -- ++(-\linewidth,0) -- cycle;
      \owl[shift={([yshift=-4ex]frame.south)}]
      % \bat[shift={([yshift=-4ex,xshift=-5em]frame.south)}]
      % \bee[shift={([yshift=-4ex,xshift=5em]frame.south)}]
    \end{scope}}}

\newtcolorbox{animal4}[1][]{%
  enhanced,
  before skip=30ex,after skip=10ex,
  colback=yellow,frame hidden,
  overlay={%
    \begin{scope}
      \clip (frame.north west) -- (frame.north east) -- ++(0,+10ex) -- ++(-\linewidth,0) -- cycle;
      \snowman[shift={([yshift=-7ex]frame.north)},tophat]
      % \bat[shift={([yshift=-7ex,xshift=-5em]frame.north)}]
      % \bee[shift={([yshift=-7ex,xshift=5em]frame.north)}]
    \end{scope}
    %
    \begin{scope}
      \clip (frame.south west) -- (frame.south east) -- ++(0,-10ex) -- ++(-\linewidth,0) -- cycle;
      \snowman[shift={([yshift=-4ex]frame.south)}]
      % \bat[shift={([yshift=-4ex,xshift=-5em]frame.south)}]
      % \bee[shift={([yshift=-4ex,xshift=5em]frame.south)}]
    \end{scope}}}

\newtcolorbox{animal5}[1][]{%
  enhanced,
  before skip=30ex,after skip=10ex,
  colback=yellow,frame hidden,
  overlay={%
    \begin{scope}
      \clip (frame.north west) -- (frame.north east) -- ++(0,+10ex) -- ++(-\linewidth,0) -- cycle;
      \mouse[shift={([yshift=-7ex]frame.north)},santa=red!80!black]
      % \bat[shift={([yshift=-7ex,xshift=-5em]frame.north)}]
      % \bee[shift={([yshift=-7ex,xshift=5em]frame.north)}]
    \end{scope}
    %
    \begin{scope}
      \clip (frame.south west) -- (frame.south east) -- ++(0,-10ex) -- ++(-\linewidth,0) -- cycle;
      \mouse[shift={([yshift=-4ex]frame.south)}]
      % \bat[shift={([yshift=-4ex,xshift=-5em]frame.south)}]
      % \bee[shift={([yshift=-4ex,xshift=5em]frame.south)}]
    \end{scope}}}

\newtcolorbox{animal6}[1][]{%
  enhanced,
  before skip=30ex,after skip=10ex,
  colback=yellow,frame hidden,
  overlay={%
    \begin{scope}
      \clip (frame.north west) -- (frame.north east) -- ++(0,+10ex) -- ++(-\linewidth,0) -- cycle;
      \chicken[shift={([yshift=-7ex]frame.north)},comb=orange]
      \chicken[shift={([yshift=-4ex,xshift=-5em]frame.north)},baby=pink]
      \chicken[shift={([yshift=-4ex,xshift=5em]frame.north)},baby]
    \end{scope}
    %
    \begin{scope}
      \clip (frame.south west) -- (frame.south east) -- ++(0,-10ex) -- ++(-\linewidth,0) -- cycle;
      \chicken[shift={([yshift=-4ex]frame.south)}]
      \chicken[shift={([yshift=-4ex,xshift=-5em]frame.south)},baby=pink]
      \chicken[shift={([yshift=-4ex,xshift=5em]frame.south)},baby]
    \end{scope}}}

コンパイル

コンパイルの例です。

www.overleaf.com