3.hs 1011 B

123456789101112131415161718192021222324
  1. {-# LANGUAGE OverloadedStrings #-}
  2. import Data.List
  3. import Util
  4. import Text.LaTeX
  5. import Text.LaTeX.Base.Class
  6. import Text.LaTeX.Base.Syntax
  7. import Text.LaTeX.Packages.Graphicx
  8. import Text.LaTeX.Packages.Geometry
  9. main :: IO ()
  10. main = printdoc doc
  11. doc :: Monad m => LaTeXT_ m
  12. doc = fontsize (rendertex $ Pt 12) (rendertex $ Pt 12) $ do
  13. mapM_ (\(y, t) -> textblock' (vw 0.5) (vh y) $ fromString t) $ zip [0.2, 0.3 .. 0.9] ["we move on", "but our", "echoes", "remain", "", "off the walls", "as we fade out", "together"]
  14. textblock' (vw 0.1) (vh 0.6) $ fromString $ rt 48 "reverberating"
  15. mapM_ (\x -> fontsize (rendertex $ Pt 12) (vw 0) $ textblock' (vw x) (vh $ x / 2) $ rotatebox' 90 $ fromString $ rt 23 "echoes") [0.6, 0.6125 .. 1.0]
  16. rt n s = foldr (++) "" $ intersperse " " $ replicate n s
  17. x :: LaTeXC l => Double -> Double -> l
  18. x r t = textblock' (vw $ 0.5 + (cos t) * r) (vw $ sqrt 2 / 2 + (sin t) * r) $ rotatebox' (t * (-180) / pi - 90) $ fontsize (vw $ r * 0.20) (vw $ r * 0.25) "shadows"