module Text.LaTeX.Packages.Beamer
(
beamer
, frame
, frametitle
, framesubtitle
, alert
, pause
, block
, OverlaySpec (..)
, beameritem
, uncover
, only
, Theme (..)
, usetheme
) where
import Text.LaTeX.Base.Syntax
import Text.LaTeX.Base.Render
import Text.LaTeX.Base.Types
import Data.String
beamer :: ClassName
beamer = "beamer"
frame :: LaTeX -> LaTeX
frame = TeXEnv "frame" []
frametitle :: LaTeX -> LaTeX
frametitle l = TeXComm "frametitle" [FixArg l]
framesubtitle :: LaTeX -> LaTeX
framesubtitle l = TeXComm "framesubtitle" [FixArg l]
alert :: [OverlaySpec] -> LaTeX -> LaTeX
alert os l = TeXComm "alert" [ MSymArg $ fmap (TeXRaw . render) os, FixArg l]
pause :: LaTeX
pause = TeXComm "pause" []
beameritem :: [OverlaySpec] -> LaTeX
beameritem os = TeXComm "item" [ MSymArg $ fmap (TeXRaw . render) os ]
uncover :: [OverlaySpec] -> LaTeX -> LaTeX
uncover os l = TeXComm "uncover" [ MSymArg $ fmap (TeXRaw . render) os , FixArg l ]
only :: [OverlaySpec] -> LaTeX -> LaTeX
only os l = TeXComm "only" [ MSymArg $ fmap (TeXRaw . render) os , FixArg l ]
data OverlaySpec =
OneSlide Int
| FromSlide Int
| ToSlide Int
| FromToSlide Int Int
deriving Show
instance Render OverlaySpec where
render (OneSlide n) = render n
render (FromSlide n) = render n <> "-"
render (ToSlide n) = "-" <> render n
render (FromToSlide n m) = render n <> "-" <> render m
block :: LaTeX
-> LaTeX
-> LaTeX
block tit = TeXEnv "block" [ FixArg tit ]
data Theme =
AnnArbor
| Antibes
| Bergen
| Berkeley
| Berlin
| Boadilla
| Boxes
| CambridgeUS
| Copenhagen
| Darmstadt
| Default
| Dresden
| Frankfurt
| Goettingen
| Hannover
| Ilmenau
| JuanLesPins
| Luebeck
| Madrid
| Malmoe
| Marburg
| Montpellier
| PaloAlto
| Pittsburgh
| Rochester
| Singapore
| Szeged
| Warsaw
| CustomTheme String
deriving Show
instance Render Theme where
render (CustomTheme str) = fromString str
render x = fromString $ show x
usetheme :: Theme -> LaTeX
usetheme th = TeXComm "usetheme" [ FixArg $ TeXRaw $ render th ]