From: Marcin Koziej Date: Mon, 5 Dec 2011 13:22:22 +0000 (+0100) Subject: Merge branch 'pdf' X-Git-Tag: 1.7~189 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/d7ba2c607dacf7a6136b83a1588b5adf2278ad46?hp=4c03e8c6d362890f31ea8227e5ab5e0cb3f4df30 Merge branch 'pdf' --- diff --git a/librarian/__init__.py b/librarian/__init__.py index 619650d..8f5cf1a 100644 --- a/librarian/__init__.py +++ b/librarian/__init__.py @@ -8,11 +8,11 @@ import os class ParseError(Exception): def __str__(self): """ Dirty workaround for Python Unicode handling problems. """ - return self.message.message + return self.message def __unicode__(self): """ Dirty workaround for Python Unicode handling problems. """ - return self.message.message + return self.message class ValidationError(Exception): pass diff --git a/librarian/pdf.py b/librarian/pdf.py index 476fbee..1bfd949 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -35,6 +35,13 @@ STYLESHEETS = { 'wl2tex': 'pdf/wl2tex.xslt', } +CUSTOMIZATIONS = [ + 'nofootnotes', + 'nothemes', + 'onehalfleading', + 'doubleleading', + 'nowlfont', + ] def insert_tags(doc, split_re, tagname, exclude=None): """ inserts for every occurence of `split_re' in text nodes in the `doc' tree @@ -152,7 +159,7 @@ def package_available(package, args='', verbose=False): fpath = os.path.join(tempdir, 'test.tex') f = open(fpath, 'w') f.write(r""" - \documentclass{book} + \documentclass{wl} \usepackage[%s]{%s} \begin{document} \end{document} @@ -168,7 +175,7 @@ def package_available(package, args='', verbose=False): def transform(provider, slug=None, file_path=None, output_file=None, output_dir=None, make_dir=False, verbose=False, save_tex=None, morefloats=None, - cover=None, flags=None): + cover=None, flags=None, customizations=None): """ produces a PDF file with XeLaTeX provider: a DocProvider @@ -182,6 +189,7 @@ def transform(provider, slug=None, file_path=None, morefloats (old/new/none): force specific morefloats cover: a cover.Cover object flags: less-advertising, + customizations: user requested customizations regarding various formatting parameters (passed to wl LaTeX class) """ # Parse XSLT @@ -208,6 +216,10 @@ def transform(provider, slug=None, file_path=None, elif package_available('morefloats', 'maxfloats=19'): document.edoc.getroot().set('morefloats', 'new') + # add customizations + if customizations is not None: + document.edoc.getroot().set('customizations', u','.join(customizations)) + # hack the tree move_motifs_inside(document.edoc) hack_motifs(document.edoc) @@ -223,6 +235,7 @@ def transform(provider, slug=None, file_path=None, # wl -> TeXML style_filename = get_stylesheet("wl2tex") style = etree.parse(style_filename) + texml = document.transform(style) # TeXML -> LaTeX @@ -245,7 +258,7 @@ def transform(provider, slug=None, file_path=None, shutil.copy(tex_path, save_tex) # LaTeX -> PDF - shutil.copy(get_resource('pdf/wl.sty'), temp) + shutil.copy(get_resource('pdf/wl.cls'), temp) shutil.copy(get_resource('res/wl-logo.png'), temp) cwd = os.getcwd() diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls new file mode 100644 index 0000000..37d1d24 --- /dev/null +++ b/librarian/pdf/wl.cls @@ -0,0 +1,487 @@ +% -*- coding: utf-8 -*- +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{wl}[2011/11/28 wolnelektury.pl book style] + +% PDF customizations +% +% nofootnotes - disable generation of footnotes +% nothemes - disable generation of themes +% onehalfleading - leading of 1.5 (interlinia) +% doubleleading - double leading (interlinia) +% a4paper,... - paper size as required by LaTeX +% nowlfont - don't use customized WL font + +\RequirePackage{setspace} +\RequirePackage{type1cm} +\DeclareOption{13pt}{% +\AtEndOfClass{% +% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ +\renewcommand\normalsize{% + \@setfontsize\normalsize{13pt}{14.5pt}% + \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ + \belowdisplayskip \abovedisplayskip + \let\@listi\@listI}\normalsize% +\renewcommand\footnotesize{% + \@setfontsize\footnotesize\@xpt\@xiipt + \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ + \abovedisplayshortskip \z@ \@plus3\p@ + \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ + \def\@listi{\leftmargin\leftmargini + \topsep 6\p@ \@plus2\p@ \@minus2\p@ + \parsep 3\p@ \@plus2\p@ \@minus\p@ + \itemsep \parsep}% + \belowdisplayskip \abovedisplayskip +}% +}% +} + +%% \DeclareOption{14pt}{\renewcommand{\normalsize}{\AtEndOfClass{\fontsize{14}{17}\selectfont}}} + +\DeclareOption{doubleleading}{\AtBeginDocument{\doublespacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}} +\DeclareOption{onehalfleading}{\AtBeginDocument{\onehalfspacing}}%\setlength{\leading}{1em plus 0.5ex minus 0.2ex}} + +%% This does not really work, since dvipdfm(x) will use it's configuration in /etc/texmf/dvipdfm(x) and force a global paper size setting. +\DeclareOption{a5paper}{% + \setlength{\paperheight}{210mm}% + \setlength{\paperwidth}{148mm}} + + +\newif\ifshowfootnotes \showfootnotestrue +\DeclareOption{nofootnotes}{\showfootnotesfalse} + +\newif\ifshowthemes \showthemestrue +\DeclareOption{nothemes}{\showthemesfalse} + +\newif\ifenablewlfont \enablewlfonttrue +\DeclareOption{nowlfont}{\enablewlfontfalse} + +\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} +\ProcessOptions\relax +\LoadClass[a4paper,oneside]{book} + + +\usepackage{trace} + +\usepackage[MeX]{polski} + +\usepackage[xetex]{graphicx} +\usepackage{fontspec} +\usepackage{xunicode} +\usepackage{xltxtra} + +\usepackage[overload]{textcase} +\usepackage{scalefnt} +\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref} + +\ifenablewlfont +\setmainfont [ +%ExternalLocation, +UprightFont = JunicodeWL-Regular, +ItalicFont = JunicodeWL-Italic, +BoldFont = JunicodeWL-Regular, +BoldItalicFont = JunicodeWL-Italic, +SmallCapsFont = JunicodeWL-Regular, +SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, +Numbers=OldStyle, +Scale=1.04, +LetterSpace=-1.0 +] {JunicodeWL} + +\newfontfamily\alien[ +SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, +Numbers=OldStyle, +Scale=0.85, +LetterSpace=-1.0 +] {DejaVu Serif} + + +\defaultfontfeatures{ +SizeFeatures={ + {Size={-10.5}, FakeStretch=1.02, LetterSpace=2.0 }, + {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 }, + {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 } +} +} + +\renewcommand{\textsc}[1]{% +{\addfontfeature{ +SizeFeatures={ + {Size={-10.5}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, + {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, + {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 } +}, +Letters={SmallCaps,UppercaseSmallCaps} +} +#1} +} +\fi% enablewlfont + +%{\Itshape JunicodeWL-Italic.ttf } +%{\bfseries Junicode-Bold.ttf } +%{\bfseries\itshape Junicode-BoldItalic.ttf } + +\pagestyle{plain} +\usepackage{fancyhdr} + +\makeatletter + +% bottom figure below footnotes +\usepackage{fnpos} +\makeFNabove + +\usepackage{color} +\definecolor{theme}{gray}{.3} + +\setlength{\marginparsep}{2em} +\setlength{\marginparwidth}{8.5em} +\setlength{\oddsidemargin}{0pt} +\setlength{\voffset}{0pt} +\setlength{\topmargin}{0pt} +\setlength{\headheight}{0pt} +\setlength{\headsep}{0pt} +\setlength{\textheight}{24cm} + +\pagestyle{fancy} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} +\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}} +\cfoot{} +\rfoot{{\footnotesize \thepage}} + +\clubpenalty=100000 +\widowpenalty=100000 + + +% see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html +\newsavebox{\ximagebox}\newlength{\ximageheight} +\newsavebox{\xglyphbox}\newlength{\xglyphheight} +\newcommand{\xbox}[1] +{\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}% +\savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}% +\raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{% +\makebox[0pt][l]{\usebox{\xglyphbox}}}%}% +\usebox{\ximagebox}% +\raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}} + +\newcommand{\makecover}[2]{ + \pdfpagewidth=#1 + \pdfpageheight=#2 + + \thispagestyle{empty} + \newlength{\PictHOffset} + \newlength{\PictVOffset} + \setlength{\PictHOffset}{1in} + \addtolength{\PictHOffset}{\hoffset} + \addtolength{\PictHOffset}{\oddsidemargin} + + \setlength{\PictVOffset}{1in} + \addtolength{\PictVOffset}{\voffset} + \addtolength{\PictVOffset}{\topmargin} + \addtolength{\PictVOffset}{\headheight} + \addtolength{\PictVOffset}{\headsep} + \addtolength{\PictVOffset}{\topskip} + \addtolength{\PictVOffset}{-\pdfpageheight} + + \noindent\hspace*{-\PictHOffset}% + \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% + \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}} + \clearpage + + \setlength{\pdfpagewidth}{210mm} + \setlength{\pdfpageheight}{297mm} +} + + +\renewcommand{\maketitle}{ + { + \thispagestyle{empty} + \footnotesize + \color{theme} + + \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt} + \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}} + \end{minipage} + \begin{minipage}[t]{.65\textwidth}\vspace{0pt} + + \ifflaglessadvertising + \else + \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie + \href{http://www.wolnelektury.pl/}{wolnelektury.pl}. + \vspace{.5em} + \fi + + Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury} + przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}. + + \end{minipage} + \noindent \rule{\linewidth}{0.4pt} + + \vspace{.6em} + \color{black} + } +} + +\newcommand{\editorialsection}{ + \begin{figure}[b!] + { + \footnotesize + \color{theme} + \noindent \rule{\linewidth}{0.4pt} + + \rightsinfo + \vspace{.6em} + + Źródło: \href{\bookurl}{\bookurl} + + \vspace{.6em} + \sourceinfo + + \description + \vspace{.6em} + + \editors + + \color{black} + } + \end{figure} +} + + +\newcommand{\typosubsubsection}[1]{% +{\textsc{#1}} +} + +\newcommand{\typosubsection}[1]{% +{\addfontfeature{ +SizeFeatures={ + {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, + {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, + {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 } +}, +Letters={Uppercase} +} +\MakeUppercase{#1}} +} + +\newcommand{\typosection}[1]{% +{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}} +%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}} +} + + +\newcommand{\tytul}[1]{% +#1% +\vspace{1em}% +} + +\newcommand{\nazwapodutworu}[1]{% +\section*{\typosection{#1}}% +} + +\newcommand{\autorutworu}[1]{% +\subsection*{\typosubsection{#1}}% +} + +\newcommand{\dzielonadrzedne}[1]{% +\subsection*{\typosubsubsection{#1}}% +} + +\newcommand{\nazwautworu}[1]{% +\section*{\typosection{#1}}% +} + +\newcommand{\podtytul}[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{\lirykalp}[1]{#1} +\newcommand{\dramatwierszowanyl}[1]{#1} +\newcommand{\dramatwierszowanylp}[1]{#1} +\newcommand{\dramatwspolczesny}[1]{#1} + +\newcommand{\nota}[1]{% +\par{#1}% +} + +\newcommand{\dedykacja}[1]{% +\begin{em}% +\begin{flushright}% +#1% +\end{flushright}% +\end{em}% +} + +\newcommand{\dlugicytat}[1]{% +\begin{quotation}% +#1% +\end{quotation}% +} + +\newcommand{\poezjacyt}[1]{% +\begin{verse}% +#1% +\end{verse}% +} +\newcommand{\motto}[1]{% +\begin{em}% +#1% +\end{em}% +} +\newcommand{\listaosob}[2]{% +\par{#1}% +\begin{itemize}% +#2% +\end{itemize}% +} + +\newcommand{\nagloweklisty}[1]{% +\typosubsubsection{#1}% +} + +\newcommand{\listaosoba}[1]{% +\item{#1}% +} + +\newcommand{\kwestia}[1]{% +\par{#1}% +} + +\newcommand{\naglowekakt}[1]{% +\pagebreak +\subsection*{\typosubsection{#1}}% +} +\newcommand{\naglowekczesc}[1]{% +\pagebreak +\subsection*{\typosubsection{#1}}% +} +\newcommand{\srodtytul}[1]{% +\subsection*{\typosubsection{#1}}% +} + +\newcommand{\naglowekscena}[1]{% +\subsubsection*{\typosubsubsection{#1}}% +} +\newcommand{\naglowekrozdzial}[1]{% +\subsubsection*{\typosubsubsection{#1}}% +} + +\newcommand{\naglowekosoba}[1]{% +\par{\textsc{#1}}\nopagebreak% +} +\newcommand{\naglowekpodrozdzial}[1]{% +\par{#1}\nopagebreak% +} + +\newcommand{\miejsceczas}[1]{% +\par{\emph{#1}}% +} +\newcommand{\didaskalia}[1]{% +\par{\emph{#1}}% +} + +\newcommand{\akap}[1]{% +\par{#1}% +} +\newcommand{\akapdialog}[1]{% +\par{#1}% +} +\newcommand{\akapcd}[1]{% +\par{#1}% +} + +\newcommand{\mottopodpis}[1]{% +\begin{em}% +\begin{flushright}% +#1% +\end{flushright}% +\end{em}% +} + +\newcommand{\strofa}[1]{% +\par{\noindent{\ignorespaces#1\vspace{1em}}}% +} + +\newcommand{\wers}[1]{#1} + +\newcommand{\wersakap}[1]{% +\hspace*{1em}#1% +} +\newcommand{\werscd}[1]{% +\hspace*{8em}#1% +} +\newcommand{\werswciety}[2][1em]{% +\hspace*{#1}#2% +} + +\ifshowfootnotes + \newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}} + \newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}} + \newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}} + \newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}} +\else + \newcommand{\pa}[1]{} + \newcommand{\pe}[1]{} + \newcommand{\pr}[1]{} + \newcommand{\pt}[1]{} +\fi + +\newcommand{\mat}[1]{$#1$} + +\newcommand{\didasktekst}[1]{% +\emph{#1}% +} +\newcommand{\slowoobce}[1]{% +\emph{#1}% +} +\newcommand{\tytuldziela}[1]{% +\emph{#1}% +} +\newcommand{\wyroznienie}[1]{% +\emph{#1}% +} + +\newcommand{\osoba}[1]{% +#1% +} + +\newcommand{\sekcjaswiatlo}{% +\vspace{30pt}% +} + +\newcommand{\sekcjaasterysk}{% +\vspace{10pt}% +\begin{center}% +\par{*}% +\end{center}% +} + +\newcommand{\separatorlinia}{% +\vspace{10pt}% +\hrule{}% +\vspace{10pt}% +} + +\newcommand{\motyw}[2][0]{% +\ifshowthemes +\mbox{}% +\marginpar{% +\vspace{-8pt}% +\vspace{-#1\baselineskip}% +\raggedright{\hspace{0pt}% +\footnotesize{\color{theme}{#2}}}% +\vspace{\baselineskip}% +}% +\fi +} + diff --git a/librarian/pdf/wl.sty b/librarian/pdf/wl.sty deleted file mode 100644 index 28a23a5..0000000 --- a/librarian/pdf/wl.sty +++ /dev/null @@ -1,413 +0,0 @@ -% -*- coding: utf-8 -*- - -\usepackage[MeX]{polski} - -\usepackage[xetex]{graphicx} -\usepackage{fontspec} -\usepackage{xunicode} -\usepackage{xltxtra} - -\usepackage[overload]{textcase} -\usepackage{scalefnt} -\usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref} - -\setmainfont [ -%ExternalLocation, -UprightFont = JunicodeWL-Regular, -ItalicFont = JunicodeWL-Italic, -BoldFont = JunicodeWL-Regular, -BoldItalicFont = JunicodeWL-Italic, -SmallCapsFont = JunicodeWL-Regular, -SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, -Numbers=OldStyle, -Scale=1.04, -LetterSpace=-1.0 -] {JunicodeWL} - -\newfontfamily\alien[ -SmallCapsFeatures = {Letters={SmallCaps,UppercaseSmallCaps}}, -Numbers=OldStyle, -Scale=0.85, -LetterSpace=-1.0 -] {DejaVu Serif} - - -\defaultfontfeatures{ -SizeFeatures={ - {Size={-10}, FakeStretch=1.02, LetterSpace=2.0 }, - {Size={10.5-12}, FakeStretch=2.00, LetterSpace=0.0 }, - {Size={12-}, FakeStretch=0.98, LetterSpace=-2.0 } -} -} - -\renewcommand{\textsc}[1]{% -{\addfontfeature{ -SizeFeatures={ - {Size={-10}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, - {Size={10.5-12}, Scale=1.2, FakeStretch=1.02, LetterSpace=8.0 }, - {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 } -}, -Letters={SmallCaps,UppercaseSmallCaps} -} -#1} -} - -%{\itshape JunicodeWL-Italic.ttf } -%{\bfseries Junicode-Bold.ttf } -%{\bfseries\itshape Junicode-BoldItalic.ttf } - -\pagestyle{plain} -\usepackage{fancyhdr} - -\makeatletter - -% bottom figure below footnotes -\usepackage{fnpos} -\makeFNabove - -\usepackage{color} -\definecolor{theme}{gray}{.3} - -\setlength{\marginparsep}{2em} -\setlength{\marginparwidth}{8.5em} -\setlength{\oddsidemargin}{0pt} -\setlength{\voffset}{0pt} -\setlength{\topmargin}{0pt} -\setlength{\headheight}{0pt} -\setlength{\headsep}{0pt} -\setlength{\textheight}{24cm} - -\pagestyle{fancy} -\fancyhf{} -\renewcommand{\headrulewidth}{0pt} -\renewcommand{\footrulewidth}{0pt} -\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}} -\cfoot{} -\rfoot{{\footnotesize \thepage}} - -\clubpenalty=100000 -\widowpenalty=100000 - - -% see http://osdir.com/ml/tex.xetex/2005-10/msg00003.html -\newsavebox{\ximagebox}\newlength{\ximageheight} -\newsavebox{\xglyphbox}\newlength{\xglyphheight} -\newcommand{\xbox}[1] -{\savebox{\ximagebox}{#1}\settoheight{\ximageheight}{\usebox {\ximagebox}}% -\savebox{\xglyphbox}{\char32}\settoheight{\xglyphheight}{\usebox {\xglyphbox}}% -\raisebox{\ximageheight}[0pt][0pt]{%\raisebox{-\xglyphheight}[0pt] [0pt]{% -\makebox[0pt][l]{\usebox{\xglyphbox}}}%}% -\usebox{\ximagebox}% -\raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}} - -\newcommand{\makecover}[2]{ - \pdfpagewidth=#1 - \pdfpageheight=#2 - - \thispagestyle{empty} - \newlength{\PictHOffset} - \newlength{\PictVOffset} - \setlength{\PictHOffset}{1in} - \addtolength{\PictHOffset}{\hoffset} - \addtolength{\PictHOffset}{\oddsidemargin} - - \setlength{\PictVOffset}{1in} - \addtolength{\PictVOffset}{\voffset} - \addtolength{\PictVOffset}{\topmargin} - \addtolength{\PictVOffset}{\headheight} - \addtolength{\PictVOffset}{\headsep} - \addtolength{\PictVOffset}{\topskip} - \addtolength{\PictVOffset}{-\pdfpageheight} - - \noindent\hspace*{-\PictHOffset}% - \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% - \includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}} - \clearpage - - \setlength{\pdfpagewidth}{210mm} - \setlength{\pdfpageheight}{297mm} -} - - -\renewcommand{\maketitle}{ - { - \thispagestyle{empty} - \footnotesize - \color{theme} - - \noindent \begin{minipage}[t]{.35\textwidth}\vspace{0pt} - \href{http://www.wolnelektury.pl}{\xbox{\includegraphics[width=\textwidth]{wl-logo.png}}} - \end{minipage} - \begin{minipage}[t]{.65\textwidth}\vspace{0pt} - - \ifflaglessadvertising - \else - \href{\bookurl}{Ta lektura}, podobnie jak tysiące innych, jest dostępna on-line na stronie - \href{http://www.wolnelektury.pl/}{wolnelektury.pl}. - \vspace{.5em} - \fi - - Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury} - przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}. - - \end{minipage} - \noindent \rule{\linewidth}{0.4pt} - - \vspace{.6em} - \color{black} - } -} - -\newcommand{\editorialsection}{ - \begin{figure}[b!] - { - \footnotesize - \color{theme} - \noindent \rule{\linewidth}{0.4pt} - - \rightsinfo - \vspace{.6em} - - Źródło: \href{\bookurl}{\bookurl} - - \vspace{.6em} - \sourceinfo - - \description - \vspace{.6em} - - \editors - - \color{black} - } - \end{figure} -} - - -\newcommand{\typosubsubsection}[1]{% -{\textsc{#1}} -} - -\newcommand{\typosubsection}[1]{% -{\addfontfeature{ -SizeFeatures={ - {Size={-10}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, - {Size={10.5-12}, Scale=1.2, FakeStretch=1.00, LetterSpace=8.0 }, - {Size={12-}, FakeStretch=1.0, LetterSpace=8.0 } -}, -Letters={Uppercase} -} -\MakeUppercase{#1}} -} - -\newcommand{\typosection}[1]{% -{\addfontfeature{FakeStretch=0.96, LetterSpace=-4.0}\emph{\scalefont{2}#1}} -%{\addfontfeature{Scale=2.0, FakeStretch=0.98, LetterSpace=-2.0}\emph{#1}} -} - - -\newcommand{\tytul}[1]{% -#1% -\vspace{1em}% -} - -\newcommand{\nazwapodutworu}[1]{% -\section*{\typosection{#1}}% -} - -\newcommand{\autorutworu}[1]{% -\subsection*{\typosubsection{#1}}% -} - -\newcommand{\dzielonadrzedne}[1]{% -\subsection*{\typosubsubsection{#1}}% -} - -\newcommand{\nazwautworu}[1]{% -\section*{\typosection{#1}}% -} - -\newcommand{\podtytul}[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{\lirykalp}[1]{#1} -\newcommand{\dramatwierszowanyl}[1]{#1} -\newcommand{\dramatwierszowanylp}[1]{#1} -\newcommand{\dramatwspolczesny}[1]{#1} - -\newcommand{\nota}[1]{% -\par{#1}% -} - -\newcommand{\dedykacja}[1]{% -\begin{em}% -\begin{flushright}% -#1% -\end{flushright}% -\end{em}% -} - -\newcommand{\dlugicytat}[1]{% -\begin{quotation}% -#1% -\end{quotation}% -} - -\newcommand{\poezjacyt}[1]{% -\begin{verse}% -#1% -\end{verse}% -} -\newcommand{\motto}[1]{% -\begin{em}% -#1% -\end{em}% -} -\newcommand{\listaosob}[2]{% -\par{#1}% -\begin{itemize}% -#2% -\end{itemize}% -} - -\newcommand{\nagloweklisty}[1]{% -\typosubsubsection{#1}% -} - -\newcommand{\listaosoba}[1]{% -\item{#1}% -} - -\newcommand{\kwestia}[1]{% -\par{#1}% -} - -\newcommand{\naglowekakt}[1]{% -\pagebreak -\subsection*{\typosubsection{#1}}% -} -\newcommand{\naglowekczesc}[1]{% -\pagebreak -\subsection*{\typosubsection{#1}}% -} -\newcommand{\srodtytul}[1]{% -\subsection*{\typosubsection{#1}}% -} - -\newcommand{\naglowekscena}[1]{% -\subsubsection*{\typosubsubsection{#1}}% -} -\newcommand{\naglowekrozdzial}[1]{% -\subsubsection*{\typosubsubsection{#1}}% -} - -\newcommand{\naglowekosoba}[1]{% -\par{\textsc{#1}}\nopagebreak% -} -\newcommand{\naglowekpodrozdzial}[1]{% -\par{#1}\nopagebreak% -} - -\newcommand{\miejsceczas}[1]{% -\par{\emph{#1}}% -} -\newcommand{\didaskalia}[1]{% -\par{\emph{#1}}% -} - -\newcommand{\akap}[1]{% -\par{#1}% -} -\newcommand{\akapdialog}[1]{% -\par{#1}% -} -\newcommand{\akapcd}[1]{% -\par{#1}% -} - -\newcommand{\mottopodpis}[1]{% -\begin{em}% -\begin{flushright}% -#1% -\end{flushright}% -\end{em}% -} - -\newcommand{\strofa}[1]{% -\par{\noindent{\ignorespaces#1\vspace{1em}}}% -} - -\newcommand{\wers}[1]{#1} - -\newcommand{\wersakap}[1]{% -\hspace*{1em}#1% -} -\newcommand{\werscd}[1]{% -\hspace*{8em}#1% -} -\newcommand{\werswciety}[2][1em]{% -\hspace*{#1}#2% -} - - -\newcommand{\pa}[1]{\NoCaseChange{\footnote{#1 [przypis autorski]}}} -\newcommand{\pe}[1]{\NoCaseChange{\footnote{#1}}} -\newcommand{\pr}[1]{\NoCaseChange{\footnote{#1}}} -\newcommand{\pt}[1]{\NoCaseChange{\footnote{#1}}} - -\newcommand{\mat}[1]{$#1$} - -\newcommand{\didasktekst}[1]{% -\emph{#1}% -} -\newcommand{\slowoobce}[1]{% -\emph{#1}% -} -\newcommand{\tytuldziela}[1]{% -\emph{#1}% -} -\newcommand{\wyroznienie}[1]{% -\emph{#1}% -} - -\newcommand{\osoba}[1]{% -#1% -} - -\newcommand{\sekcjaswiatlo}{% -\vspace{30pt}% -} - -\newcommand{\sekcjaasterysk}{% -\vspace{10pt}% -\begin{center}% -\par{*}% -\end{center}% -} - -\newcommand{\separatorlinia}{% -\vspace{10pt}% -\hrule{}% -\vspace{10pt}% -} - -\newcommand{\motyw}[2][0]{% -\mbox{}% -\marginpar{% -\vspace{-8pt}% -\vspace{-#1\baselineskip}% -\raggedright{\hspace{0pt}% -\footnotesize{\color{theme}{#2}}}% -\vspace{\baselineskip}% -}% -} - diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index ec5e4d3..25d76d9 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -15,7 +15,7 @@ - \documentclass[a4paper, oneside, 11pt]{book} + \documentclass[]{wl} @@ -31,8 +31,6 @@ \def\{} - - \usepackage{wl} diff --git a/setup.py b/setup.py old mode 100644 new mode 100755