-def transform(provider, slug, output_file=None, output_dir=None, make_dir=False, verbose=False, save_tex=None):
- """ produces a PDF file with XeLaTeX
+def load_including_children(wldoc=None, provider=None, uri=None):
+ """ Makes one big xml file with children inserted at end.
+
+ Either wldoc or provider and URI must be provided.
+ """
+
+ if uri and provider:
+ f = provider.by_uri(uri)
+ text = f.read().decode('utf-8')
+ f.close()
+ elif wldoc is not None:
+ text = etree.tostring(wldoc.edoc, encoding=unicode)
+ provider = wldoc.provider
+ else:
+ raise ValueError('Neither a WLDocument, nor provider and URI were provided.')
+
+ text = re.sub(ur"([\u0400-\u04ff]+)", ur"<alien>\1</alien>", text)
+
+ document = WLDocument.from_string(text,
+ parse_dublincore=True, provider=provider)
+ document.swap_endlines()
+
+ for child_uri in document.book_info.parts:
+ child = load_including_children(provider=provider, uri=child_uri)
+ document.edoc.getroot().append(child.edoc.getroot())
+ return document
+
+
+class PDFFormat(Format):
+ """ Base PDF format.
+
+ Available customization:
+ nofootnotes: Doesn't do footnotes.
+ nothemes: Doesn't do themes.
+ defaultleading: Default leading.
+ onehalfleading: Bigger leading.
+ doubleleading: Big leading.
+ nowlfont: Uses standard TeX font instead of JUnicodeWL.