%%
%% Новогоднее поздравление 2013 от кафедры Информатики и
%% математического обеспечения ПетрГУ.
%%
%% Создано Михаилом Крышенем <kryshen@cs.karelia.ru> на основе
%% примеров Штефана Коттвица:
%% http://www.texample.net/tikz/examples/lindenmayer-systems/
%% http://tex.stackexchange.com/questions/39149/
%%
%% Для сборки следует использовать pdflatex.
%%

\documentclass[a4paper]{article}

\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[english,russian]{babel}

\usepackage[top=15mm,left=10mm,right=10mm,bottom=15mm,noheadfoot]{geometry}
\pagestyle{empty}

\usepackage{cmlgc}

\usepackage{tikz}
\usetikzlibrary{lindenmayersystems}

\pgfdeclarelindenmayersystem{Koch curve}{
  \rule{F -> F-F++F-F}}

\pgfdeclarelindenmayersystem{Christmas tree}{
  \rule{S -> [+++G][---G]TS}
  \rule{G -> +H[-G]L}
  \rule{H -> -G[+H]L}
  \rule{T -> TL}
  \rule{L -> [-FFF][+FFF]F}}

\begin{document}
\centering
\begin{tikzpicture}

  % Снежинки Коха

  \begin{scope}[xshift=-9.5cm,yshift=13cm]
    \draw [color=black!70,
      l-system={Koch curve, 
        step=1.2pt, angle=60,
        axiom=F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=-0.7cm,yshift=13cm,rotate=5]
    \draw [color=black!50,
      l-system={Koch curve, 
        step=0.4pt, angle=45,
        axiom=F++F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=-5cm,yshift=9cm]
    \draw [line width=0.3pt,color=black!80,
      l-system={Koch curve, 
        step=0.8pt, angle=60,
        axiom=F++F++F, order=4}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=-6cm,yshift=12.2cm,rotate=-20]
    \draw [color=black!70,
      l-system={Koch curve, 
        step=0.65pt, angle=60,
        axiom=F++F++F, order=4}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=-7.5cm,yshift=7cm]
    \draw [color=black!60,
      l-system={Koch curve, 
        step=0.5pt, angle=45,
        axiom=F++F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=1.8cm,yshift=12cm,rotate=10]
    \draw [color=black!70,
      l-system={Koch curve, 
        step=1.2pt, angle=60,
        axiom=F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[line width=0.3pt,xshift=6cm,yshift=12.2cm,rotate=20]
    \draw [color=black!70,
      l-system={Koch curve, 
        step=0.3pt, angle=45,
        axiom=F++F++F++F, order=4}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=5cm,yshift=9cm]
    \draw [color=black!60,
      l-system={Koch curve, 
        step=0.6pt, angle=60,
        axiom=F++F++F, order=4}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=8cm,yshift=4.5cm,rotate=-20]
    \draw [color=black!70,
      l-system={Koch curve, 
        step=1.3pt, angle=60,
        axiom=F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=-2cm,yshift=3.8cm,rotate=-18]
    \draw [color=black!60,
      l-system={Koch curve, 
        step=1.2pt, angle=60,
        axiom=F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  \begin{scope}[xshift=-8.3cm,yshift=1.8cm,rotate=13]
    \draw [color=black!50,
      l-system={Koch curve, 
        step=0.95pt, angle=60,
        axiom=F++F++F, order=3}] lindenmayer system -- cycle;
  \end{scope}

  % Елка
  \draw [line width=0.3pt,color=black,
    l-system={Christmas tree,
      step=8pt, angle=18,
      axiom=+++++SLFFF, order=11}] lindenmayer system -- cycle;

  % Холмик
  \draw [color=black!60] (0,0) to [out=180,in=0] (-7,-0.5);
  \draw [color=black!60] (0,0) to [out=0,in=180] (7,-0.5);
\end{tikzpicture}

% Поздравление
\fontsize{68}{80}\it С Новым годом 2013!%
\vspace{0.1em}

% Разделитель
\begin{tikzpicture}
  \draw [line width=0.3pt,color=black,
    l-system={Christmas tree,
      step=6pt, angle=18,
      axiom=+++++SLFFF, order=5}] lindenmayer system -- cycle;
\end{tikzpicture}\hfill%
\begin{tikzpicture}
  \draw [color=black!50!black,
    l-system={Koch curve, 
      step=3.2pt, angle=45,
      axiom=F++++F, order=3}] lindenmayer system -- cycle;
\end{tikzpicture}\hfill%
\begin{tikzpicture}
  \draw [line width=0.3pt,color=black,
    l-system={Christmas tree,
      step=6pt, angle=18,
      axiom=+++++SLFFF, order=5}] lindenmayer system -- cycle;
\end{tikzpicture}

% Подпись
\fontsize{48}{64}\selectfont%
Кафедра ИМО

\end{document}
