From 04ea404d7cf94043dacf95ac1433d8b894b8cdfd Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 31 Jan 2012 14:52:25 +0100 Subject: [PATCH] images in html, pdf --- librarian/pdf.py | 3 +++ librarian/pdf/wl.cls | 8 ++++++++ librarian/pdf/wl2tex.xslt | 10 ++++++++++ librarian/xslt/book2html.xslt | 16 ++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/librarian/pdf.py b/librarian/pdf.py index 077a1e1..ace83af 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -235,6 +235,9 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, with open(os.path.join(temp, 'cover.png'), 'w') as f: c.save(f) + for img in document.edoc.findall('//ilustr'): + shutil.copy(img.get('src'), temp) + del document # no longer needed large object :) tex_path = os.path.join(temp, 'doc.tex') diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls index 08737f7..80a6bb5 100644 --- a/librarian/pdf/wl.cls +++ b/librarian/pdf/wl.cls @@ -512,3 +512,11 @@ Letters={Uppercase} \fi } +\newcommand{\ilustr}[2]{ + +\vspace{1em}% +\begin{center}% +\par{\includegraphics{#1}\\#2}% +\end{center}% +\vspace{1em}% +} diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index a2c592e..c23a045 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -348,6 +348,16 @@ + + + + + + + + + + diff --git a/librarian/xslt/book2html.xslt b/librarian/xslt/book2html.xslt index 10da3ec..b018405 100755 --- a/librarian/xslt/book2html.xslt +++ b/librarian/xslt/book2html.xslt @@ -648,6 +648,22 @@
+ +
+ ilustracja + + + + + + + + + + +
+
+ -- 2.20.1