<p:declare-stepxmlns:p="http://www.w3.org/ns/xproc"xmlns:px="http://www.daisy.org/ns/pipeline/xproc"xmlns:pf="http://www.daisy.org/ns/pipeline/functions"xmlns:cx="http://xmlcalabash.com/ns/extensions"version="1.0"type="px:dtbook-to-latex.script"px:input-filesets="dtbook"px:output-filesets="latex">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h1px:role="name">DTBook to LaTeX</h1><ppx:role="desc">Transforms a DTBook (DAISY 3 XML) document into a LaTeX document.</p>
<apx:role="homepage"href="http://daisy.github.io/pipeline/Get-Help/User-Guide/Scripts/dtbook-to-latex/">
Online documentation
</a>
</p:documentation>
<p:inputport="source"primary="true"px:media-type="application/x-dtbook+xml">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">DTBook</h2><ppx:role="desc">The DTBook 2005 XML file.</p>
</p:documentation>
</p:input><p:optionname="font-size"required="false"select="'17pt'">
<p:documentation>
<h2px:role="name">Font size</h2><ppx:role="desc"xml:space="preserve">Font size for the generated LaTeX.
See also the documentation of the [extsizes
package](http://www.ctan.org/tex-archive/macros/latex/contrib/extsizes).</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choice>
<value>12pt</value>
<value>14pt</value>
<value>17pt</value>
<value>20pt</value>
<value>25pt</value>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="font"required="false"select="'LMRoman10 Regular'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Font</h2><ppx:role="desc">Font for the generated LaTeX. This can be any installed TrueType or OpenType font (e.g. "Tiresias LPfont", "Latin Modern Roman").</p>
</p:documentation>
</p:option><p:optionname="backup-font"required="false"select="'Arial Unicode MS'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Backup font</h2><ppx:role="desc"xml:space="preserve">Optional secondary font for specific Unicode ranges (see backup-unicode-ranges).
Requires the [ucharclasses package](http://ctan.org/tex-archive/macros/xetex/latex/ucharclasses).</p>
</p:documentation>
</p:option><p:optionname="backup-unicode-ranges"required="false"select="''"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Backup Unicode ranges</h2><ppx:role="desc">Comma-separated list of Unicode ranges (camel case) for which the backup font is used, e.g. "Arabic,Hebrew,Cyrillic,GreekAndCoptic".</p>
</p:documentation>
</p:option><p:optionname="page-style"required="false"select="'plain'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Page style</h2><ppx:role="desc">Page style for the generated LaTeX.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choice>
<value>plain</value>
<value>compact</value>
<value>spacious</value>
<value>withPageNums</value>
<value>scientific</value>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="alignment"required="false"select="'justified'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Alignment</h2><ppx:role="desc">Alignment for standard text.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choice>
<value>justified</value>
<value>left</value>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="default-language"required="false"select="'english'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Default language</h2><ppx:role="desc"xml:space="preserve">Language for the babel package when no xml:lang attribute is present.
See the [babel user guide](http://texdoc.net/pkg/babel) for all valid values.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choicexmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<value>english</value>
<a:documentationxml:lang="en">English</a:documentation>
<value>ngerman</value>
<a:documentationxml:lang="en">German (new/reformed orthography, post-1996)</a:documentation>
<value>USenglish</value>
<a:documentationxml:lang="en">English (American)</a:documentation>
<value>UKenglish</value>
<a:documentationxml:lang="en">English (British)</a:documentation>
<value>swedish</value>
<a:documentationxml:lang="en">Swedish</a:documentation>
<value>canadian</value>
<a:documentationxml:lang="en">English (Canadian)</a:documentation>
<value>french</value>
<a:documentationxml:lang="en">French</a:documentation>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="stock-size"required="false"select="'a4paper'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Stock size</h2><ppx:role="desc">Stock size for the generated LaTeX.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choicexmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<value>a3paper</value>
<a:documentationxml:lang="en">ISO 216 A3 paper size</a:documentation>
<value>a4paper</value>
<a:documentationxml:lang="en">ISO 216 A4 paper size</a:documentation>
<value>a5paper</value>
<a:documentationxml:lang="en">ISO 216 A5 paper size</a:documentation>
<value>letterpaper</value>
<a:documentationxml:lang="en">Letter paper size (11 in × 8.5 in)</a:documentation>
<value>legalpaper</value>
<a:documentationxml:lang="en">Legal paper size (14 in × 8.5 in)</a:documentation>
<value>executivepaper</value>
<a:documentationxml:lang="en">Legal paper size (10.5 in × 7.25 in)</a:documentation>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="line-spacing"required="false"select="'singlespacing'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Line spacing</h2><ppx:role="desc">Line spacing in the generated LaTeX.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choice>
<value>singlespacing</value>
<value>onehalfspacing</value>
<value>doublespacing</value>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="paper-width"required="false"select="'200mm'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Paper width</h2><ppx:role="desc">Width of the paper (e.g. "200mm").</p>
</p:documentation>
</p:option><p:optionname="paper-height"required="false"select="'250mm'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Paper height</h2><ppx:role="desc">Height of the paper (e.g. "250mm").</p>
</p:documentation>
</p:option><p:optionname="left-margin"required="false"select="'28mm'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Left margin</h2><ppx:role="desc">Inner (left) margin of the page (e.g. "28mm").</p>
</p:documentation>
</p:option><p:optionname="right-margin"required="false"select="'20mm'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Right margin</h2><ppx:role="desc">Outer (right) margin of the page (e.g. "20mm").</p>
</p:documentation>
</p:option><p:optionname="top-margin"required="false"select="'20mm'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Top margin</h2><ppx:role="desc">Top margin of the page (e.g. "20mm").</p>
</p:documentation>
</p:option><p:optionname="bottom-margin"required="false"select="'20mm'"px:type="string">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Bottom margin</h2><ppx:role="desc">Bottom margin of the page (e.g. "20mm").</p>
</p:documentation>
</p:option><p:optionname="replace-em-with-quote"required="false"px:type="boolean"select="'false'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Replace emphasis with quotes</h2><ppx:role="desc"xml:space="preserve">Replace em elements with quoted text.
Emphasis can be hard to render in large print.</p>
</p:documentation>
</p:option><p:optionname="endnotes"required="false"select="'none'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Endnotes</h2><ppx:role="desc">Put notes at the end of the chapter or document instead of as footnotes on the same page.</p>
</p:documentation>
<p:pipeinfo>
<px:type>
<choice>
<value>none</value>
<value>document</value>
<value>chapter</value>
</choice>
</px:type>
</p:pipeinfo>
</p:option><p:optionname="include-images"required="false"px:type="boolean"select="'true'">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">Include Images</h2><ppx:role="desc">Whether to include or ignore images in the LaTeX output.</p>
</p:documentation>
</p:option><p:optionname="result"px:output="result"px:type="anyDirURI"px:media-type="application/x-latex"required="true">
<p:documentationxmlns="http://www.w3.org/1999/xhtml">
<h2px:role="name">LaTeX</h2><ppx:role="desc">The output LaTeX document.</p>
</p:documentation>
</p:option>
<cx:importhref="http://www.daisy.org/pipeline/modules/file-utils/library.xsl"type="application/xslt+xml">
<p:documentation>
pf:normalize-uri
</p:documentation>
</cx:import>
<p:variablename="base-name"select="replace(replace(base-uri(/),'^.*/([^/]+)$','$1'),'\.[^\.]*$','')">
<p:documentation>File name without extension</p:documentation>
</p:variable>
<p:xslt>
<p:inputport="stylesheet">
<p:documenthref="dtbook-to-latex.xsl"/>
</p:input>
<p:with-paramname="fontsize"select="$font-size"/>
<p:with-paramname="font"select="$font"/>
<p:with-paramname="backupFont"select="$backup-font"/>
<p:with-paramname="backupUnicodeRanges"select="$backup-unicode-ranges"/>
<p:with-paramname="pageStyle"select="$page-style"/>
<p:with-paramname="alignment"select="$alignment"/>
<p:with-paramname="defaultLanguage"select="$default-language"/>
<p:with-paramname="stocksize"select="$stock-size"/>
<p:with-paramname="line_spacing"select="$line-spacing"/>
<p:with-paramname="paperwidth"select="$paper-width"/>
<p:with-paramname="paperheight"select="$paper-height"/>
<p:with-paramname="left_margin"select="$left-margin"/>
<p:with-paramname="right_margin"select="$right-margin"/>
<p:with-paramname="top_margin"select="$top-margin"/>
<p:with-paramname="bottom_margin"select="$bottom-margin"/>
<p:with-paramname="replace_em_with_quote"select="$replace-em-with-quote"/>
<p:with-paramname="endnotes"select="$endnotes"/>
<p:with-paramname="include_images"select="$include-images"/>
<p:with-paramname="version"select="'${project.version}'"/>
</p:xslt>
<p:storemethod="text">
<p:with-optionname="href"select="pf:normalize-uri(concat($result,'/',$base-name,'.tex'))"/>
</p:store>
</p:declare-step>