7.5. Element book

Specifies a complete ebook.

Content model

(headcommon? , 
 head? , 
 body? , 
 related* , 
 frontmatter? , 
 ((part+ , appendices?) | 
  (chapter+ , appendix*)) , 
 backmatter?)

Attributes

Name Data type Default value
adjustuserheadings boolean "true"
appendicestocdepth nonNegativeInteger "0"
appendixnumber normalizedString "%A"
appendixtocdepth nonNegativeInteger "0"
booklistlabels none | all |
(part | chapter | appendix | section | figure | table | example | equation)+
"none"
chapternumber normalizedString "%1"
chaptertocdepth nonNegativeInteger "0"
equationnumber normalizedString "%n-%1"
examplenumber normalizedString "%n-%1"
figurenumber normalizedString "%n-%1"
footnotenumber normalizedString "[%1]"
headoverridedefault boolean "false"
href anyURI
min. length: 1
 
includebasestylesheet boolean "false"
labelseparator normalizedString ""
pagename token
min. length: 1
 
partnumber normalizedString "%I"
parttocdepth nonNegativeInteger "0"
preventlonelyheading boolean "true"
section1number normalizedString "%n.%1"
section2number normalizedString "%n.%1"
section3number normalizedString "%n.%1"
section4number normalizedString "%n.%1"
section5number normalizedString "%n.%1"
section6number normalizedString "%n.%1"
section7number normalizedString "%n.%1"
section8number normalizedString "%n.%1"
section9number normalizedString "%n.%1"
tablenumber normalizedString "%n-%1."
titlelabels none | all |
(part | chapter | appendix | section | figure | table | example | equation)+
"part chapter appendix figure table example equation"
tocdepth positiveInteger "10"
xml:base anyURI  
xml:id ID  
xml:lang language or "" (the empty string) .
xreflabels none | all |
(part | part-number | chapter | chapter-number | appendix | appendix-number | section | section-number | figure | figure-number | table | table-number | example | example-number | equation | equation-number)+
"all"

Other attributes: XHTML5 global attributes, including any attribute having a name starting with "data-".

adjustuserheadings
If set to true, change the level of user-specified headings (h1, h2, h3, etc) to be consistent with the level of automatically generated headings. If set to false, do not change any user-specified headings. Example:
1
2
3
4
<chapter href="ch01.html" pagename="first_chapter">
  <section href="s01.html" pagename="first_section">
    <section href="s01_01.html" pagename="nested_section">
    ...

where input HTML file "s01_01.html" starts with a user-specified h1.

With adjustuserheadings="false", output HTML file "nested_section.html" contains:

1
2
3
4
5
<section class="role-section2>
  <h3 class="role-section2-title">Title of the section copied
                                  from "s01_01.html"<h3>
    <h1>User-specified heading found in "s01_01.html"</h1>
     ...

With adjustuserheadings="true", output HTML file "nested_section.html" contains:

1
2
3
4
5
<section class="role-section2>
  <h3 class="role-section2-title">Title of the section copied
                                  from "s01_01.html"<h3>
    <h4>User-specified heading found in "s01_01.html"</h4>
    ...

Note that adjustuserheadings="true" has no effect on headings having a class attribute. A heading having a user-specified class attribute is understood by XMLmind Ebook Compiler as being “not an ordinary heading which could be modified”.

appendicestocdepth
If set to an integer larger than 0, instructs ebookc to automatically generate a Table of Contents (TOC) having specified depth at the beginning of the appendices division of the book.
appendixnumber
Specifies the format of the number automatically added to the title of an appendix. See Number format.
appendixtocdepth
If set to an integer larger than 0, instructs ebookc to automatically generate a Table of Contents (TOC) having specified depth at the beginning of each appendix of the book.
booklistlabels
Specifies the kind of numbered book divisions (part, chapter, appendix, section) and numbered figure objects (figure, table, equation, example) for which to add labels. This option applies to book list entries (toc, lof, lot, loe, lox).
§ What is a label?

A label is a localized message containing the type of the book division or figure object. For example, with chapternumber="%1", labelseparator=") ", booklistlabels="none", a TOC entry for a chapter looks like: "1) Introduction". With booklistlabels="chapter" (or booklistlabels="all"), this TOC entry looks like: "Chapter 1) Introduction".

Note that labels are added only to numbered book divisions or figure objects. For example, with chapternumber="%1", booklistlabels="", a TOC entry for a chapter will look like: "Introduction".

chapternumber
Specifies the format of the number automatically added to the title of a chapter. See Number format.
chaptertocdepth
If set to an integer larger than 0, instructs ebookc to automatically generate a Table of Contents (TOC) having specified depth at the beginning of each chapter of the book.
equationnumber
Specifies the format of the number automatically added to the caption of an equation. See Number format.
examplenumber
Specifies the format of the number automatically added to the caption of an example. See Number format.
figurenumber
Specifies the format of the number automatically added to the caption of an figure. See Number format.
footnotenumber
Specifies the format of the number automatically added to footnotes (<span class="role-footnote"> or <div class="role-footnote">) and footnote callouts (<a class="role-footnote-ref">).
includebasestylesheet
If set to "true", include ebookc_install_dir/xsl/common/resources/base.css in all the output HTML pages.
Using the base.css stock CSS stylesheet is the simplest, easiest, mean to create a nicely formatted book. More information about this attribute in Leveraging base.css, the stock CSS stylesheet.

When includebasestylesheet="true", base.css is included before the other CSS stylesheets referenced in the headcommon (if any).

If you want to control where base.css is included, do not set includebasestylesheet to "true", instead add a headcommon similar to the one in the following example:

<headcommon>
  <html:link href="corporate_styles.css" rel="stylesheet"
             type="text/css"/>
  <html:link href="ebookc-home:xsl/common/resources/base.css"
             rel="stylesheet resource" type="text/css"/>
</headcommon>

The "ebookc-home:" prefix works because stock XML catalog ebookc_install_dir/schema/catalog.xml contains:
<rewriteURI uriStartString="ebookc-home:" rewritePrefix="../"/>.

headoverridedefault
Specifies the default value of attribute override of element head.
labelseparator
Specifies the string which is appended to the label automatically generated at the beginning of the title of a book division (part, chapter, appendix, section) or figure object (figure, table, equation, example). Example: with labelseparator=") ", the output HTML element generated for the following chapter is:
<chapter href="ch01.html">

is:

1
2
3
4
5
<section class="role-chapter>
  <h1 class="role-chapter-title">
    <span class="role-label">Chapter
      <span class="role-number">1</span>) </span>
    Title of the chapter copied from "ch01.html"<h1>
partnumber
Specifies the format of the number automatically added to the title of a part of the book. See Number format.
parttocdepth
If set to an integer larger than 0, instructs ebookc to automatically generate a Table of Contents (TOC) having specified depth at the beginning of each part of the book.
preventlonelyheading
If set to true, prevent an output HTML page from containing only a title. Example:
1
2
3
4
5
6
<chapter pagename="chapter1">
  <head>
    <title>First chapter</title>
  </head>
  <section href="s01.html"/>
  ...

With preventlonelyheading="false", output HTML page "output_directory/chapter1.html" contains just the title of the chapter "First chapter", which may be surprising for the reader of the book.

With preventlonelyheading="true", output HTML page "output_directory/chapter1.html" contains the title of the chapter "First chapter" and also the content of input HTML page "s01.html"[1].

section1number
Specifies the format of the number automatically added to the title of a top level section. See Number format.
section2number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 2 (subsection of a top level section). See Number format.
section3number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 3. See Number format.
section4number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 4. See Number format.
section5number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 5. See Number format.
section6number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 6. See Number format.
section7number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 7. See Number format.
section8number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 8. See Number format.
section9number
Specifies the format of the number automatically added to the title of a section having a nesting level equal to 9. See Number format.
tablenumber
Specifies the format of the number automatically added to the caption of an table. See Number format.
titlelabels
Specifies the kind of numbered book divisions (part, chapter, appendix, section) and numbered figure objects (figure, table, equation, example) for which to add labels. This option applies to titles or captions.

For example, with chapternumber="%1", labelseparator=") ", titlelabels="none", the title of a chapter looks like: "1) Introduction". With titlelabels="chapter" (or titlelabels="all"), this title looks like: "Chapter 1) Introduction".

tocdepth
Specifies the depth of the main Table of Contents (TOC) (see toc element).
xml:lang
Specifies the main language of the book. This language is used to automatically generate some titles (e.g. "Table of Contents", "List of Figures") and also to sort index entries.

Unlike lang, which is a XHTML5 global attribute, xml:lang is not copied to the output HTML element corresponding to the book element.

However, explicitly setting attribute xml:lang on the book element is a convenient way to ensure that all the output HTML pages have a lang attribute.

xreflabels
Specifies the kind of numbered book divisions (part, chapter, appendix, section) and numbered figure objects (figure, table, equation, example) for which to add labels. This option applies to automatically generated link text.

For example, with chapternumber="%1", labelseparator=") ", xreflabels="none", the text automatically generated for empty link to chapter <a href="intro.html"/> looks like: "1) Introduction". With xreflabels="chapter" (or xreflabels="all"), this text looks like: "Chapter 1) Introduction".

With xreflabels="chapter-number", this text looks like: "Chapter 1", that is, no chapter title, just the label without any label separator. Note that this "-number" suffix is supported only by xreflabels.

Children

The following elements occur in book: appendices, appendix, backmatter, body, chapter, frontmatter, head, headcommon, part, related.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<book appendixtocdepth="100" chaptertocdepth="100"
      section7number="" section8number="" section9number=""
      labelseparator=" "
      booklistlabels="chapter appendix"
      xreflabels="chapter appendix section
                  figure-number table-number equation-number example-number"
      xml:lang="en-US"
      xmlns="http://www.xmlmind.com/schema/ebook"
      xmlns:html="http://www.w3.org/1999/xhtml">
  <head>
    <title>Widget User Guide</title>
    <html:meta content="John Smith" name="author"/>
    <html:meta content="2017-08-25" name="dc.date"/>
  </head>
  ...
</book>

[1] As if attribute samepage="true" were automatically added to the section element.