From: Petter Reinholdtsen Date: Sat, 6 Mar 2021 13:50:03 +0000 (+0100) Subject: Added build rules for PDF and ePub editions. X-Git-Url: https://pere.pagekite.me/gitweb/text-epistlene.git/commitdiff_plain/884f3b5532818e9d0cf57edfc79f8ff6d04d7902?ds=sidebyside Added build rules for PDF and ePub editions. --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d2f199c --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +SOURCE = gaysir_epistlene + +PANDOC_OPTS = \ + -t docbook4 + +DBLATEX_OPTS = \ + -p pdf.xsl + +all: $(SOURCE).pdf $(SOURCE).epub + +$(SOURCE).xml: $(SOURCE)-body.xml Makefile book.xml bookinfo.xml + xmllint --nonet --xinclude --postvalid book.xml > $@.new && \ + mv $@.new $@ + +$(SOURCE).pdf: $(SOURCE).xml Makefile pdf.xsl + dblatex $(DBLATEX_OPTS) $(SOURCE).xml -o $@ + +$(SOURCE)-body.xml: $(SOURCE).rst Makefile + pandoc -s -o $@ $(PANDOC_OPTS) $(SOURCE).rst + sed -i \ + -e 's%.*%%g' \ + -e 's%“%%g' \ + -e 's%”%%g' $@ + +.xml.epub: + dbtoepub -s epub.xsl $^ -o $@ + +.SUFFIXES: .xml .html .pdf .epub diff --git a/book.xml b/book.xml new file mode 100644 index 0000000..fb30976 --- /dev/null +++ b/book.xml @@ -0,0 +1,10 @@ + + + + +
+ + +
diff --git a/bookinfo.xml b/bookinfo.xml new file mode 100644 index 0000000..6bfcb56 --- /dev/null +++ b/bookinfo.xml @@ -0,0 +1,68 @@ + + Gaysir-epistlene + + + + + Sylvia + Johnsen + + + + Petter Reinholdtsen +
Oslo
+
+ + + 2021 + Sylvia Johnsen + + + + + Gaysir-epistlene av Sylvia Johnsen. + + + Utgitt av Petter Reinholdtsen. + + + + . + + + + ISBN 978-82-93828-XX-X (paperback) + + + ISBN 978-82-93828-XX-X (ePub) + + + + Denne boken kan kjøpes fra + . + + + + + + + + + + + + Creative Commons, Some rights reserved + + + + + + This book is licensed under a Creative Commons license. This + license permits any use of this work, so long as attribution is + given and no derivatived material is distributed. For more + information about the license visit . + + + +
diff --git a/epub.xsl b/epub.xsl new file mode 100644 index 0000000..2e00256 --- /dev/null +++ b/epub.xsl @@ -0,0 +1,5 @@ + + + + + diff --git a/images/cc-some-rights-reserved.png b/images/cc-some-rights-reserved.png new file mode 100644 index 0000000..58eb423 Binary files /dev/null and b/images/cc-some-rights-reserved.png differ diff --git a/images/cc-some-rights-reserved.svg b/images/cc-some-rights-reserved.svg new file mode 100644 index 0000000..71b3ad8 --- /dev/null +++ b/images/cc-some-rights-reserved.svg @@ -0,0 +1,107 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/pdf.xsl b/pdf.xsl new file mode 100644 index 0000000..c40ae1c --- /dev/null +++ b/pdf.xsl @@ -0,0 +1,104 @@ + + + + + book} +\usepackage[hyphens]{url + article} +\usepackage[hyphens]{url + + a4paper,openright,twoside + 6in + 9in + 0.8in + 0.55in + 0.55in + 0.55in + 1 + 1 + 1 + 0 + 0 + 0 + yes + 1 + 0 + + + + linktocpage,colorlinks,linkcolor=black,urlcolor=black,pdfstartview=FitH + + + + % start of latex.begindocument + +% Trick to avoid many words sticking out of the right margin of the text. +\sloppy + +% The microtype package provides the ability to micromanage your +% typography. When invoked without any options it does some nice things +% like protruding punctuation over the edge of the right margin to make +% the margin appear smoother. Basically it makes your book look more +% professional with very little effort. It also has a ton of options if +% you want to micromanage even more. +\usepackage{microtype} + +% Disable headers and footer texts +\pagestyle{myheadings} + +\def\DBKpublisher{Petter Reinholdtsen \\ Oslo} + +% Cludge to replace DBKcover \def in +% /usr/share/texmf/tex/latex/dblatex/style/dbk_title.sty where author +% and publisher is missing +\def\DBKcover{ +\ifthenelse{\equal{\DBKedition}{}}{\def\edhead{}}{\def\edhead{Ed. \DBKedition}} +% interligne double +\setlength{\oldbaselineskip}{\baselineskip} +\setlength{\baselineskip}{2\oldbaselineskip} +\textsf{ +\vfill +\vspace{2.5cm} +\begin{center} + \huge{\textbf{\DBKtitle}}\\ % + \ifx\DBKsubtitle\relax\else% + \underline{\ \ \ \ \ \ \ \ \ \ \ }\\ % + \ \\ % + \huge{\textbf{\DBKsubtitle}}\\ % + \fi + \ \\ % + \huge{\DBKauthor} \\% +\end{center} +\vfill +\setlength{\baselineskip}{\oldbaselineskip} +\hspace{1cm} +\vspace{1cm} +\begin{center} +\Large{\DBKpublisher} \\ +\end{center} +} + +% Format for the other pages +\newpage +\setlength{\baselineskip}{\oldbaselineskip} +\lfoot[]{} +} + +\begin{document} +% end of latex.begindocument + + + + + + + + + + + + + + + +