Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Text.LaTeX.Base.Render
Description
- data Text :: *
- module Data.String
- class Show a => Render a where
- renderAppend :: Render a => [a] -> Text
- renderChars :: Render a => Char -> [a] -> Text
- renderCommas :: Render a => [a] -> Text
- renderFile :: Render a => FilePath -> a -> IO ()
- rendertex :: (Render a, LaTeXC l) => a -> l
- readFileTex :: FilePath -> IO Text
- showFloat :: RealFloat a => a -> String
Re-exports
A space efficient, packed, unboxed Unicode text type.
module Data.String
Render class
class Show a => Render a where #
Class of values that can be transformed to Text
.
You mainly will use this to obtain the Text
output
of a LaTeX
value. If you are going to write the result
in a file, consider to use renderFile
.
Consider also to use rendertex
to get Render
able values
into LaTeX
blocks.
If you want to make a type instance of Render
and you already
have a Show
instance, you can use the default instance.
render = fromString . show
Instances
Render Bool # |
|
Render Double # | |
Render Float # | |
Render Int # | |
Render Integer # | |
Render Word8 # | |
Render Text # | This instance escapes LaTeX reserved characters. |
Render TeXArg # | |
Render LaTeX # | |
Render Measure # | |
Render TableSpec # | |
Render HPos # | |
Render Pos # | |
Render Label # | |
Render PaperType # | |
Render ClassOption # | |
Render TheoremStyle # | |
Render Language # | |
Render Theme # | |
Render CoverOption # | |
Render OverlaySpec # | |
Render ColorName # | |
Render ColorModel # | |
Render Color # | |
Render ColSpec # | |
Render FontEnc # | |
Render GeometryOption # | |
Render IGOption # | |
Render URL # | |
Render HRefOption # | |
Render ActionType # | |
Render TikZ # | |
Render Parameter # | |
Render TikZColor # | |
Render Step # | |
Render GridOption # | |
Render TPath # | |
Render TPoint # | |
Render a => Render [a] # | |
renderAppend :: Render a => [a] -> Text #
Render every element of a list and append results.
renderChars :: Render a => Char -> [a] -> Text #
Render every element of a list and append results,
separated by the given Char
.
renderCommas :: Render a => [a] -> Text #
Render every element of a list and append results, separated by commas.
renderFile :: Render a => FilePath -> a -> IO () #
rendertex :: (Render a, LaTeXC l) => a -> l #
If you can transform a value to Text
, you can
insert that Text
in your LaTeX
code.
That is what this function does.
Warning: rendertex
does not escape LaTeX reserved characters.
Use protectText
to escape them.
Reading files
readFileTex :: FilePath -> IO Text #
If you are going to insert the content of a file
in your LaTeX
data, use this function to ensure
your encoding is correct.