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}}
Dror
Very nice result!!!
tom
Thanks! Tom.
Nando Cozzi (@NandoCozzi)
Really, very very nice. Thanks for sharing.
tom
Thanks for the nice words! Tom.
Desmond
That is brilliant!
Is it possible to scale the size of the whole object?
tom
Hi Desmond,
That’s a legitimate question, thanks!
To scale the complete object, say to include it in another document, I suggest using the
standalone
document class and thengraphicx
to load it. PDFs are vector graphics and therefore perfectly scalable.Scaling the leaves only (e.g. make them smaller and closer to the text) is a completely different question. Here is one possible way to do that by altering TiKZ units/constants:
HTH,
Tom
Desmond
Hello Tom,
Thanks for the prompt reply! I will certainly test it out!
-Desmond
tom
Great, let me know if you encounter any problem. Tom
boudiccas
I’m trying to use it to do a titlepage, and its working well, except it will insist in putting todays date above the graphics. How do I stop that please?
tom
Great! I assume you are using
maketitle
. To omit the date, just leave it blank. Best, Tom.boudiccas
I’ve tried what you suggested but its still showing me todays date above the graphics, this is the relevant section of my foo.tex header code
Nowhere do I define author, title, date except in the \leaves line, so where is it picking the date from, because “date” is not mentioned at all in the header code or anywhere else when it come to that!
tom
A few things:
\maketitle
. Omit the date using\date{}
.\title
in your preamble. I get an error when using\maketitle
without a\title
definition.\leaves
, I don’t see why you’d need\maketitle
, just remove it which should resolve the problem.\leaves
(and \maketitle) go after\begin{document}
, it’s part of the content.HTH, Tom
boudiccas
That’s sorted the date thanks, but now \fancyhdr has put a horizontal line above the graphics, so how do I get it not on the cover [page 1], but on every other page please?
boudiccas
Sorted, thanks very much for your help 🙂
tom
Brilliant, thanks for the feedback. Tom