X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/7475946199e7c363fcf125c5b26be173cd4010f3..f364038620aeb73b553191696c561107906d9f79:/librarian/pdf.py?ds=inline diff --git a/librarian/pdf.py b/librarian/pdf.py index 20daec8..a5c4253 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -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: