]> git.scottworley.com Git - paperdoorknob/blobdiff - paperdoorknob.py
Specify page geometry
[paperdoorknob] / paperdoorknob.py
index 2bcf31afe3c1b38407eec51f79babed956847fc9..26eb7be054a823b6183bea6dff3415dfef713a6a 100644 (file)
@@ -37,7 +37,12 @@ def replies(html: BeautifulSoup) -> Iterable[Tag]:
 
 
 def process(spec: Spec) -> None:
-    spec.texout.write(b'\\documentclass{article}\n\\begin{document}\n')
+    spec.texout.write(b'\\documentclass{article}\n')
+    if spec.geometry is not None:
+        spec.texout.write(b'\\usepackage[' +
+                          spec.geometry.encode('UTF-8') +
+                          b']{geometry}\n')
+    spec.texout.write(b'\\begin{document}\n')
     html = parse(spec.htmlfilter(spec.fetcher.fetch(spec.url)))
     for r in replies(html):
         spec.domfilter(r)