| Copyright | Anthony Wang 2021 |
|---|---|
| License | MIT |
| Maintainer | anthony.y.wang.math@gmail.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
TikzObjects
Description
TikzObjects defines data structures to represent
objects such as coordinates and paths.
See the tikzpgf manual for more details.
Synopsis
- class ShowLatex a where
- data TikzCoordinate
- = Canvas { }
- | NamedCoordinate {
- coord_name :: !String
- data TikzPathOperation
- = PathOpMoveTo { }
- | PathOpLineTo { }
- | PathOpVertHorz { }
- | PathOpHorzVert { }
- | PathOpCurveToOneControl { }
- | PathOpCurveToTwoControls { }
- | PathOpOption { }
- | PathOpScopedOption { }
- | PathOpCycle
- | PathOpRectangle { }
- | PathOpNode { }
- | PathOpCoordinate { }
- | PathOpRelativeNode { }
- toNamedCoord :: TikzPathOperation -> Maybe TikzCoordinate
- type TikzPath = [TikzPathOperation]
- partialShowLatex :: TikzPath -> String
Documentation
class ShowLatex a where Source #
A class for data structures which can be converted into LaTeX code.
Instances
| ShowLatex TikzPath Source # | |
| ShowLatex TikzPathOperation Source # | |
Defined in TikzObjects Methods showLatex :: TikzPathOperation -> String Source # | |
| ShowLatex TikzCoordinate Source # | |
Defined in TikzObjects Methods showLatex :: TikzCoordinate -> String Source # | |
| ShowLatex TikzStringDiagram Source # | |
Defined in TikzStringDiagram Methods showLatex :: TikzStringDiagram -> String Source # | |
data TikzCoordinate Source #
Data structure representing points on a 2 dimensional TikZ canvas.
Constructors
| Canvas | Specifies a point by its coordinates |
| NamedCoordinate | Specifies a coordinate by a name. A node or coordinate path operation can create a new named coordinate. |
Fields
| |
Instances
| Show TikzCoordinate Source # | |
Defined in TikzObjects Methods showsPrec :: Int -> TikzCoordinate -> ShowS # show :: TikzCoordinate -> String # showList :: [TikzCoordinate] -> ShowS # | |
| ShowLatex TikzCoordinate Source # | |
Defined in TikzObjects Methods showLatex :: TikzCoordinate -> String Source # | |
data TikzPathOperation Source #
A data structure for specifying path operations, which are chained to create paths. See the tikz manual for details on these operations.
Constructors
| PathOpMoveTo | |
Fields | |
| PathOpLineTo | |
Fields | |
| PathOpVertHorz | |
Fields | |
| PathOpHorzVert | |
Fields | |
| PathOpCurveToOneControl | |
| PathOpCurveToTwoControls | |
| PathOpOption | |
Fields | |
| PathOpScopedOption | |
Fields | |
| PathOpCycle | |
| PathOpRectangle | |
Fields | |
| PathOpNode | |
Fields | |
| PathOpCoordinate | |
Fields | |
| PathOpRelativeNode | |
Fields | |
Instances
| Show TikzPathOperation Source # | |
Defined in TikzObjects Methods showsPrec :: Int -> TikzPathOperation -> ShowS # show :: TikzPathOperation -> String # showList :: [TikzPathOperation] -> ShowS # | |
| ShowLatex TikzPath Source # | |
| ShowLatex TikzPathOperation Source # | |
Defined in TikzObjects Methods showLatex :: TikzPathOperation -> String Source # | |
toNamedCoord :: TikzPathOperation -> Maybe TikzCoordinate Source #
If a path operation has a name, it defines a NamedCoordinate.
toNamedCoord of a path operation returns Just this named coordinate for operations with names, otherwise
it returns Nothing.
type TikzPath = [TikzPathOperation] Source #
A TikzPath is made by sequencing TikzPathOperations.
partialShowLatex :: TikzPath -> String Source #
A helper function used to define showLatex of a TikzPath.