]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Change dblatex template to simple and replace title page with one only listing title...
authorPetter Reinholdtsen <pere@hungry.com>
Thu, 1 Feb 2018 21:10:27 +0000 (22:10 +0100)
committerPetter Reinholdtsen <pere@hungry.com>
Thu, 22 Feb 2018 18:12:09 +0000 (18:12 +0000)
Makefile
extra/pdf.xsl [new file with mode: 0644]
myclass.cls [new file with mode: 0644]

index 70afb1108a7d2036fe50e0aa3a1f7caafa8bfe9d..a6aaf4fb4355ccf5d98e35958e87231f63ad120d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,10 +10,6 @@ SOURCE=MadewithCreativeCommonsmostup-to-dateversion
 # increase every time the generated Markdown is modified.
 VERSION=20170609-2
 
-TEXLANGCODE=es
-
-#TEXLANGCODE=nb
-
 # pandoc version 1.17.2~dfsg-3 do not understand
 # --top-level-diversion, while version 1.19.2.4~dfsg-1+b3 do.
 PANDOC_OPTS = \
@@ -85,11 +81,10 @@ epub: $(SOURCE).epub
 # Replace Unicode Hair Space (U+200A) with space, as &hairsp; is not
 # handled by LaTeX/dblatex, see <URL: https://bugs.debian.org/889603 >.
 %.tex: %.xml
-       dblatex -t tex -b xetex $^
+       dblatex -T simple -t tex -b xetex -p extra/pdf.xsl $^
        perl -p -i -e 's/\[latin1\]\{inputenc\}/[utf8]{inputenc}/; \
                s/\\caption\\end/\\caption{} \\end/; \
                s/ / /g; \
-               s!\\maketitle!\\input{extra/$(TEXLANGCODE)/cover.tex}!; \
                s/\\listoffigures//; \
                s/\\chapter\{(Colophon|Dedication)\}/\\chapter*{}/; \
                s/\\chapter\{(Foreword|Prefacio|Forord|Introduction|Introducción|Introduksjon)\}/\\chapter*{$$1} \\addcontentsline{toc}{chapter}{$$1}/; \
diff --git a/extra/pdf.xsl b/extra/pdf.xsl
new file mode 100644 (file)
index 0000000..3fe57f3
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version='1.0' encoding="iso-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
+
+  <xsl:param name="latex.class.book">myclass</xsl:param>
+<!--
+  <xsl:param name="page.width">6in</xsl:param>
+  <xsl:param name="page.height">9in</xsl:param>
+  -->
+  <xsl:param name="page.margin.inner">0.8in</xsl:param>
+  <xsl:param name="page.margin.outer">0.55in</xsl:param>
+
+  <xsl:param name="page.margin.top">0.05in</xsl:param>
+  <xsl:param name="page.margin.bottom">0.15in</xsl:param>
+
+  <xsl:param name="double.sided">1</xsl:param>
+  <xsl:param name="latex.class.options">openright,twoside</xsl:param>
+
+<!--
+Make final page blank, which is required for PDFs inteneded for
+extended distribution with LuLu.
+-->
+
+  <xsl:param name="latex.enddocument">
+    <xsl:text>\pagebreak
+\thispagestyle{empty}
+~
+\end{document}
+    </xsl:text>
+  </xsl:param>
+
+</xsl:stylesheet>
diff --git a/myclass.cls b/myclass.cls
new file mode 100644 (file)
index 0000000..c77bc96
--- /dev/null
@@ -0,0 +1,39 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{myclass}[]
+
+%% Just use the original class and pass the options
+\LoadClassWithOptions{report}
+
+\makeatletter
+
+%
+% Customize the titlepage: remove the date, place the publisher name, and
+% load a specific file for the verso page, containing some legal notices
+%
+\def\maketitle{%
+  \titlerecto%
+  \titleverso}
+
+\def\titlerecto{\begin{titlepage}%
+  \null\vfil
+  \vskip 160\p@
+  \begin{center}%
+    {\LARGE \@title \par}%
+    \vskip 3em%
+    {\Large
+     \lineskip .75em%
+      \begin{tabular}[t]{c}%
+        \@author
+      \end{tabular}\par}%
+      \vskip 20em%
+    {\large \DBKpublishername \par}
+    \vskip .75em%
+    {\large \DBKpublisheraddress \par}%
+  \end{center}\par
+  \vfil\null
+  \end{titlepage}}%
+
+\def\titleverso{%
+  \def\titlepagefile{titlepg.input.tex}
+  \IfFileExists{\titlepagefile}{\input{\titlepagefile}}{}
+}%