Copyright | (c) 2014 Christopher Chalmers |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | diagrams-discuss@googlegroups.com |
Safe Haskell | None |
Language | Haskell2010 |
A hbox a primitive Tex box, typically used for holding text and formulas but can hold anything. This module provides functions for retrieving the dimensions of these boxes to give diagrams the correct envelopes.
Synopsis
- data Hbox n = Hbox (Transformation V2 n) String
- hboxOnline :: (TypeableFloat n, Renderable (Hbox n) b) => String -> OnlineTex (QDiagram b V2 n Any)
- hboxSurf :: (TypeableFloat n, Renderable (Hbox n) b) => Surface -> String -> QDiagram b V2 n Any
- hboxSurfIO :: (TypeableFloat n, Renderable (Hbox n) b) => Surface -> String -> IO (QDiagram b V2 n Any)
- hboxPoint :: (OrderedField n, Typeable n, Renderable (Hbox n) b) => String -> QDiagram b V2 n Any
Documentation
Primitive for placing raw Tex commands in a hbox.
Hbox (Transformation V2 n) String |
Instances
Fractional n => Transformable (Hbox n) Source # | |
Defined in Diagrams.Backend.PGF.Hbox | |
Fractional n => Renderable (Hbox n) NullBackend Source # | |
Defined in Diagrams.Backend.PGF.Hbox render :: NullBackend -> Hbox n -> Render NullBackend (V (Hbox n)) (N (Hbox n)) # | |
TypeableFloat n => Renderable (Hbox n) PGF Source # | |
type V (Hbox n) Source # | |
Defined in Diagrams.Backend.PGF.Hbox | |
type N (Hbox n) Source # | |
Defined in Diagrams.Backend.PGF.Hbox |
Enveloped diagrams
The dimensions of a hbox can be recovered by calling Tex. The resulting envelope has its origin at the baseline of the text.
hboxOnline :: (TypeableFloat n, Renderable (Hbox n) b) => String -> OnlineTex (QDiagram b V2 n Any) Source #
Hbox with bounding box envelope.
Non-Online version
These versions bypass OnlineTex
by just running a whole tex
program just to get the size of a single hbox. This is not
recommended but because it is slow, but can be convenient if
you only need one or two hbox sizes.
hboxSurf :: (TypeableFloat n, Renderable (Hbox n) b) => Surface -> String -> QDiagram b V2 n Any Source #
Hbox with bounding box envelope. Note that each box requires a call to
Tex. For multiple boxes consider using hboxOnline
to get multiple boxes
from a single call. (uses unsafePerformIO)
hboxSurfIO :: (TypeableFloat n, Renderable (Hbox n) b) => Surface -> String -> IO (QDiagram b V2 n Any) Source #
Hbox with bounding box envelope. Note that each box requires a call to
Tex. For multiple boxes consider using hboxOnline
to get multiple boxes
from a single call.