minor style fixes to EPUBs
[librarian.git] / librarian / pdf.py
index 20daec8..a5c4253 100644 (file)
@@ -84,7 +84,7 @@ def substitute_hyphens(doc):
     insert_tags(doc,
                 re.compile("(?<=[^-\s])-(?=[^-\s])"),
                 "dywiz",
-                exclude=[DCNS("identifier.url"), DCNS("rights.license")]
+                exclude=[DCNS("identifier.url"), DCNS("rights.license"), "www"]
                 )
 
 
@@ -185,7 +185,7 @@ def package_available(package, args='', verbose=False):
 
 
 def transform(wldoc, verbose=False, save_tex=None, save_texml=None, morefloats=None,
-              cover=None, flags=None, customizations=None, documentclass='wl', resources=None):
+              cover=None, cover_file=None, flags=None, customizations=None, documentclass='wl', resources=None):
     """ produces a PDF file with XeLaTeX
 
     wldoc: a WLDocument
@@ -232,7 +232,7 @@ def transform(wldoc, verbose=False, save_tex=None, save_texml=None, morefloats=N
         if customizations is not None:
             root.set('customizations', u','.join(customizations))
 
-        root.set('documentclass', documentclass)
+        root.set('documentclass', documentclass or 'wl')
 
         # add editors info
         root.set('editors', u', '.join(sorted(
@@ -276,6 +276,7 @@ def transform(wldoc, verbose=False, save_tex=None, save_texml=None, morefloats=N
         shutil.copy(get_resource('pdf/wl.cls'), temp)
         shutil.copy(get_resource('pdf/wlpub.cls'), temp)
         shutil.copy(get_resource('res/wl-logo.png'), temp)
+        shutil.copy(get_resource('res/cover.jpg'), temp)
         if resources:
             copy_tree(resources, temp)
 
@@ -285,6 +286,9 @@ def transform(wldoc, verbose=False, save_tex=None, save_texml=None, morefloats=N
             cwd = None
         os.chdir(temp)
 
+        if resources:
+            os.putenv("TEXINPUTS", "::.:%s" % resources)
+
         if verbose:
             p = call(['xelatex', tex_path])
         else: