module Text.LaTeX.Base.Texy (
Texy (..)
) where
import Text.LaTeX.Base.Syntax
import Text.LaTeX.Base.Class
import Text.LaTeX.Base.Render
import Numeric
import Data.Fixed
class Texy t where
texy :: LaTeXC l => t -> l
instance Texy LaTeX where
texy = fromLaTeX
instance Texy Text where
texy = fromLaTeX . TeXRaw . protectText
instance Texy Int where
texy = rendertex
instance Texy Integer where
texy = rendertex
instance Texy Float where
texy x = fromString $ showFFloat Nothing x ""
instance Texy Double where
texy x = fromString $ showFFloat Nothing x ""
instance Texy Char where
texy c = fromString ['`' , c , '`']
instance HasResolution a => Texy (Fixed a) where
texy = fromString . show
instance Texy Bool where
texy = fromString . show
instance Texy Measure where
texy = rendertex