Skip to content

Instantly share code, notes, and snippets.

@passy
Last active August 29, 2015 14:05
Show Gist options
  • Save passy/2d6f2e7bf37f01358ae2 to your computer and use it in GitHub Desktop.
Save passy/2d6f2e7bf37f01358ae2 to your computer and use it in GitHub Desktop.
{-# 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