Last active
August 29, 2015 14:05
-
-
Save passy/2d6f2e7bf37f01358ae2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Text.LaTeX | |
main :: IO () | |
main = | |
execLaTeXT simple >>= renderFile "yo.tex" | |
-- Execute pdflatex | |
simple :: Monad m => LaTeXT_ m | |
simple = do | |
thePreamble | |
document theBody | |
thePreamble :: Monad m => LaTeXT_ m | |
thePreamble = do | |
-- TODO: Use the preview class as described here: | |
-- https://tex.stackexchange.com/questions/11866/compile-a-latex-document-into-a-png-image-thats-as-short-as-possible | |
documentclass [] article | |
author "Tweet HaTeX" | |
title "HaTeX" | |
theBody :: Monad m => LaTeXT_ m | |
theBody = do | |
maketitle | |
section "Hello there" | |
"This is me checking out " | |
hatex | |
"So far it's fair to say that this is " | |
textbf "Fucking awesome!" | |
textbf (large "Hi Stephen!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment