1
% \iffalse meta-comment
6
----------------------------------------------------------------
7
lunatikz --- Functions for crazy lettering with TikZ
8
E-mail: stacey@math.ntnu.no
9
Released under the LaTeX Project Public License v1.3c or later
10
See http://www.latex-project.org/lppl.txt
11
----------------------------------------------------------------
13
This package defines some functions used to manipulate PGFs soft paths.
17
\def\nameofplainTeX{plain}
18
\ifx\fmtname\nameofplainTeX\else
19
\expandafter\begingroup
27
----------------------------------------------------------------
28
lunatikz --- Functions for crazy lettering with TikZ
29
E-mail: stacey@math.ntnu.no
30
Released under the LaTeX Project Public License v1.3c or later
31
See http://www.latex-project.org/lppl.txt
32
----------------------------------------------------------------
37
Copyright (C) 2011 by Andrew Stacey <stacey@math.ntnu.no>
39
This work may be distributed and/or modified under the
40
conditions of the LaTeX Project Public License (LPPL), either
41
version 1.3c of this license or (at your option) any later
42
version. The latest version of this license is in the file:
44
http://www.latex-project.org/lppl.txt
46
This work is "maintained" (as per LPPL maintenance status) by
49
This work consists of the file lunatikz.dtx
50
and the derived files lunatikz.ins,
55
\usedir{tex/latex/lunatikz}
57
\file{\jobname.sty}{\from{\jobname.dtx}{package}}
60
%<install>\endbatchfile
62
\usedir{source/latex/lunatiz}
64
\file{\jobname.ins}{\from{\jobname.dtx}{install}}
66
\nopreamble\nopostamble
67
\usedir{doc/latex/demopkg}
69
\file{README.txt}{\from{\jobname.dtx}{readme}}
71
\ifx\fmtname\nameofplainTeX
72
\expandafter\endbatchfile
78
\NeedsTeXFormat{LaTeX2e}
79
\ProvidesPackage{lunatikz}[2011/06/03 v1.0 Functions for manipulating PGF soft paths]
82
\documentclass{ltxdoc}
83
\usepackage[T1]{fontenc}
85
%\usepackage{morefloats}
88
\usepackage[numbered]{hypdoc}
89
\definecolor{lstbgcolor}{rgb}{0.9,0.9,0.9}
92
\lstloadlanguages{[LaTeX]TeX}
93
\lstset{breakatwhitespace=true,breaklines=true,language=TeX}
97
\newenvironment{example}
99
\begin{VerbatimOut}[gobble=2]{example.out}}
102
% \setlength{\parindent}{0pt}
103
\fbox{\begin{minipage}{.9\linewidth}
104
\lstset{breakatwhitespace=true,breaklines=true,language=TeX,basicstyle=\small}
105
\lstinputlisting[]{example.out}
108
\fbox{\begin{minipage}{.9\linewidth}
117
\DocInput{\jobname.dtx}
124
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
125
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
126
% Digits \0\1\2\3\4\5\6\7\8\9
127
% Exclamation \! Double quote \" Hash (number) \#
128
% Dollar \$ Percent \% Ampersand \&
129
% Acute accent \' Left paren \( Right paren \)
130
% Asterisk \* Plus \+ Comma \,
131
% Minus \- Point \. Solidus \/
132
% Colon \: Semicolon \; Less than \<
133
% Equals \= Greater than \> Question mark \?
134
% Commercial at \@ Left bracket \[ Backslash \\
135
% Right bracket \] Circumflex \^ Underscore \_
136
% Grave accent \` Left brace \{ Vertical bar \|
137
% Right brace \} Tilde \~}
140
% \changes{1.0}{2011/05/03}{Converted to DTX file}
142
% \DoNotIndex{\newcommand,\newenvironment}
144
% \providecommand*{\url}{\texttt}
145
% \GetFileInfo{lunatikz.sty}
146
% \title{The \textsf{lunatikz} package}
147
% \author{Andrew Stacey \\ \url{stacey@math.ntnu.no}}
148
% \date{\fileversion~from \filedate}
154
% \section{Introduction}
158
% \section{Implementation}
166
random rotation/.code={%
167
\pgfmathsetmacro{\rnd@rot}{#1*rand}%
168
\tikzset{rotate=\rnd@rot}%
170
random offset/.code={%
171
\tikz@scan@one@point\pgfutil@firstofone#1\relax
172
\pgfmathsetmacro{\rnd@x}{\pgf@x*rand}%
173
\pgfmathsetmacro{\rnd@y}{\pgf@y*rand}%
174
\tikzset{shift={(\rnd@x pt,\rnd@y pt)}}%
183
amplitude=\letter@madman*2.5pt,
184
segment length=\letter@madman*10pt + 2pt
186
random rotation=\letter@madman*10,
187
random offset={(.1*\letter@madman*\letter@size,.2*\letter@madman*\letter@size)},
190
letter/sentence width=\textwidth,
191
letter/line height=1.2,
193
madman quotient/.store in=\letter@madman,