From: Marcin Koziej Date: Mon, 3 Feb 2014 14:06:46 +0000 (+0100) Subject: merge conflicting on stripping spaces X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/refs/heads/publication?hp=af22d85a680618fd3223846073db60d077834021 merge conflicting on stripping spaces --- diff --git a/librarian/epub.py b/librarian/epub.py index 8dc11c7..de136ea 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -330,6 +330,12 @@ def transform_chunk(chunk_xml, chunk_no, annotations, empty=False, _empty_html_s return output_html, toc, chars +def flatten_image_paths(wldoc): + root = wldoc.edoc.getroot() + for node in root.findall(".//ilustr"): + node.attrib['src'] = os.path.basename(node.attrib['src']) + return wldoc + def render_latex(wldoc, prefix="latex"): """ Renders CODE as images and returns @@ -398,6 +404,8 @@ def transform(wldoc, verbose=False, if main_text.tag == RDFNS('RDF'): main_text = None + flatten_image_paths(wldoc) + if main_text is not None: for chunk_xml in chop(main_text): empty = False diff --git a/librarian/epub/style.css b/librarian/epub/style.css index d3ca5b6..f279ca8 100644 --- a/librarian/epub/style.css +++ b/librarian/epub/style.css @@ -379,5 +379,10 @@ img.latex { display: block; width: 50%; float: right; + clear: both; + margin: 10pt; + padding: 0pt 5pt; background-color: #d0d0d0; + font-style: italic; + font-size: 0.8em; } \ No newline at end of file diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl index f273c4b..7ec1f8b 100644 --- a/librarian/epub/xsltScheme.xsl +++ b/librarian/epub/xsltScheme.xsl @@ -122,7 +122,7 @@ - +

@@ -148,7 +148,7 @@
- +
@@ -380,6 +380,7 @@ . + diff --git a/librarian/pdf.py b/librarian/pdf.py index ead91be..a5c4253 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -286,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: diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index 635029b..fd14d5c 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -331,7 +331,8 @@ - + +