]> pere.pagekite.me Git - text-mekanikerord.git/blob - pdf.xsl
Update epub cover images.
[text-mekanikerord.git] / pdf.xsl
1 <?xml version='1.0' encoding="UTF-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3
4 <!-- xsl:param name="paper.type">a4</xsl:param -->
5 <xsl:param name="double.sided">1</xsl:param>
6 <xsl:param name="page.width">6in</xsl:param>
7 <xsl:param name="page.height">9in</xsl:param>
8 <xsl:param name="page.margin.inner">0.75in</xsl:param>
9 <xsl:param name="page.margin.outer">0.50in</xsl:param>
10 <xsl:param name="page.margin.top">0.55in</xsl:param>
11 <xsl:param name="page.margin.bottom">0.55in</xsl:param>
12 <xsl:param name="latex.class.book">book</xsl:param>
13 <xsl:param name="latex.class.options">a4paper,openright,twoside</xsl:param>
14
15 <!-- No use showing table of content, it is empty -->
16 <xsl:param name="doc.toc.show">0</xsl:param>
17
18 <!-- no need for a separate author list -->
19 <xsl:param name="doc.collab.show">0</xsl:param>
20
21 <!-- disable revision history until there is a history to display -->
22 <xsl:param name="latex.output.revhistory">0</xsl:param>
23
24 <!-- enable draft mode until ready to publish -->
25 <xsl:param name="draft.mode">no</xsl:param>
26 <xsl:param name="draft.watermark">0</xsl:param>
27
28 <!-- insert a few latex tricks at the top of the .tex document -->
29 <xsl:param name="latex.begindocument">
30 <xsl:text>% start of latex.begindocument
31 \usepackage{multicol}
32
33 % unboxed = wrap glossary term
34 % multicols = get two columns only in mainpart
35 \setlist[description]{%
36 style=unboxed,
37 before*=\begin{multicols}{2},
38 after*=\end{multicols}
39 % first*=
40 % topsep=30pt, % space before start / after end of list
41 % itemsep=5pt, % space between items
42 % font=\normalfont,
43 }
44
45 % Trick to avoid many words sticking out of the right margin of the text.
46 \sloppy
47
48 % The microtype package provides the ability to micromanage your
49 % typography. When invoked without any options it does some nice things
50 % like protruding punctuation over the edge of the right margin to make
51 % the margin appear smoother. Basically it makes your book look more
52 % professional with very little effort. It also has a ton of options if
53 % you want to micromanage even more.
54 \usepackage{microtype}
55
56 % Disable headers and footer texts
57 \pagestyle{myheadings}
58
59 \def\DBKpublisher{Petter Reinholdtsen \\ Oslo}
60
61 % Cludge to replace DBKcover \def in
62 % /usr/share/texmf/tex/latex/dblatex/style/dbk_title.sty where author
63 % and publisher is missing
64 \def\DBKcover{
65 \ifthenelse{\equal{\DBKedition}{}}{\def\edhead{}}{\def\edhead{Ed. \DBKedition}}
66 % interligne double
67 \setlength{\oldbaselineskip}{\baselineskip}
68 \setlength{\baselineskip}{2\oldbaselineskip}
69 \textsf{
70 \vfill
71 \vspace{2.5cm}
72 \begin{center}
73 \huge{\textbf{\DBKtitle}}\\ %
74 \ifx\DBKsubtitle\relax\else%
75 \underline{\ \ \ \ \ \ \ \ \ \ \ }\\ %
76 \ \\ %
77 \huge{\textbf{\DBKsubtitle}}\\ %
78 \fi
79 \ \\ %
80 % \huge{\editor} \\%
81 \end{center}
82 \vfill
83 \setlength{\baselineskip}{\oldbaselineskip}
84 \hspace{1cm}
85 \vspace{1cm}
86 \begin{center}
87 \Large{\DBKpublisher} \\
88 \end{center}
89 }
90 %
91 \newcommand{\sectionline}{%
92 \nointerlineskip \vspace{\baselineskip}%
93 \hspace{\fill}\rule{0.5\linewidth}{.7pt}\hspace{\fill}%
94 \par\nointerlineskip \vspace{\baselineskip}%
95 }%
96 %
97 % Format for the other pages
98 \newpage
99 \setlength{\baselineskip}{\oldbaselineskip}
100 \lfoot[]{}
101 }
102
103 \begin{document}
104 % end of latex.begindocument
105 </xsl:text>
106 </xsl:param>
107
108 <!-- disable chapter numbering for glossary -->
109 <xsl:param name="glossary.numbered">0</xsl:param>
110
111 <!-- disable chapter numbering for index -->
112 <xsl:param name="index.numbered">0</xsl:param>
113
114 <xsl:param name="local.l10n.xml" select="document('')"/>
115 <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
116 <l:l10n language="nb">
117 <!-- Fix bugs in default nb locale -->
118 <l:dingbat key="startquote" text="«"/>
119 <l:dingbat key="endquote" text="»"/>
120 <l:dingbat key="nestedstartquote" text="‘"/>
121 <l:dingbat key="nestedendquote" text="’"/>
122 <l:gentext key="Copyright" text=""/>
123 </l:l10n>
124 <l:l10n language="nn">
125 <!-- Fix bugs in default nn locale -->
126 <l:dingbat key="startquote" text="«"/>
127 <l:dingbat key="endquote" text="»"/>
128 <l:dingbat key="nestedstartquote" text="‘"/>
129 <l:dingbat key="nestedendquote" text="’"/>
130
131 <!--
132 Workaround for missing 'se' support in dblatex/docbook, use 'nn' as
133 replacement and rewrite the strings we use. Note PDF use some of
134 these, while HTML and ePub uses others.
135
136 A more future proof approach that would help others would be to submit
137 a se.xsl file to
138 https://github.com/docbook/xslt10-stylesheets/tree/master/gentext/locale .
139 -->
140 <l:gentext key="Editedby" text="Redigert av (se)"/>
141 <l:gentext key="Abstract" text="Čoahkkáigeassu"/>
142 <l:gentext key="TableofContents" text="Sisdoallu"/>
143 <l:gentext key="Copyright" text=""/>
144 <l:gentext key="Glossary" text="Sátnelistu"/>
145 <l:gentext key="glossary" text="Sátnelistu"/>
146 <l:gentext key="glosssee" text="Geahča"/>
147 <l:gentext key="GlossSee" text="Geahča"/>
148 <l:context name="glossary">
149 <l:template name="see" text="Geahča «%t»."/>
150 </l:context>
151 </l:l10n>
152 </l:i18n>
153
154 </xsl:stylesheet>