Safe Haskell | None |
---|
This module defines the syntax of a TikZ script.
To generate a TikZ script, first create a TPath
using
data constructors, or alternatively, use a PathBuilder
from the Text.LaTeX.Packages.TikZ.PathBuilder module.
Once a TPath
is created, use path
to render a picture
from it. Use scope
to apply some parameters to your picture,
such line width or color.
- data TPoint
- pointAt :: Measure -> Measure -> TPoint
- pointAtXY :: Double -> Double -> TPoint
- pointAtXYZ :: Double -> Double -> Double -> TPoint
- relPoint :: TPoint -> TPoint
- relPoint_ :: TPoint -> TPoint
- data TPath
- data GridOption = GridStep Step
- data Step
- startingPoint :: TPath -> TPoint
- lastPoint :: TPath -> TPoint
- (->-) :: TPath -> TPoint -> TPath
- data Parameter
- data TikZColor
- data Color
- data Word8
- data TikZ
- emptytikz :: TikZ
- path :: [ActionType] -> TPath -> TikZ
- scope :: [Parameter] -> TikZ -> TikZ
- data ActionType
- (->>) :: TikZ -> TikZ -> TikZ
- draw :: TPath -> TikZ
- fill :: TPath -> TikZ
- clip :: TPath -> TikZ
- shade :: TPath -> TikZ
- filldraw :: TPath -> TikZ
- shadedraw :: TPath -> TikZ
Points
Paths
Types
Type for TikZ paths. Every TPath
has two fundamental points: the starting point
and the last point.
The starting point is set using the Start
constructor.
The last point then is modified by the other constructors.
Below a explanation of each one of them.
Note that both starting point and last point may coincide.
You can use the functions startingPoint
and lastPoint
to calculate them.
After creating a TPath
, use path
to do something useful with it.
Start TPoint | Let Operation: Set the starting point of a path. Last point: The last point of |
Cycle TPath | Let Operation: Close a path with a line from the last point of Last point: The last point of |
Line TPath TPoint | Let Operation: Extend the current path from the last point of Last point: The last point of |
Rectangle TPath TPoint | Let Operation: Define a rectangle using the last point of
Last point: The last point of |
Circle TPath Double | Let Operation: Define a circle with center at the last point
of x and radius Last point: The last point of |
Ellipse TPath Double Double | Let Operation: Define a ellipse with center at the last
point of Last point: The last point of |
Grid TPath [GridOption] TPoint | |
Node TPath LaTeX | Let Operation: Set a text centered at the last point of Last point: The last point of |
Critical points
startingPoint :: TPath -> TPointSource
Calculate the starting point of a TPath
.
Functions
Parameters
Parameters to use in a scope
to change how things
are rendered within that scope.
Color models accepted by TikZ.
Basic colors.
data Word8
8-bit unsigned integer type
TikZ
path :: [ActionType] -> TPath -> TikZSource
A path can be used in different ways.
-
Draw
: Just draw the path. -
Fill
: Fill the area inside the path. -
Clip
: Clean everything outside the path. -
Shade
: Shade the area inside the path.
It is possible to stack different effects in the list.
Example of usage:
path [Draw] $ Start (pointAtXY 0 0) ->- pointAtXY 1 1
Most common usages are exported as functions. See
draw
, fill
, clip
, shade
, filldraw
and
shadedraw
.
data ActionType Source