module Text.LaTeX.Base
(
LaTeX
, protectString , protectText
, module Text.LaTeX.Base.Render
, module Text.LaTeX.Base.Types
, module Text.LaTeX.Base.Commands
, module Text.LaTeX.Base.Writer
, module Data.Monoid
#if __GLASGOW_HASKELL__ < 704
, (<>)
#endif
) where
import Text.LaTeX.Base.Syntax (LaTeX (..), TeXArg (..),(<>),protectString,protectText)
import Text.LaTeX.Base.Class
import Text.LaTeX.Base.Render
import Text.LaTeX.Base.Types
import Text.LaTeX.Base.Commands
import Text.LaTeX.Base.Writer
import Data.Monoid
instance Num LaTeX where
(+) = TeXOp "+"
() = TeXOp "-"
(*) = (<>)
negate = (TeXEmpty )
fromInteger = rendertex
abs x = between x "|" "|"
signum _ = error "Cannot use \"signum\" Num method with a LaTeX value."
instance Fractional LaTeX where
p / q = TeXComm "frac" [FixArg p, FixArg q]
fromRational = rendertex . (fromRational :: Rational -> Float)
instance Monad m => Eq (LaTeXT m a) where
_ == _ = error "Cannot use \"(==)\" Eq method with a LaTeXT value."
instance Monad m => Show (LaTeXT m a) where
show _ = error "Cannot use \"show\" Show method with a LaTeXT value."
instance Monad m => Num (LaTeXT m a) where
(+) = liftOp (+)
() = liftOp ()
(*) = (>>)
negate = (mempty )
fromInteger = fromLaTeX . fromInteger
abs = liftL abs
signum _ = error "Cannot use \"signum\" Num method with a LaTeXT value."
instance Monad m => Fractional (LaTeXT m a) where
(/) = liftOp (/)
fromRational = fromLaTeX . fromRational