From 75abfdc7e8f14937b825a1502bb564fe2063ced4 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Fri, 23 Aug 2013 02:33:25 +0200 Subject: [PATCH] mobile publication --- librarian/epub.py | 16 ++++---- librarian/epub/xsltScheme.xsl | 35 ++++++++++++++++ librarian/epub/xsltTitle.xsl | 4 +- librarian/pdf.py | 4 +- librarian/pdf/wl2tex.xslt | 39 +++++++----------- librarian/pdf/wlpub.cls | 75 ++++++++++++++++++----------------- 6 files changed, 101 insertions(+), 72 deletions(-) diff --git a/librarian/epub.py b/librarian/epub.py index 223bde9..17550b2 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -506,14 +506,14 @@ def transform(wldoc, verbose=False, zip.writestr('OPS/annotations.html', etree.tostring( html_tree, method="html", pretty_print=True)) - toc.add("Weprzyj Wolne Lektury", "support.html") - manifest.append(etree.fromstring( - '')) - spine.append(etree.fromstring( - '')) - html_string = open(get_resource('epub/support.html')).read() - chars.update(used_chars(etree.fromstring(html_string))) - zip.writestr('OPS/support.html', html_string) + # toc.add("Weprzyj Wolne Lektury", "support.html") + # manifest.append(etree.fromstring( + # '')) + # spine.append(etree.fromstring( + # '')) + # html_string = open(get_resource('epub/support.html')).read() + # chars.update(used_chars(etree.fromstring(html_string))) + # zip.writestr('OPS/support.html', html_string) toc.add("Strona redakcyjna", "last.html") manifest.append(etree.fromstring( diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl index e8a5af6..52da004 100644 --- a/librarian/epub/xsltScheme.xsl +++ b/librarian/epub/xsltScheme.xsl @@ -136,9 +136,15 @@ + + +

+ + - +

@@ -212,6 +218,35 @@ + +
    + +
+
+ + +
  • +
    + + + + + + + + + + + + + + + + + + + + diff --git a/librarian/epub/xsltTitle.xsl b/librarian/epub/xsltTitle.xsl index cc006f2..e8a3bf4 100644 --- a/librarian/epub/xsltTitle.xsl +++ b/librarian/epub/xsltTitle.xsl @@ -52,13 +52,13 @@

    -

    + + - - + --> + + \def\coverby{ @@ -110,6 +92,7 @@ + @@ -268,9 +251,14 @@ + + + match="naglowek_akt|naglowek_czesc|srodtytul|naglowek_osoba|naglowek_podrozdzial|naglowek_scena|naglowek_rozdzial|miejsce_czas|didaskalia|lista_osoba|akap|akap_dialog|akap_cd|motto_podpis|naglowek_listy|lista"> + + + @@ -381,6 +369,9 @@ + + + diff --git a/librarian/pdf/wlpub.cls b/librarian/pdf/wlpub.cls index 4ed3d0e..5c2265e 100644 --- a/librarian/pdf/wlpub.cls +++ b/librarian/pdf/wlpub.cls @@ -19,6 +19,7 @@ \RequirePackage{amsmath} \RequirePackage{paralist} \RequirePackage[normalem]{ulem} +\RequirePackage{xifthen} %\DeclareOption{13pt}{% %\AtEndOfClass{% % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ @@ -150,15 +151,14 @@ Mapping=tex-text } \makeatother - -\renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont} \setlength{\parindent}{4mm} \setlength{\parskip}{0mm} -\renewcommand{\large}{\fontsize{14}{14.28}\selectfont} % srodtytul -\renewcommand{\small}{\fontsize{8}{14.28}\selectfont} % paginy -\renewcommand{\Large}{\fontsize{15}{21.42}\selectfont} % tytuł rozdziału -\renewcommand{\huge}{\fontsize{18}{21.6}\selectfont} % wyimek +\renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont} +\renewcommand{\large}{\fontsize{14}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont} % srodtytul +\renewcommand{\small}{\fontsize{8}{14.28}\addfontfeature{LetterSpace=0.5}\selectfont} % paginy +\renewcommand{\Large}{\fontsize{15}{21.42}\addfontfeature{LetterSpace=0.1}\selectfont} % tytuł rozdziału +\renewcommand{\huge}{\fontsize{18}{21.6}\addfontfeature{LetterSpace=0.1}\selectfont} % wyimek \renewcommand{\Huge}{\fontsize{24}{40}\selectfont} % cover \renewcommand{\footnotesize}{\fontsize{9}{10.74}\selectfont} @@ -191,7 +191,7 @@ Mapping=tex-text \makeatother %%%%%%%%%%%%%%%%%%%%%% Section title styles. -%% Sections +%% Chapters \titleformat{\chapter}[block]% {\Large\intro\addfontfeature{LetterSpace=0.5,Kerning={Uppercase}}}% {}{0pt}{\parbox{80mm}{\raggedright\MakeUppercase{#1}}} @@ -200,7 +200,7 @@ Mapping=tex-text \setlength{\chapterspaceafter}{14\baselineskip-14pt}%\f@size of large \titlespacing*{\chapter}{0pt}{\chapterposcorrection}{\chapterspaceafter} -%% Subsections +%% Sections \titleformat{\section}% {\addfontfeature{LetterSpace=0.3}\large}% {\thesection}{.5em}{\MakeUppercase{#1}} @@ -267,7 +267,7 @@ Mapping=tex-text \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}} -\newcommand{\makecover}{ +\newcommand{\makecover}[2]{ %\pdfpagewidth=#1 %\pdfpageheight=#2 @@ -291,10 +291,16 @@ Mapping=tex-text \noindent\hspace*{-\PictHOffset}% \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% \includegraphics[height=\paperheight,width=\paperwidth]{cover.jpg}}} + + + } + + + +\renewcommand{\maketitle}{ \newpage %\vspace{\paperheight} - \thispagestyle{empty} \begin{center} \intro @@ -321,35 +327,27 @@ Mapping=tex-text \includegraphics[scale=.2]{logo.eps} \end{center} - \newpage - \thispagestyle{empty} - - \input{editorial} - - - } - - - -\renewcommand{\maketitle}{ - { - \thispagestyle{empty} - \footnotesize - \color{theme} - \noindent \rule{\linewidth}{0.4pt} - - \vspace{.6em} - \color{black} - } } \newcommand{\editorialsection}{ + \newpage + \thispagestyle{empty} +} +\renewcommand*\contentsname{Table of Contents} +\newcommand{\spistresci}{ +{ + \intro + \setcounter{tocdepth}{0} + \tableofcontents + \newpage +} } + \newcommand{\tytul}[1]{% #1% \vspace{1em}% @@ -469,7 +467,7 @@ Mapping=tex-text } \newcommand{\naglowekrozdzial}[1]{% -\chapter{#1\theautorrozdzialu{}}\renewcommand{\theautorrozdzialu}{}% +\chapter[#1]{#1\theautorrozdzialu{}}\renewcommand{\theautorrozdzialu}{}% } \newcommand{\naglowekosoba}[1]{% @@ -568,12 +566,17 @@ Mapping=tex-text \vspace{10pt}% } -\newcommand{\ilustr}[2]{ - \vspace{1em}% +\newcommand{\ilustrscale}[0]{1} +\newcommand{\setilustrscale}[1]{\renewcomand{\ilustrscale}{#1}} + +\newcommand{\ilustr}[3][]{ + \vspace{2\baselineskip}% \begin{center}% - \par{\includegraphics[width=\textwidth]{\trimspace{#1}}\\#2}% + \ifthenelse{\isempty{#1}}% + {\par{\includegraphics{\trimspace{#2}}\\#3}}% + {\par{\includegraphics[#1]{\trimspace{#2}}\\#3}}% \end{center}% - \vspace{1em}% + \vspace{2\baselineskip}% } @@ -601,5 +604,5 @@ Mapping=tex-text } \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}} -\newcommand{\www}[1]{\url{#1}} +\newcommand{\www}[1]{{\normalfont\small\url{#1}}} -- 2.20.1