| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 4 |
<section id="sec-pub-output"> |
| 5 |
<title>Publishing Outputs</title> |
| 6 |
|
| 7 |
<section> |
| 8 |
<title>Publishing a single document</title> |
| 9 |
|
| 10 |
<para>The default publishing document units are: <sgmltag>article</sgmltag> |
| 11 |
and <sgmltag>book</sgmltag>. The output file name is optionnaly specified by |
| 12 |
the <option>-o</option> option.</para> |
| 13 |
|
| 14 |
<para>You can also publish an article or book subset, i.e. you can run dblatex |
| 15 |
on an XML input whose root element is a <sgmltag>chapter</sgmltag>, a |
| 16 |
<sgmltag>section</sgmltag>, or anything else. In this case, dblatex wraps the |
| 17 |
root element in an <sgmltag>article</sgmltag> or in a <sgmltag>book</sgmltag> |
| 18 |
and print out a warning. The output subset does not contain any front matter |
| 19 |
data found in an article or in a book (cover page, revision history, etc.), |
| 20 |
but it can contain some back matter materials like an index.</para> |
| 21 |
|
| 22 |
<programlisting>$ dblatex subset.xml |
| 23 |
Build the book set list... |
| 24 |
Build the listings... |
| 25 |
XSLT stylesheets DocBook - LaTeX 2e (0.2.11) |
| 26 |
=================================================== |
| 27 |
Warning: the root element is not an article nor a book |
| 28 |
Warning: element section(sec-subset) wrapped with article |
| 29 |
Build subset.pdf |
| 30 |
... |
| 31 |
</programlisting> |
| 32 |
</section> |
| 33 |
|
| 34 |
<section id="sec-book-set"> |
| 35 |
<title>Publishing a Set of Books</title> |
| 36 |
|
| 37 |
<para>When the document root element is a <sgmltag>set</sgmltag>, and when |
| 38 |
<parameter>set.book.num</parameter> is set to '<literal>all</literal>', |
| 39 |
dblatex ouputs a file per book contained in the set (and in the nested sets). |
| 40 |
In this case the <option>-o</option> option is ignored, and only the |
| 41 |
<option>-O</option> option is taken into account to specify the output |
| 42 |
directory that will contain the generated files.</para> |
| 43 |
|
| 44 |
<para>Instead of building all the books, the user can publish a single book |
| 45 |
from the set, by setting the <parameter>set.book.num</parameter> parameter to |
| 46 |
the absolute position of the book in the set(s). By default |
| 47 |
<parameter>set.book.num</parameter> is set to 1 to publish only the first |
| 48 |
book.</para> |
| 49 |
|
| 50 |
<para>The output file names are the book identifiers when |
| 51 |
<parameter>use.id.as.filename</parameter> is non zero, and when an identifier |
| 52 |
exists. If one of the two conditions are not met, the filename pattern is |
| 53 |
"<filename>book<replaceable><position in set></replaceable></filename>". |
| 54 |
</para> |
| 55 |
|
| 56 |
<para>Example: given the following set:</para> |
| 57 |
|
| 58 |
<para><programlisting language="XML"><?xml version="1.0" encoding="UTF-8"?> |
| 59 |
|
| 60 |
<!-- setfile.xml. An example of set. All the books have an @id except one --> |
| 61 |
|
| 62 |
<!DOCTYPE set PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
| 63 |
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
| 64 |
<set lang="en" id="a_set" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 65 |
<title>Set Title</title> |
| 66 |
<set> |
| 67 |
<xi:include href="book1.xml"/> <!-- book #1 --> |
| 68 |
<xi:include href="book2.xml"/> <!-- book #2 --> |
| 69 |
<xi:include href="book3.xml"/> <!-- book #3 --> |
| 70 |
</set> |
| 71 |
<set> |
| 72 |
<set> |
| 73 |
<xi:include href="bookA.xml"/> <!-- book #4 --> |
| 74 |
<xi:include href="bookB.xml"/> <!-- book #5 --> |
| 75 |
</set> |
| 76 |
<set> |
| 77 |
<xi:include href="bookC.xml"/> <!-- book #6 --> |
| 78 |
</set> |
| 79 |
</set> |
| 80 |
<set> |
| 81 |
<xi:include href="book4.xml"/> <!-- book #7 --> |
| 82 |
<!-- The following book, at 8th position in the sets, has no @id --> |
| 83 |
<xi:include href="book5.xml"/> <!-- book #8 --> |
| 84 |
<xi:include href="book6.xml"/> <!-- book #9 --> |
| 85 |
</set> |
| 86 |
</set></programlisting>Publishing this set produces 9 books in the |
| 87 |
<filename>pdfdir</filename> directory:</para> |
| 88 |
|
| 89 |
<programlisting>$ dblatex -O./pdfdir -Pset.book.num=all -Puse.id.as.filename=1 setfile.xml |
| 90 |
Build the book set list... |
| 91 |
Build the listings... |
| 92 |
XSLT stylesheets DocBook - LaTeX 2e (0.2.11) |
| 93 |
=================================================== |
| 94 |
Output all the books from the set |
| 95 |
Writing sec1-mybook.rtex for book(sec1-mybook) |
| 96 |
Writing sec2-mybook.rtex for book(sec2-mybook) |
| 97 |
Writing sec3-mybook.rtex for book(sec3-mybook) |
| 98 |
Writing secA-mybook.rtex for book(secA-mybook) |
| 99 |
Writing book8.rtex for book |
| 100 |
Writing secC-mybook.rtex for book(secC-mybook) |
| 101 |
Writing sec4-mybook.rtex for book(sec4-mybook) |
| 102 |
Writing sec5-mybook.rtex for book(sec5-mybook) |
| 103 |
Writing sec6-mybook.rtex for book(sec6-mybook) |
| 104 |
... |
| 105 |
Files successfully built in '/path/to/set/pdfdir': |
| 106 |
sec1-mybook.pdf |
| 107 |
sec2-mybook.pdf |
| 108 |
sec3-mybook.pdf |
| 109 |
sec4-mybook.pdf |
| 110 |
book8.pdf |
| 111 |
sec6-mybook.pdf |
| 112 |
secA-mybook.pdf |
| 113 |
secB-mybook.pdf |
| 114 |
secC-mybook.pdf</programlisting> |
| 115 |
|
| 116 |
<para></para> |
| 117 |
</section> |
| 118 |
</section> |