Contents | Start | End | Previous: Chapter 21: Working With Text-To-Speech | Next: Chapter 23: Conditional Formatting
This chapter describes how you can optimize your books so that it can generate files suitable for print as well digital consumption.
Jutoh can help create printed books via its export of OpenDocument Text (ODT) files. An ODT file can be used with other software to create a PDF file, perhaps to send to a print-on-demand service such as Lulu or Amazon’s CreateSpace.
You can use a program such as LibreOffice to open the ODT file and save as a Word file or export to PDF. Creating a PDF from Jutoh can be as quick as selecting the OpenDocument configuration, pressing Compile, pressing Launch, updating the fields in LibreOffice, then exporting to PDF.
Note: conversion of page layout when saving to DOCX from LibreOffice doesn’t work well, so save as DOC instead, and if necessary use Word to save to DOCX. Also, although recent versions of Microsoft Word will read ODT files, it has problems with lists, headers and footers, and table of contents fields, so you are advised to open the ODT in LibreOffice and then save as Word if necessary. See KB0128 in the Jutoh help for tips on converting ODT to Word.
The remainder of this topic will explain how to tailor ODT export to your needs. For extra information about what options to specify when exporting fixed layout books to ODT, see the topic Exporting fixed layout books to ODT in the Jutoh help.
You might like to try the Print on demand wizard via the menu command Book | Help with Print on Demand, to help you set up your project for print output. It takes you through most of the steps detailed below for manual page style creation, and it can also import page settings from DOCX and ODT templates. All the settings in the wizard can also be edited manually elsewhere in Jutoh.
Suitable template files can be downloaded from sites such as CreateSpace and Lulu. If they are in Word DOC format, they will need to be saved as DOCX or ODT files before import into Jutoh.
What the wizard doesn’t help you with is the creation of suitable content. You may need to insert sections for print, that won’t appear in an ebook. Fortunately, you can do this using conditional content, dependent on the configuration you’re currently compiling with.
Take a look at the file Print Book Sample.jutoh that comes with Jutoh. It uses conditional sections to output suitable print-only sections (such as the half-title page). Sections that should start on a right-hand page do so by virtue of setting Layout to Right Only in page styles.
For more on conditional formatting for POD, see KB0123: How do I use Jutoh with print on demand services? in the Jutoh help.
You can specify the overall paper size using the Paper size option; if none of the provided paper sizes is suitable, type values in mm into Custom paper width and Custom paper height to override the Paper size selection.
Specify the margin between the content and the edge of the paper in mm with Left margin, Right margin, Top margin and Bottom margin.
Check Mirror margins if you need a larger gutter for binding the book, having set the margins according to advice given by your print-on-demand service. Mirroring the margins will set the left margin value as the inner margin, and the right margin value as the outer margin.
As we shall see below, these settings can all be overridden via individual page style settings.
Usually, Jutoh will export special formatting such as a table of contents, index entries and footnotes in the appropriate native ODT format. But sometimes ebook distributors can’t handle the special formatting, so you can switch these off with the configuration options Special index formatting, Special footnote formatting, and Special table of contents formatting.
In addition you can clear the option Use outline levels to remove references to outline levels in heading styles. Normally outline levels are useful as hints for ereaders such as Adobe Digital Editions to display headings as a table of contents; but again this can confuse some distributors such as Smashwords.
Special formatting and outline levels are all disabled by default for the ‘Smashwords OpenDocument’ configuration to prevent errors when submitting documents to their Meatgrinder conversion software.
When exporting to ODT and opening in LibreOffice or OpenOffice, you may find that there are some extra blank paragraphs which may also result in blank pages. If this happens, and you don’t intend to open the file in Microsoft Word, clear the configuration option Add blank paragraphs for Word.
The reason for this option being on by default is that Word messes up formatting if you don’t have a blank paragraph before a page break. This can manifest itself in erroneous justification in the last line of a paragraph. If you only intend to open the document in LibreOffice or OpenOffice (for example, for PDF output) then it’s safe to clear the option.
Setting the paper size and margins is all very well, but what if you want more page layout detail, such as headers and footers in particular parts of the book, showing page numbers and other information? There are three ways to set page layout, as specified in the Page Layout tab of the Project Properties dialog:
Basic page layout: the same page layout applies throughout the book.
Manual page layout: Jutoh leaves all page layout to individual book section properties.
Automatic page layout (the default): Jutoh creates headers and footers, and optional page numbering, at the start of the main book content.
The first method won’t add any headers or footers or page numbering; only the most basic layout will be specified (paper size, margins, and whether to mirror margins). These document-wide settings will also be output as the default page style for the other two methods, unless a page style called ‘Standard’ has been defined, in which case ‘Standard’ will be used as the default page style.
The second method, manual page layout, is the most flexible. You can specify page layout styles per section document, in the Page tab of the Book Section Properties dialog. This method is set when you run the Print on demand wizard with Book | Help with Print on Demand.
The third method lets you leave it to Jutoh to decide where numbering begins (after the table of contents or the section with a ‘text’ guide type), or you can specify a particular section. You can choose from a small number of header and footer options: the book title, current book chapter or page number. The ‘Headers’ and ‘Footers’ paragraph styles will be used to format any header or footer you specify here.
When using manual page layout and assigning page styles to sections, you don’t specify the properties directly, but instead create and edit a project-wide page style, which you can do from the Page tab. Then, you can assign the same page style to multiple sections. You can choose whether to start numbering at this section, but you must also set a page style.
The page style properties contain paper size and margins (as before) which override the configuration options. Or, you can choose to use the configuration options for these values.
As well as the Layout option to mirror margins, you can specify only left or only right pages, in which case the other page will be blank. So, if you want a section to start on the right hand page, specify Right for Layout, and specify a Next Style to use for the pages after the first one in the section. When exporting a PDF from the ODT file in LibreOffice or OpenDocument, don’t forget to check the option Export automatically inserted blank pages in the word processor’s PDF Export dialog.
You can specify a numbering style, such as arabic or roman, and the start number if not overridden by the text section properties.
Finally, you can specify the header and footer properties as described below.
You can add, edit and delete page styles from the Page tab of document properties dialog, or from the Page Style Management dialog that can be invoked from the Page Layout tab of the Project Properties dialog. From here, you can export and import page styles using files with a .jutohpagestyles extension.
You can also import page styles directly from another project using the File | Import | Import From Project command.
If you have a page style called ‘Standard’, it will be used as the default style when no page style has been specified for a section. If ‘Standard’ isn’t defined, the default style will take its values from the configuration.
If you have a page style called ‘Cover’, it will be used for the cover. To ensure the page style doesn’t repeat for subsequent pages, set the next style field to ‘Standard’. However, don’t do this for sections with more than one page unless you only want the first page to use the specified page style.
You can specify very limited headers and footers in automatic page layout mode; but for more control, you can edit header and footer content, and their formatting, in a page style. These headers or footers will continue until the next page style (if any), and you can also specify different headers and footers for the first page in a section, or for the left and right pages (but see the note below about restrictions for the first-page content option).
In the Page Layout Style Properties dialog, click on the Header or Footer tab and specify whether the header or footer should be included in this style. You can then change further properties such as auto-fit height, same content on first page, and same content on left and right pages. You can also click on More Properties to specify height, margins, border and background colour if required.
There are three kinds of header or footer you can edit: main (labelled Header or Footer), first page and left page. Choose which to edit, and then click Edit Header or Edit Footer. If you don’t want different first page or left page headers, you only have to edit the main header or footer.
In the header or footer editor, you can use the usual formatting, and you can insert fields such as page-num and chapter, via Insert | Field in the context menu (right-click for the menu, or control-click on Mac). If you insert a chapter field using chapter numbering, you will also need to edit the outline style, described below, so that the chapter title is formatted as required.
IMPORTANT: using different headers and footers for the same page style in order to achieve a different first page only works for LibreOffice; in other words, OpenOffice does not have a Same content on first page option. Both LibreOffice and OpenOffice also have the restriction that a page style for one section must have a different name from the page style for the previous section, or the word processor will only consider there to be one ‘first page’ in the whole sequence of chapters, not for each chapter.
To work around that, create two styles: one for the first page in the chapter, and another for the other pages in the chapter. In your first-page style, set the Next style field to the name of the other style. Now select the first-page style as the Style name in the section properties Page tab. You can check Repeat page for subsequent sections to avoid having to set the style for all chapters.
If you want to create a Word DOC or DOCX file, you may need to fix headers and footers in Word after importing the ODT file. For more information, please see KB0128 in the Jutoh help.
The outline style is ODT-specific and defines default document-wide outline information. Each outline level (1-10) specifies a paragraph style for a chapter heading (by default, Heading 1, Heading 2 and so on) and various formatting options for a numbered heading, including a prefix for the number (e.g. Chapter) and a suffix for the number (e.g. a space).
There is only one outline style, called ‘Outline’, and you can edit it from the Page tab of the Book Section Properties dialog, or the Fields & Numbering page of the Project Properties dialog.
The formatting options will affect how the chapter title appears at the start of a chapter and also any chapter field that you put in a header or footer.
If you have used the chapter field in your headers or footers and they are not being correctly substituted for the chapter heading, ensure that:
your chapter headings are formatted with the correct heading style, such as ‘Heading 1’;
your heading style has an outline level of 1 defined for it;
your outline style (edited via Project Properties/Fields & Numbering) specifies this heading style;
the configuration option Use outline levels is enabled.
If you have created an advanced table of contents, in other words one which is present as a section in your project instead of generated only when the ebook is compiled, Jutoh will replace it with one that is more suited to printable documents. The table of contents will contain page numbers as well as hyperlinks. The special TOC will use the style patterns in the Jutoh TOC properties in order to search for suitable headings to include.
Any page style you specify for this page will still be respected: for example you might want to add a footer with page numbers displayed as roman numerals. For more details, see Chapter 11: Working With Indexes.
Note: if your table of contents does not contain all the levels you expect after you have updated fields in LibreOffice/OpenOffice, the heading style outline levels may be incorrect.
Edit each of your heading styles in Jutoh, and for Heading 1 (or whatever your heading 1 style name is), make sure ‘Outline level’ is set to 1; for Heading 2, make sure it’s set to 2, and so on.
This is a quick explanation to help you edit page styles within your word processor of choice once you have exported your project to ODT.
Jutoh generates two kinds of style for each page style: a master page style, and a page layout style. The master page style has a reference to the page layout style. In a word processor, these styles aren’t visibly separate, but the master page style contains the actual headers and footers, while the page layout style contains formatting information.
If you look at the list of styles in your word processor, there are buttons for different kinds of style. Click on the page styles icon and you can see the styles that are predefined (or generated by Jutoh). ‘Default Style’ is called ‘Standard’ internally and in Jutoh. You can right-click over a style and press Modify to change the page style properties.
To associate a page style with a particular portion of your document in OpenOffice/LibreOffice, you can insert a page break with an associated page style (Insert | Manual Break). Or, you can put the cursor at the first paragraph in a new page, right-click and select Paragraph, then select the Text Flow tab and you will see With page style and a page style name, which you can change. So you can see from this that a page style is associated with a portion of a document by being associated with the paragraph style of the first paragraph (or table) after a page break.
When you edit a header or footer in the word processor, you are editing the header or footer for the particular page style that is active at present. For example, if you associated a ‘Chapter Style’ page style with the heading for Chapter 1, then Chapter 2 would also have this page style and editing a footnote for Chapter 2 would also change it for Chapter 1.
If you import from an ODT or DOCX document, page styles will be created for your sections. If you have multiple page styles in your original document, select splitting by page break when you import, to be sure that Jutoh will set the page styles for the right sections.
Importing from DOCX will always create a page style for the first section as the default style, whereas importing from ODT will create a "Standard" page style that provides defaults, but is not explicitly associated with a section. Both import methods should create similar results when exporting to ODT.
This chapter has shown how you can author print documents with Jutoh, as well as ebooks. Next, we see how you can use Jutoh’s facilities for conditional formatting: creating different ebook content that changes according to criteria in different configurations.
Contents | Start | End | Previous: Chapter 21: Working With Text-To-Speech | Next: Chapter 23: Conditional Formatting