Safe Haskell | None |
---|
This module exports those minimal things you need to work with HaTeX. Those things are:
- The
LaTeX
datatype. - The
<>
operator, to appendLaTeX
values. - The Text.LaTeX.Base.Render module, to render a
LaTeX
value intoText
. - The Text.LaTeX.Base.Types module, which contains several types used by other modules.
- The Text.LaTeX.Base.Commands module, which exports the LaTeX standard commands and environments.
- The Text.LaTeX.Base.Writer module, to work with the monad interface of the library.
- The Text.LaTeX.Base.Texy module, which exports the
Texy
class. Useful to pretty-print values in LaTeX form.
- data LaTeX
- protectString :: String -> String
- protectText :: Text -> Text
- module Text.LaTeX.Base.Render
- module Text.LaTeX.Base.Types
- module Text.LaTeX.Base.Commands
- module Text.LaTeX.Base.Writer
- module Text.LaTeX.Base.Texy
- class Monoid a where
- (<>) :: Monoid m => m -> m -> m
LaTeX
datatype
Type of LaTeX
blocks.
Eq LaTeX | |
Floating LaTeX | Undefined methods: |
Fractional LaTeX | Division uses the LaTeX |
Num LaTeX | Careful! Method |
Show LaTeX | |
Typeable LaTeX | |
IsString LaTeX | Method |
Arbitrary LaTeX | |
Monoid LaTeX | Method |
LaTeXC LaTeX | This instance just sets |
Render LaTeX | |
Texy LaTeX |
Escaping reserved characters
protectString :: String -> StringSource
Escape LaTeX reserved characters in a String
.
protectText :: Text -> TextSource
Escape LaTeX reserved characters in a Text
.
Internal re-exports
module Text.LaTeX.Base.Render
module Text.LaTeX.Base.Types
module Text.LaTeX.Base.Commands
module Text.LaTeX.Base.Writer
module Text.LaTeX.Base.Texy
Monoids
Since the Monoid
instance is the only way to append LaTeX
values, a re-export of the Monoid
class is given here for convenience.
class Monoid a where
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
mconcat =
foldr
mappend mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Minimal complete definition: mempty
and mappend
.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtype
s and make those instances
of Monoid
, e.g. Sum
and Product
.
mempty :: a
Identity of mappend
mappend :: a -> a -> a
An associative operation
mconcat :: [a] -> a
Fold a list using the monoid.
For most types, the default definition for mconcat
will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
Monoid Ordering | |
Monoid () | |
Monoid All | |
Monoid Any | |
Monoid ByteString | |
Monoid ByteString | |
Monoid Text | |
Monoid Text | |
Monoid LaTeX | Method |
Monoid TeXCheck | |
Monoid [a] | |
Monoid a => Monoid (Dual a) | |
Monoid (Endo a) | |
Num a => Monoid (Sum a) | |
Num a => Monoid (Product a) | |
Monoid (First a) | |
Monoid (Last a) | |
Monoid a => Monoid (Maybe a) | Lift a semigroup into |
Monoid (Seq a) | |
Monoid (Vector a) | |
(Ord a, Bounded a) => Monoid (Min a) | |
(Ord a, Bounded a) => Monoid (Max a) | |
Monoid m => Monoid (WrappedMonoid m) | |
Semigroup a => Monoid (Option a) | |
Monoid (Doc e) | |
Monoid b => Monoid (a -> b) | |
(Monoid a, Monoid b) => Monoid (a, b) | |
(Monad m, ~ * a ()) => Monoid (LaTeXT m a) | |
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) | |
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) | |
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) |