module Text.LaTeX.Base.Types (
ClassName
, PackageName
, PageStyle
, Label
, createLabel , labelName
, Pos (..) , HPos (..)
, TableSpec (..)
, Measure (..)
) where
import Text.LaTeX.Base.Syntax
import Text.LaTeX.Base.Render
type ClassName = String
type PackageName = String
type PageStyle = String
newtype Label = Label String deriving (Eq, Show)
createLabel :: String -> Label
createLabel = Label
labelName :: Label -> String
labelName (Label str) = str
instance Render Label where
render (Label str) = fromString str
instance IsString Label where
fromString = createLabel
data Pos = Bottom | Center | Top deriving Show
instance Render Pos where
render Bottom = "b"
render Center = "c"
render Top = "t"
data HPos = HLeft | HCenter | HRight deriving Show
instance Render HPos where
render HLeft = "l"
render HCenter = "c"
render HRight = "r"
data TableSpec =
LeftColumn
| CenterColumn
| RightColumn
| ParColumnTop LaTeX
| ParColumnMid LaTeX
| ParColumnBot LaTeX
| NameColumn String
| BeforeColumn LaTeX
| AfterColumn LaTeX
| VerticalLine
| DVerticalLine
| Separator LaTeX
deriving Show
instance Render TableSpec where
render LeftColumn = "l"
render CenterColumn = "c"
render RightColumn = "r"
render (ParColumnTop l) = "p" <> render (FixArg l)
render (ParColumnMid l) = "m" <> render (FixArg l)
render (ParColumnBot l) = "b" <> render (FixArg l)
render (NameColumn n) = fromString n
render (BeforeColumn l) = ">{" <> render l <> "}"
render (AfterColumn l) = "<{" <> render l <> "}"
render VerticalLine = "|"
render DVerticalLine = "||"
render (Separator l) = "@" <> render (FixArg l)