}
def __init__(self, book_info):
- self.author = ", ".join(auth.readable() for auth in book_info.authors)
+ #self.author = ", ".join(auth.readable() for auth in book_info.authors)
self.title = book_info.title
def pretty_author(self):
super(WLCover, self).__init__(book_info)
self.kind = book_info.kind
self.epoch = book_info.epoch
+ print book_info.cover_url
if book_info.cover_url:
from urllib2 import urlopen
from StringIO import StringIO
logo_bottom = 25
logo_width = 250
format = 'PNG'
+
+class ImageCover(WLCover):
+ format = 'JPEG'
+ def __init__(self, *args, **kwargs):
+ super(ImageCover, self).__init__(*args, **kwargs)
+ self.im = Image.open(self.background_img)
+ self.width, self.height = self.im.size
+
+ def image(self):
+ return self.im
__metaclass__ = DCInfo
FIELDS = (
- Field( DCNS('creator'), 'authors', as_person, salias='author', multiple=True),
+ Field( DCNS('creator'), 'authors', as_person, salias='author', multiple=True, required=False),
Field( DCNS('title'), 'title'),
Field( DCNS('type'), 'type', required=False, multiple=True),
Field( DCNS('source'), 'source_name', required=False),
Field( DCNS('source.URL'), 'source_url', required=False),
- Field( DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict),
+ Field( DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict, required=False),
Field( DCNS('rights.license'), 'license', required=False),
Field( DCNS('rights'), 'license_description'),
)
from shutil import rmtree
from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, OutputFile
-from librarian.cover import WLCover
+from librarian.cover import ImageCover as WLCover
from librarian import functions, get_resource
return text.replace(u"\ufeff", u"")\
.replace("---", u"\u2014")\
.replace("--", u"\u2013")\
- .replace(",,", u"\u201E")\
+ .replace(",,", u"“")\
.replace('"', u"\u201D")\
.replace("'", u"\u2019")
if node.tag in ('uwaga', 'extra'):
last_node_part = False
for one_part in main_text:
name = one_part.tag
- if name == 'naglowek_czesc':
- yield part_xml
- last_node_part = True
- main_xml_part[:] = [deepcopy(one_part)]
- elif not last_node_part and name in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"):
- yield part_xml
- main_xml_part[:] = [deepcopy(one_part)]
- else:
+ #if name == 'naglowek_czesc':
+ # yield part_xml
+ # last_node_part = True
+ # main_xml_part[:] = [deepcopy(one_part)]
+ #elif not last_node_part and name in ("naglowek_rozdzial", "naglowek_akt", "srodtytul"):
+ # yield part_xml
+ # main_xml_part[:] = [deepcopy(one_part)]
+ #else:
+ if True:
main_xml_part.append(deepcopy(one_part))
last_node_part = False
yield part_xml
""" transforms one chunk, returns a HTML string, a TOC object and a set of used characters """
toc = TOC()
- for element in chunk_xml[0]:
- if element.tag in ("naglowek_czesc", "naglowek_rozdzial", "naglowek_akt", "srodtytul"):
- toc.add(node_name(element), "part%d.html" % chunk_no)
- elif element.tag in ('naglowek_podrozdzial', 'naglowek_scena'):
- subnumber = toc.add(node_name(element), "part%d.html" % chunk_no, level=1, is_part=False)
- element.set('sub', str(subnumber))
+ #for element in chunk_xml[0]:
+ # if element.tag in ("naglowek_czesc", "naglowek_rozdzial", "naglowek_akt", "srodtytul"):
+ # toc.add(node_name(element), "part%d.html" % chunk_no)
+ # elif element.tag in ('naglowek_podrozdzial', 'naglowek_scena'):
+ # subnumber = toc.add(node_name(element), "part%d.html" % chunk_no, level=1, is_part=False)
+ # element.set('sub', str(subnumber))
if empty:
if not _empty_html_static:
_empty_html_static.append(open(get_resource('epub/emptyChunk.html')).read())
chars = set()
output_html = _empty_html_static[0]
else:
- find_annotations(annotations, chunk_xml, chunk_no)
- replace_by_verse(chunk_xml)
- html_tree = xslt(chunk_xml, get_resource('epub/xsltScheme.xsl'))
+ if chunk_no == 1:
+ html_tree = xslt(chunk_xml, get_resource('epub/xsltScheme-FoC.xsl'))
+ else:
+ find_annotations(annotations, chunk_xml, chunk_no)
+ replace_by_verse(chunk_xml)
+ html_tree = xslt(chunk_xml, get_resource('epub/xsltScheme.xsl'))
chars = used_chars(html_tree.getroot())
output_html = etree.tostring(html_tree, method="html", pretty_print=True)
return output_html, toc, chars
# every input file will have a TOC entry,
# pointing to starting chunk
- toc = TOC(wldoc.book_info.title, "part%d.html" % chunk_counter)
+
+ # hack for FoC:
+ if wldoc.book_info.author is not None:
+ toc_title = "%s, %s" % (wldoc.book_info.author.readable(), wldoc.book_info.title)
+ note = wldoc.edoc.find('//dzielo_nadrzedne')
+ if note is not None:
+ toc_title += " (%s)" % note.text
+ else:
+ toc_title = wldoc.book_info.title
+ toc = TOC(toc_title, "part%d.html" % chunk_counter)
chars = set()
if first:
# write book title page
zip.writestr('OPS/title.html',
etree.tostring(html_tree, method="html", pretty_print=True))
# add a title page TOC entry
- toc.add(u"Strona tytułowa", "title.html")
+ toc.add(u"Title page", "title.html")
+ toc.add(u"Dear readers!", "part1.html")
elif wldoc.book_info.parts:
# write title page for every parent
if sample is not None and sample <= 0:
'<rootfiles><rootfile full-path="OPS/content.opf" ' \
'media-type="application/oebps-package+xml" />' \
'</rootfiles></container>')
- zip.write(get_resource('res/wl-logo-small.png'), os.path.join('OPS', 'logo_wolnelektury.png'))
- zip.write(get_resource('res/jedenprocent.png'), os.path.join('OPS', 'jedenprocent.png'))
+ #zip.write(get_resource('res/wl-logo-small.png'), os.path.join('OPS', 'logo_wolnelektury.png'))
+ #zip.write(get_resource('res/jedenprocent.png'), os.path.join('OPS', 'jedenprocent.png'))
+ zip.write('logo.png', os.path.join('OPS', 'logo.png'))
if not style:
style = get_resource('epub/style.css')
zip.write(style, os.path.join('OPS', 'style.css'))
cover_file = StringIO()
c = cover(document.book_info)
+ import Image
+ c.im = Image.open('cover.jpg')
+ c.ext = lambda: 'jpg'
c.save(cover_file)
c_name = 'cover.%s' % c.ext()
zip.writestr(os.path.join('OPS', c_name), cover_file.getvalue())
'<item id="html_toc" href="toc.html" media-type="application/xhtml+xml" />'))
spine.append(etree.fromstring(
'<itemref idref="html_toc" />'))
- guide.append(etree.fromstring('<reference href="toc.html" type="toc" title="Spis treści"/>'))
+ guide.append(etree.fromstring('<reference href="toc.html" type="toc" title="Table of Contents"/>'))
toc, chunk_counter, chars, sample = transform_file(document, sample=sample)
zip.writestr('OPS/annotations.html', etree.tostring(
html_tree, method="html", pretty_print=True))
- toc.add("Strona redakcyjna", "last.html")
+ toc.add("Editorial page", "last.html")
manifest.append(etree.fromstring(
'<item id="last" href="last.html" media-type="application/xhtml+xml" />'))
spine.append(etree.fromstring(
# write TOC
if html_toc:
- toc.add(u"Spis treści", "toc.html", index=1)
+ toc.add(u"Table of Contents", "toc.html", index=1)
zip.writestr('OPS/toc.html', toc.html().encode('utf-8'))
toc.write_to_xml(nav_map)
zip.writestr('OPS/toc.ncx', etree.tostring(toc_file, pretty_print=True))
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
- <title>Okładka</title>
+ <title>Cover</title>
<style type="text/css"> img { max-width: 100%; } </style>
</head>
<body style="oeb-column-number: 1;">
<div id="cover-image">
- <img alt="Okładka" />
+ <img alt="Cover" />
</div>
</body>
</html>
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
- <title>WolneLektury.pl</title>
+ <title>Future of Copyright</title>
</head>
<body>
- <h1>Spis treści</h1>
+ <h1>Table of Contents</h1>
%s
</body>
</html>
<body>
<div id="book-text" xmlns="http://www.w3.org/1999/xhtml">
<div class='title-page'>
- <xsl:apply-templates select="//dc:title" mode="poczatek"/>
+ <xsl:apply-templates select="//dzielo_nadrzedne" mode="poczatek"/>
+ <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//nazwa_utworu" mode="poczatek"/>
+ <!--xsl:apply-templates select="//dc:title" mode="poczatek"/-->
</div>
</div>
</body>
</h1>
</xsl:template>
+ <xsl:template match="autor_utworu" mode="poczatek">
+ <h2 class="author" >
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="dzielo_nadrzedne" mode="poczatek">
+ <h2 class="collection" >
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="nazwa_utworu" mode="poczatek" >
+ <h1 class="title" >
+ <xsl:apply-templates />
+ </h1>
+ </xsl:template>
+
+
+
</xsl:stylesheet>
<dc:subject>
<xsl:apply-templates select="//dc:identifier.url" />
</dc:subject>
- <dc:creator>
+ <!--dc:creator>
<xsl:apply-templates select="//dc:creator" />
- </dc:creator>
+ </dc:creator-->
<dc:publisher>
<xsl:apply-templates select="//dc:publisher" />
</dc:publisher>
</dc:date>
</metadata>
<manifest>
+ <item id="logo" href="logo.png" media-type="image/png" />
<item id="toc" href="toc.ncx" media-type="application/x-dtbncx+xml" />
<item id="style" href="style.css" media-type="text/css" />
<item id="titlePage" href="title.html" media-type="application/xhtml+xml" />
- <item id="logo_wolnelektury" href="logo_wolnelektury.png" media-type="image/png" />
- <item id="jedenprocent" href="jedenprocent.png" media-type="image/png" />
</manifest>
<spine toc="toc">
<itemref idref="titlePage" />
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>
- <xsl:text>Strona redakcyjna</xsl:text>
+ <xsl:text>Editorial page</xsl:text>
</title>
</head>
<body>
<p class="info">
<xsl:choose>
<xsl:when test="//dc:rights.license">
- Ten utwór jest udostepniony na licencji
+ This book is available under the terms of
<a>
<xsl:attribute name="href">
<xsl:value-of select="//dc:rights.license" />
</xsl:attribute>
<xsl:value-of select="//dc:rights" />
- </a>
+ </a>.
</xsl:when>
<xsl:otherwise>
Ten utwór nie jest chroniony prawem autorskim i znajduje się w domenie
</xsl:choose>
</p>
- <p class="info">Źródło: <a>
- <xsl:attribute name="href">
- <xsl:value-of select="//dc:identifier.url" />
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:value-of select="wl:person_name(//dc:creator/text())" />, <xsl:value-of select="//dc:title" />
- </xsl:attribute>
- <xsl:value-of select="//dc:identifier.url" />
- </a></p>
-
- <xsl:if test="//dc:source" >
- <p class="info">Tekst opracowany na podstawie: <xsl:value-of select="//dc:source" /></p>
- </xsl:if>
-
- <xsl:if test="//dc:description" >
- <p class="info"><xsl:value-of select="//dc:description" /></p>
- </xsl:if>
+ <p class="info">Published by <a href="http://nowoczesnapolska.org.pl">Modern Poland Foundation</a>, 2012.</p>
<xsl:call-template name="editors" />
<xsl:if test="@data-cover-by">
- <p class="info">Okładka na podstawie:
+ <p class="info">Cover image:
<xsl:choose>
<xsl:when test="@data-cover-source">
<a>
</xsl:choose>
</p>
</xsl:if>
-
- <div class="info">
- <img src="jedenprocent.png" alt="Logo 1%" />
- <div>Przekaż 1% podatku na rozwój Wolnych Lektur.</div>
- <div>Nazwa organizacji: Fundacja Nowoczesna Polska</div>
- <div>KRS 0000070056</div>
- </div>
-
- <p class="info"> </p>
- <p class="minor info">
- Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
- </p>
-
</div>
</body>
</html>
<xsl:template name="editors">
<xsl:if test="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text()]">
<p class="info">
- <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
+ <xsl:text>Technical editors: </xsl:text>
<xsl:for-each select="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text() and not(//dc:contributor.editor/text()=text())]">
<xsl:sort />
<xsl:if test="position() != 1">, </xsl:if>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="html" version="1.0" encoding="utf-8" />
+ <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+ <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+
+ <xsl:template match="/" >
+ <xsl:element name="html" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:element name="head">
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>
+ Future of Copyright
+ </title>
+ </xsl:element>
+ <xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:element name="div" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="id">book-text</xsl:attribute>
+
+<h2 xmlns="http://www.w3.org/1999/xhtml" class="intitle">Dear readers!</h2>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">It is our great pleasure to present you the “Future of Copyright
+Anthology”, a collection of 10 best short stories sent in for the “Future
+of Copyright” contest organized by Modern Poland Foundation. These works
+have been selected by our jury – Prof. Michael Geist, Piotr Czerski and
+Jarosław Lipszyc.</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">The main prize in this contest was founded by you, the readers, on the
+Indiegogo crowdfunding platform. We are proud to announce that this
+prize goes to Aymeric Mansoux, author of “Morphology of a copyright
+tale”, in appreciation of the originality, power and the strong message
+of this work. Moreover, the jury decided to grant an honorable mention
+to Togi, author of the work “Give”.</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">We would like to thank you for your crowdfunding support and a high
+standard of the submitted works. We were pleasantly surprised by the
+interest shown in the competition, and we have decided to hold
+its second edition next
+year. We hope that with your help it will be even more successful and
+the collected works will provide a strong voice in the debate on the future
+of copyright law and system.</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">Modern Poland Foundation Team</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">
+<img xmlns="http://www.w3.org/1999/xhtml" alt="Modern Poland Foundation" src="logo.png" />
+</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph"><a xmlns="http://www.w3.org/1999/xhtml" href="http://nowoczesnapolska.org.pl">http://nowoczesnapolska.org.pl</a></p>
+
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>
- WolneLektury.pl
+ Future of Copyright
</title>
</xsl:element>
<xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">
<xsl:attribute name="id">book-text</xsl:attribute>
<xsl:if test="//nazwa_utworu">
<!--h1 xmlns="http://www.w3.org/1999/xhtml"-->
- <xsl:apply-templates select=" //nazwa_utworu" mode="poczatek"/>
- <xsl:apply-templates select=" //podtytul" mode="poczatek"/>
+ <xsl:apply-templates select="//dzielo_nadrzedne" mode="poczatek"/>
+ <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//nazwa_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//podtytul" mode="poczatek"/>
<!--/h1-->
</xsl:if>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="naglowek_scena">
- <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+ <a xmlns="http://www.w3.org/1999/xhtml"></a>
<h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
</h2>
</xsl:template>
<xsl:template match="naglowek_podrozdzial">
- <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+ <a xmlns="http://www.w3.org/1999/xhtml"></a>
<h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
</h2>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>
- <xsl:text>Strona tytułowa</xsl:text>
+ <xsl:text>Title page</xsl:text>
</title>
</head>
<body>
<p class="info">[Kopia robocza]</p>
</xsl:if>
- <xsl:if test="not(utwor/@less-advertising)">
+ <!--xsl:if test="not(utwor/@less-advertising)">
<p class="info">
<a>
<xsl:attribute name="href">
podobnie jak tysiące innych, jest dostępna on-line na stronie
<a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.
</p>
- </xsl:if>
+ </xsl:if-->
<p class="info">
+ <xsl:choose>
+ <xsl:when test="//dc:contributor">Thank you for your contribution, <xsl:value-of select="//dc:contributor"/>!</xsl:when>
+ <xsl:otherwise>Thank you for all your contributions!</xsl:otherwise>
+ </xsl:choose>
+ <br/>You made this book possible.
+ </p>
+
+
+ <!--p class="info">
Utwór opracowany został w ramach projektu<a href="http://www.wolnelektury.pl/"> Wolne Lektury</a> przez<a href="http://www.nowoczesnapolska.org.pl/"> fundację Nowoczesna Polska</a>.
</p>
<p class="footer info">
<a href="http://www.wolnelektury.pl/"><img src="logo_wolnelektury.png" alt="WolneLektury.pl" /></a>
- </p>
+ </p-->
</div>
</body>
</html>
(u'---', u'—'),
(u'--', u'–'),
(u'...', u'…'),
- (u',,', u'„'),
+ #(u',,', u'„'),
+ (u',,', u'“'),
(u'"', u'”'),
]
from tempfile import NamedTemporaryFile
from librarian import OutputFile
-from librarian.cover import WLCover
+from librarian.cover import ImageCover as WLCover
from librarian import get_resource
# provide a cover by default
if not cover:
cover = WLCover
- cover_file = NamedTemporaryFile(suffix='.png', delete=False)
c = cover(book_info)
+ import Image
+ c.im = Image.open('cover.jpg')
+ c.ext = lambda: 'jpg'
+ cover_file = NamedTemporaryFile(suffix='.' + c.ext(), delete=False)
c.save(cover_file)
if cover.uses_dc_cover:
from librarian.parser import WLDocument
from librarian import ParseError, DCNS, get_resource, OutputFile
from librarian import functions
-from librarian.cover import WLCover
+from librarian.cover import ImageCover as WLCover
functions.reg_substitute_entities()
if cover:
if cover is True:
cover = WLCover
- document.edoc.getroot().set('data-cover-width', str(cover.width))
- document.edoc.getroot().set('data-cover-height', str(cover.height))
- if cover.uses_dc_cover:
+ the_cover = cover(document.book_info)
+ document.edoc.getroot().set('data-cover-width', str(the_cover.width))
+ document.edoc.getroot().set('data-cover-height', str(the_cover.height))
+ if the_cover.uses_dc_cover:
if document.book_info.cover_by:
document.edoc.getroot().set('data-cover-by', document.book_info.cover_by)
if document.book_info.cover_source:
document.edoc.getroot().set('customizations', u','.join(customizations))
# hack the tree
- move_motifs_inside(document.edoc)
- hack_motifs(document.edoc)
+ #move_motifs_inside(document.edoc)
+ #hack_motifs(document.edoc)
parse_creator(document.edoc)
- substitute_hyphens(document.edoc)
+ if document.book_info.language == 'pol':
+ substitute_hyphens(document.edoc)
fix_hanging(document.edoc)
# wl -> TeXML
temp = mkdtemp('-wl2pdf')
if cover:
- c = cover(document.book_info)
- with open(os.path.join(temp, 'cover.png'), 'w') as f:
- c.save(f)
+ with open(os.path.join(temp, 'cover.jpg'), 'w') as f:
+ the_cover.save(f)
del document # no longer needed large object :)
# LaTeX -> PDF
shutil.copy(get_resource('pdf/wl.cls'), temp)
shutil.copy(get_resource('res/wl-logo.png'), temp)
+ shutil.copy('logo.eps', temp)
cwd = os.getcwd()
os.chdir(temp)
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
-\LoadClass[a4paper,oneside]{book}
+\LoadClass[a4paper]{book}
\usepackage{trace}
-\usepackage[MeX]{polski}
+%\usepackage[MeX]{polski}
\usepackage[xetex]{graphicx}
\usepackage{fontspec}
\setlength{\marginparsep}{2em}
\setlength{\marginparwidth}{8.5em}
-\setlength{\oddsidemargin}{0pt}
+\setlength{\oddsidemargin}{36mm}
+\setlength{\evensidemargin}{0pt}
\setlength{\voffset}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
-\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
+%\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
\cfoot{}
-\rfoot{{\footnotesize \thepage}}
+%\rfoot{{\footnotesize \thepage}}
+\fancyfoot[LO,RE]{{\footnotesize \textsc{\@author} \emph{\@title}}}
+\fancyfoot[LE,RO]{{\footnotesize \thepage}}
\clubpenalty=100000
\widowpenalty=100000
\raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
\newcommand{\makecover}[2]{
- \pdfpagewidth=#1
- \pdfpageheight=#2
+
+ %\pdfpagewidth=#1
+ %\pdfpageheight=#2
\thispagestyle{empty}
\newlength{\PictHOffset}
\addtolength{\PictVOffset}{\headheight}
\addtolength{\PictVOffset}{\headsep}
\addtolength{\PictVOffset}{\topskip}
- \addtolength{\PictVOffset}{-\pdfpageheight}
+ \addtolength{\PictVOffset}{-#2}
\noindent\hspace*{-\PictHOffset}%
\raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
- \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
- \clearpage
+ \includegraphics[height=#2,width=#1]{cover.jpg}}}
+ %\clearpage
+ \vspace{#2}
+
+ \hspace{-36mm}\parbox{16cm}{
+ {\addfontfeature{LetterSpace=-4.0}\emph{\scalefont{4}%
+ \noindent Future of Copyright Anthology
+ }}
+
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{1.5}%
+ A collection of texts from a crowd-funded contest.
+ }}
+
+
+ \vspace{8em}
- \setlength{\pdfpagewidth}{210mm}
- \setlength{\pdfpageheight}{297mm}
+\emph{\thankyou}\\
+\indent\emph{You made this book possible.}
+ }
+
+
+ %\setlength{\pdfpagewidth}{210mm}
+ %\setlength{\pdfpageheight}{297mm}
}
}
}
+\usepackage{printlen}
+
\newcommand{\editorialsection}{
+\clearpage
+
+%\set\textwidth=450pt
+%\printlength\textwidth
+
+
+{\scalefont{1.5}Dear readers!}
+
+
+
+\vspace{1em}
+It is our great pleasure to present you the “Future of Copyright
+Anthology”, a collection of 10 best short stories sent in for the “Future
+of Copyright” contest organized by Modern Poland Foundation. These works
+have been selected by our jury – Prof. Michael Geist, Piotr Czerski and
+Jarosław Lipszyc.
+
+The main prize in this contest was founded by you, the readers, on the
+Indiegogo crowdfunding platform. We are proud to announce that this
+prize goes to Aymeric Mansoux, author of “Morphology of a copyright
+tale”, in appreciation of the originality, power and the strong message
+of this work. Moreover, the jury decided to grant an honorable mention
+to Togi, author of the work “Give”.
+
+We would like to thank you for your crowdfunding support and a high
+standard of the submitted works. We were pleasantly surprised by the
+interest shown in the competition, and we have decided to hold
+its second edition next
+year. We hope that with your help it will be even more successful and
+the collected works will provide a strong voice in the debate on the future
+of copyright law and system.
+
+\vspace{1em}
+Modern Poland Foundation Team
+
+\vspace{4em}
+\includegraphics[scale=.2]{logo.eps}
+\vspace{1em}
+
+\href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
+
+%\vspace{4em}
+%\box{\tableofcontents}
+
\begin{figure}[b!]
{
\footnotesize
\rightsinfo
\vspace{.6em}
- Źródło: \href{\bookurl}{\bookurl}
+ %Źródło: \href{\bookurl}{\bookurl}
- \vspace{.6em}
- \sourceinfo
+ %\vspace{.6em}
+ %\sourceinfo
- \description
- \vspace{.6em}
+ %\description
+ %\vspace{.6em}
+
+ Published by \href{http://nowoczesnapolska.org.pl}{Modern Poland Foundation}, 2012.
\editors
- \vspace{.6em}
+ %\vspace{.6em}
\coverby
\color{black}
%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}}
}
-
\newcommand{\tytul}[1]{%
#1%
-\vspace{1em}%
+%\vspace{1em}%
+}
+
+\newcommand{\autorpodutworu}[1]{%
+\section*{\typosection{#1}}%
}
\newcommand{\nazwapodutworu}[1]{%
}
\newcommand{\autorutworu}[1]{%
+\addcontentsline{toc}{part}{???}
\subsection*{\typosubsection{#1}}%
}
\subsection*{\typosubsubsection{#1}}%
}
+\newcommand{\podtytulpodutworu}[1]{%
+\subsection*{\typosubsubsection{#1}}%
+}
+
\newcommand{\translator}[1]{%
\subsection*{\typosubsubsection{tłum. #1}}%
}
-
\newcommand{\powiesc}[1]{#1}
\newcommand{\opowiadanie}[1]{#1}
\newcommand{\lirykal}[1]{#1}
\newcommand{\dramatwspolczesny}[1]{#1}
\newcommand{\nota}[1]{%
-\par{#1}%
+\begin{quotation}%
+#1%
+\end{quotation}%
}
\newcommand{\dedykacja}[1]{%
\subsection*{\typosubsection{#1}}%
}
\newcommand{\naglowekczesc}[1]{%
-\pagebreak
+%\pagebreak
\subsection*{\typosubsection{#1}}%
}
\newcommand{\srodtytul}[1]{%
\begin{center}%
\par{*}%
\end{center}%
+\noindent%
}
\newcommand{\separatorlinia}{%
<xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode='titlepage' />
<env name="document">
+ <TeXML escape="0">
+ \def\thankyou{%
+ <xsl:choose>
+ <xsl:when test="//dc:contributor">Thank you for your contribution, <xsl:value-of select="//dc:contributor"/>!</xsl:when>
+ <xsl:otherwise>Thank you for all your contributions!</xsl:otherwise>
+ </xsl:choose>
+ }
+ </TeXML>
+
<xsl:if test="@data-cover-width">
<cmd name="makecover">
- <parm><xsl:value-of select="210 * @data-cover-width div @data-cover-height" />mm</parm>
<parm>210mm</parm>
+ <parm><xsl:value-of select="210 * @data-cover-height div @data-cover-width" />mm</parm>
</cmd>
</xsl:if>
- <cmd name="maketitle" />
+ <!--cmd name="maketitle" /-->
- <cmd name="tytul"><parm>
+ <!--cmd name="tytul"><parm>
<xsl:choose>
<xsl:when test="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu">
- <!-- title in master -->
+ <!- title in master ->
<xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/autor_utworu" mode="title" />
<xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/dzielo_nadrzedne" mode="title" />
<xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu" mode="title" />
<xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/podtytul" mode="title" />
- <!-- dc in master or not -->
+ <!- dc in master or not ->
<cmd name="translatorsline" />
</xsl:when>
<xsl:otherwise>
- <!-- look for author title in dc -->
+ <!- look for author title in dc ->
<xsl:apply-templates select="rdf:RDF" mode="firstdctitle" />
<xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" mode='firstdctitle' />
</xsl:otherwise>
</xsl:choose>
- </parm></cmd>
- <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
- <xsl:apply-templates select="utwor" mode="part" />
+ </parm></cmd-->
<TeXML escape="0">
\def\coverby{
- <xsl:if test="@data-cover-by">Okładka na podstawie:
+ <xsl:if test="@data-cover-by">Cover image:
<xsl:choose>
<xsl:when test="@data-cover-source">
- \href{\datacoversource}{\datacoverby}
+ \href{\datacoversource}{\datacoverby}.
</xsl:when>
<xsl:otherwise>
- \datacoverby{}
+ \datacoverby{}.
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</TeXML>
<cmd name="editorialsection" />
+
+ <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
+ <xsl:apply-templates select="utwor" mode="part" />
</env>
</TeXML>
</xsl:template>
<xsl:template match="utwor" mode="part">
+ <cmd name="newpage" />
<cmd name="tytul"><parm>
+
+ <!-- Dirty! -->
+ <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/motyw" mode="inline"/>
+
<xsl:choose>
<xsl:when test="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu">
<!-- title in master -->
+ <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/dzielo_nadrzedne" mode="title" />
+ <xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/autor_utworu" mode="title" />
<xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/nazwa_utworu" mode="title" />
<xsl:apply-templates select="(powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny)/podtytul" mode="title" />
</xsl:when>
\href{http://creativecommons.org/licenses/by-sa/3.0/}{Creative Commons
Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL}.}
<xsl:if test=".//dc:rights.license">
- \def\rightsinfo{Ten utwór jest udostepniony na licencji
+ \def\rightsinfo{This book is available under the terms of
\href{<xsl:value-of select=".//dc:rights.license" />}{<xsl:value-of select=".//dc:rights" />}.}
</xsl:if>
</xsl:template>
<xsl:template name="editors">
- <xsl:if test="//dc:contributor.editor_parsed|//dc:contributor.technical_editor_parsed">
- <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
- <xsl:for-each select="//dc:contributor.editor_parsed|//dc:contributor.technical_editor_parsed[not(//dc:contributor.editor_parsed/text()=text())]">
- <xsl:sort select="@sortkey" />
+ <xsl:if test=".//dc:contributor.editor_parsed|.//dc:contributor.technical_editor_parsed">
+ <xsl:text>Technical editors: </xsl:text>
+ <xsl:for-each select=".//dc:contributor.editor_parsed|.//dc:contributor.technical_editor_parsed[not(.//dc:contributor.editor_parsed/text()=text())]">
+ <!--xsl:sort select="@sortkey" /-->
<xsl:if test="position() != 1">, </xsl:if>
<xsl:apply-templates mode="inline" />
</xsl:for-each>.
doc = WLDocument.from_file(main_input, provider=provider)
pdf = doc.as_pdf(save_tex=options.save_tex,
cover=options.with_cover,
- morefloats=options.morefloats)
+ morefloats=options.morefloats, verbose=options.verbose)
doc.save_output_file(pdf,
output_file, options.output_dir, options.make_dir, 'pdf')