]> pere.pagekite.me Git - text-madewithcc.git/commitdiff
Place colophon page in PDF on title verso page.
authorPetter Reinholdtsen <pere@hungry.com>
Sun, 25 Feb 2018 08:17:16 +0000 (08:17 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Sun, 25 Feb 2018 08:17:16 +0000 (08:17 +0000)
This involve switching form pdflatex to xetex called by dblatex,
to get \maketitle to find the titlepg.input.rtex file generated
by dblatex when processing the DocBook content.

Makefile
extra/pdf.xsl
myclass.cls

index 2ba21a320c1900df6c514d0bc9c5a931fab1e562..69d4b644f390fac14248605b40fcb9153b5f618f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -95,9 +95,9 @@ pdf: $(SOURCE).pdf
        for LANG in $(LANGS); do \
            $(MAKE) $(SOURCE).$$LANG.pdf ; \
        done
        for LANG in $(LANGS); do \
            $(MAKE) $(SOURCE).$$LANG.pdf ; \
        done
-%.pdf: %.tex
-       pdflatex $^
-       pdflatex $^
+DBLATEX_OPTS = -T simple -t pdf -b xetex -p extra/pdf.xsl
+%.pdf: %.xml
+       dblatex $(DBLATEX_OPTS) $^
 
 epub: $(SOURCE).epub
        for LANG in $(LANGS); do \
 
 epub: $(SOURCE).epub
        for LANG in $(LANGS); do \
@@ -106,13 +106,6 @@ epub: $(SOURCE).epub
 %.epub: %.xml
        dbtoepub $^
 
 %.epub: %.xml
        dbtoepub $^
 
-DBLATEX_OPTS = -T simple -t tex -b xetex -p extra/pdf.xsl
-# 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 $(DBLATEX_OPTS) $^
-       perl -p -i -e 's/ / /g' $@
-
 XMLLINTOPTS = --nonet --noout  --xinclude --postvalid
 lint: $(SOURCE).xml
        xmllint $(XMLLINTOPTS) $^
 XMLLINTOPTS = --nonet --noout  --xinclude --postvalid
 lint: $(SOURCE).xml
        xmllint $(XMLLINTOPTS) $^
index 60e8c092ca9ca01ec94b468064a38c8ccbc76eb5..281bc02b13978026fb992bea50eead5188a5e745 100644 (file)
@@ -37,4 +37,25 @@ extended distribution with LuLu.
     </xsl:text>
   </xsl:param>
 
     </xsl:text>
   </xsl:param>
 
+  <!-- Place title verso page behind the title page the hard way: put
+       colophon content in a file loaded by \maketitle -->
+  <xsl:template match="colophon">
+    <xsl:variable name="titlepage.verso">
+      <xsl:text>\begin{colophon}&#10;</xsl:text>
+      <xsl:apply-templates/>
+      <xsl:text>\end{colophon}&#10;</xsl:text>
+    </xsl:variable>
+    <xsl:call-template name="write.text.chunk">
+      <!-- The filename must end with 'input.rtex' to be parsed by dblatex -->
+      <xsl:with-param name="filename">
+       <xsl:text>titlepg.input.rtex</xsl:text>
+      </xsl:with-param>
+      <xsl:with-param name="method" select="'text'"/>
+      <xsl:with-param name="content">
+       <xsl:value-of select="$titlepage.verso"/>
+      </xsl:with-param>
+      <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
+    </xsl:call-template>
+  </xsl:template>
+
 </xsl:stylesheet>
 </xsl:stylesheet>
index c77bc96f4dc60b5cb4801839264868c82dc69185..e7f2f018b16f515dc6738bc229ae158b7b4b6780 100644 (file)
   \def\titlepagefile{titlepg.input.tex}
   \IfFileExists{\titlepagefile}{\input{\titlepagefile}}{}
 }%
   \def\titlepagefile{titlepg.input.tex}
   \IfFileExists{\titlepagefile}{\input{\titlepagefile}}{}
 }%
+
+\newenvironment{colophon}{
+  \pagebreak %
+% FIXME change when page size changes, use {x}{x*1.2}
+
+% Note, these numbers are not correct any more for the sizes mentioned:
+%  \fontsize{6.5}{7.8}\selectfont % fits in one 4.25x6.875" pocket size page
+%  \fontsize{7.5}{9}\selectfont % fits in one 5.06x7.71" size page
+%  \fontsize{9.1}{10.92}\selectfont % fits in one 5.5x8.5" digest size page
+
+  \fontsize{8.2}{9.84}\selectfont % fits in one 6x9'' size page
+  \setlength{\parskip}{0.5em} %
+  \setlength{\parindent}{0pt} %
+}{}