tikz.dev / TikZpingus Manual

The TikZpingus package

Internals

C.6 The Bill

C.6.1 The Code

The bill of the penguin is controlled by one selection. As we always want the coordinates for theoretical bill position (as presented in Section 2.1), the none-version of \pingu@create@selection creates it:

This code, defines three commands: \pingu@bill@select, \pingu@bill@add, \@pingu@drawer@bill@.

Within the initialization of all penguin options, we use these commands:

bill/.code = \pingu@bill@select{#1},
bill above/.is if = @pingu@bill@above,
bill color/.code = \pingu@color{bill}{#1},

With this, the bill has one color to work with: \pingu@color@bill.

C.6.2 Adding new Bills

Now on how to add new bills. While it is possible to use \pingu@bill@add, setting up the “bill” comfort-methods is rather tedious. For this, i created the command \pingu@bill@s…

\pingu@bill@s{⟨name⟩}{⟨bill⟩}

Allows to easily add new bills.

Important:

Your code for the bill must create the coordinate \pingu@name-bill-bottom. This is not checked! It is recommended to use the coordinate \pingu@name-bill for reference.

The macro \pingu@bill@s is defined like this:

\long\def\pingu@bill@s#1#2{%
\pgfqkeys{/pingu}{%
bill #1/.style = {/pingu/bill={#1}, /pingu/bill color={##1}},%
bill #1/.default = pingu@yellow
}%
\pingu@bill@add{#1}{#2}%
}
\pgfqkeys{/pingu}{bill none/.style={/pingu/bill=none}}

As an example, this is the definition of the “normal bill” (/pingu/bill normal) in the code:

\pingu@bill@s{normal}{%
\pingu@block[rounded corners=.1mm]{\pingu@color@bill}
(\pingu@name-bill)++(-.19cm,0) arc (180:360:.19cm and .225cm)
coordinate[pos=.5] (\pingu@name-bill-bottom) -- ++(-.2mm,.05mm)
to[bend right=10] ([xshift=-.17cm,yshift=.05mm]\pingu@name-bill)
-- cycle;
}

As another example, this is the definition of the “flat bill” (/pingu/bill flat):

\pingu@bill@s{flat}{%
\pingu@block{\pingu@color@bill} (\pingu@name-bill)++(-.19cm,0)
arc (180:360:.19cm and .225cm)
coordinate[pos=.5] (\pingu@name-bill-bottom)
-- cycle;
}