Site icon texblog

Tiny leaves for official LaTeX announcements

Seth Godin mentioned in his recent blog post on simple typography that certain fonts remind us of something. I’m not a professional. But for to fun it, I tried to reproduce Seth’s first example using PGF/TikZ.

And here is the result (using LaTeX’s standard font Computer Modern).

Below is the code. Just copy and paste the preamble and officialize pretty much anything!

Preamble

\usepackage{tikz}
\usetikzlibrary{positioning,decorations.markings}

\newcounter{leafs}

\tikzset{%
leaf/.style={/utils/exec=\setcounter{leafs}{0},
	decorate,decoration={
		markings,
		mark=at position 0 with {
			\draw [bend left=35,fill=black] (0,0) to ++(-0.3,0.02*\sign) to ++(0.3,-0.02*\sign);},
		mark=between positions 0.02 and 0.5 step 0.05 with {
			\draw [bend right=35,fill=black] (0.01*\sign,0.01*\sign) to ++(-0.2-\mult,0.3*\sign+\mult*\sign) to ++(0.2+\mult,-0.3*\sign-\mult*\sign);
			\stepcounter{leafs};},
  		mark=between positions 0.54 and 0.99 step 0.04875 with {
			\addtocounter{leafs}{-1}
			\draw [bend left=35,fill=black] (-0.01*\sign,0.01*\sign) to ++(0.2+\mult,0.3*\sign+\mult*\sign) to ++(-0.2-\mult,-0.3*\sign-\mult*\sign);},
	}
}}

\newcommand{\leaves}[1]{%
\setlength{\lineskip}{6pt plus 6pt minus 0pt}\lineskiplimit=\baselineskip
\def\mult{0.03*\theleafs}
\begin{tikzpicture}
	\node [align=center] (box) {\uppercase{#1}};
	\node [below left=of box] (ll) {};
	\node [above left=of box] (ul) {};
	\node [below right=of box] (lr) {};
	\node [above right=of box] (ur) {};
	\def\sign{-1}
	\draw [bend right=45, fill=black,postaction=leaf] (ul) to (ll) to ++(0.1,0.1) to [bend left=45] (ul);
	\def\sign{1}
	\draw [bend left=45, fill=black,postaction=leaf] (ur) to (lr) to ++ (-0.1,0.1) to [bend right=45] (ur);
\end{tikzpicture}
}

 
Document

\leaves{everything looks\\{\Huge official}\\{\tiny with tiny leaves around it}}
Exit mobile version