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.
- 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 |
Fractional n => Transformable (Hbox n) Source # | |
Fractional n => Renderable (Hbox n) NullBackend Source # | |
TypeableFloat n => Renderable (Hbox n) PGF # | |
type V (Hbox n) Source # | |
type N (Hbox n) Source # | |
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 convientient 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 onlineHbox
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 onlineHbox
to get multiple boxes
from a single call.