-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.hs
28 lines (24 loc) · 797 Bytes
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Main
(
main
) where
import System.Environment
import Data.String.Utils(join)
import HSH
--a4paper
--scale=0.7
--offset = -2.5cm 5cm
toLaTeX filename = unlines $ pdfString
where pdfString = ["\\documentclass[12pt]{article}",
"\\usepackage{geometry}",
"\\usepackage[final]{pdfpages}",
"\\usepackage[space]{grffile}",
"\\geometry{a4paper}",
"\\begin{document}",
"\\pagestyle{empty}",
"\\includepdf[pages=-,pagecommand={},offset=-2.5cm 5cm,scale=0.7]{" ++ filename ++ "}",
"\\end{document}"]
main = do
args <- getArgs
writeFile "tset.tex" $ toLaTeX $ join " " args
runIO "pdflatex tset.tex"