Search This Blog

Monday, September 5, 2011

How to Make an Ebook: Step 1 – Creating the Source File

This series will eventually become an ebook I'll make available for sale once we complete the chapters and I can make time to edit them. If you appreciate my efforts and find them useful, please consider a donation (top, right) to aid the continued work on this book. Thank you.

The most time intensive task in creating ebooks is modifying the source file so that it will process correctly when creating ebooks. Your source file is generally the file you use to initially write your document in, and/or the text containing the print version of the book if you have one. However, there are a few things you can do when you first begin writing your work that can save you lots of time later. So pay close attention here, because this is the foundation that allows you to easy format a file for each type of publication, whether it be print, PDF, EPUB, or MOBI.



What You Will Need


Among free word processors, I'm recommending Open Office Writer. You can download it at http://www.openoffice.org. This is the word processor I am using to create this book. But even if you don't plan on using Open Office Writer to create your book, still download it if you don't have it, because we will be using it to create the PDF format. Additionally, if and when you want to create the print book cover for CreateSpace, you will need it then.

There are several other decent free word processors out there. Feel free to use them, but the instructions I'll be providing are for Open Office Writer. You'll need to discover for yourself how to accomplish the same things in those programs, assuming you can.

Also, if you have a copy of Microsoft Word, I'll be giving instructions for that word processor too. Even though it isn't free, so many people have and use it, I felt it necessary to include those instructions.

Styles


Styles are essential in making a file easy to change the formatting. It defines how your text will look when associated with a particular style. Want to change every chapter heading in your document from Arial font to Times New Roman? Easy to do with a style, if all your chapter headings are using that style. If they are not, or they are using the same style as the text in the body of the work, then you have to go through the document and manually edit each instance to make such a change.

There are primarily three to four styles you need to concern yourself with:

Normal or Default: These are the default styles for MS Word and Open Office respectively. These styles will contain the bulk of your story's text. You want to make sure all the text in your body uses these. This will especially save you time in setting up the Smashword's document to upload, because they don't like any special formatting. When you decide to change the story's font to Garamon in preparation to create a print book, if it is all in the Normal or Default style, you only have to change the style to modify the whole story. The most styles you use, the more you have to change.

Heading 1: This is the style you will use for your book's title. Also, if your book is divided into parts, you'll want to use this style for "Part 1," "Part 2," etc. Some people also use this for the chapter headings. That is fine, but I like the chapters as sub-headings under the name of the book or the parts. So...

Heading 2: This is the style you will use for all chapter headings, including any prologues, epilogues, introductions, about the author, glossaries, etc. One of the cool things of using this is you can set the style to automatically insert a page break when you use it, which means each chapter heading will automatically start on a new page. Then when you are ready to create the ebook file, you simply turn that off and all the page breaks are gone.

Heading 3: Another possible style to use is Heading 3, which would mostly be used if you have scene or logical third-level breakdowns within chapters, as I do in this document. You can have these who up in the Table of Contents as well, but not recommended as it would make them very long. But I'm doing it in this document to make it easy for readers to get to specific areas for reference. Not something one would worry about in a work of fiction, but with a "How to," it becomes more important.

You don't want any more styles than that. Sometimes a document may need additional styles. For instance, maybe you have a specific way you want scene breaks to appear which differs from the text, because they are centered and you don't want the indent in them, forcing them to be slightly off-centered. So you might create a style based on Normal or Default that makes those adjustments. Then anytime you insert a scene break, you would apply that style to them. But generally you can stick to the above three or four styles. Too many styles starts to complicate the task of adjusting the text later on when we want to create an ebook file.

Creating the Styles


Normal or Default: The good news for the basic story text style, is it is already created for you and is the default style that comes up in each program. However, you will likely want to modify it.

In Open Office Writer, when you open a new document, you'll see a drop-down box in the upper-left corner that says, "Default." To the right of that will be a font style, usually "Times New Roman." And to the left of that is a third drop-down box with a number in it, the font size. The box that says, "Default" is the style box. That is the name of the style you would change to modify all text associated with that style. In this case, you could start writing away and your text would automatically be that style.

However, you will probably want to modify the style. Perhaps for editing purposes, you want to use an easier-to-read font, like a Courier font. And you will want to have the style automatically insert the first line indents. You do not want to use manual tabs as those don't get picked up so easily by some ebook conversion software.

To accomplish this, push the F11 button or click on "Format" in the menu, and select "Styles and Formatting." A window will open displaying a list of styles. Ensure that the left-top button with a paragraph symbol (a backwards P) is pressed in. If not, click on it to ensure it is.

In the window, select the "Default" style and right-click on it. Select "Modify" from the drop-down menu. It will open up a window with a series of tabs that provide various options for setting the formatting of the text. Click on the tab labeled "Indents and Spacing." You will then see a field labeled "First line." To the right of that label is a box with a number in it. I recommend entering a 0.25" (quarter inch) indent. Some prefer 0.5" (half inch), but I find on small ebook screens like a cell phone, that can look too big.

If you wish to change the font, click on the "Font" tab. You will see on the left a list of fonts you can choose. Click on each to see an example of what it will look like in the example box at the bottom of the window. The middle box allows you to select the style of the font. I would keep it at "Regular" for this style unless you really want your whole story to be in italics, bold, or both.

Another tab of particular interest is the "Alignment" tab. Click on it, and you will be able to select whether the text is left aligned, right aligned, centered, or justified. When first writing your story, you don't need to change it from left aligned, but when you go to create the ebook and print book file, this is where you would change it to justified. Once finished setting the style, click "Okay" button at the bottom-left, and if you have text already typed, it should change to reflect your modifications. Otherwise, when you start typing, it will automatically create the indents and use the font, its style and size, selected.

In MS Word, the process is a little different. First, the default paragraph style is called, "Normal." You will probably see a drop-down box labeled "Normal" if you just opened the program, similar to the "Default" label in Open Office Writer, but positioned in a different place. To modify it, click on "Format" in the menu, and select "Styles and Formatting." A window will open on the right, displaying a list of paragraph styles. Each label will be displayed with the settings of that style. To see the settings of any particular style, you hold your cursor over it until a small window pops out listing its settings.

One big difference with MS Word's style list as opposed to Open Office Writer's, is they show a style for every variation of the root style. For instance, if you italicize a few words of text associated with the Normal style, the style list would include a style called "Italics" As these exceptions get more frequent, it can become confusing. However, it does have some advantages over the way Open Office does it. If you want to change all sub-styles of Normal along with the regular text, modifying "Normal" will change them all. But if you only want to change the font size of all italicized Normal text, however, you can modify that one sub-style and the changes there wouldn't affect the rest of the text associated with the style "Normal." Likewise, it makes it easy to select all text associated with it, or clear out unwanted formats, as deleted sub-formats will revert back to their root style's format.

To modify the "Normal" style, put your cursor in some text using the Normal style. It should be highlighted in the Style and Formatting window. If you don't see it, scroll down until you do. Or use the drop-box at the bottom to change the list selection to a group that will show it ("Available formatting" usually will have it). Move your cursor over the "Normal" style but don't click anything. It migth take a second or two, but you should see a narrow box with an arrow pointing down appear on the right side of the "Normal" style. Click on that arrow, then select "Modify" from the list that pops down.

In the window that appears, you will see several formatting selections immediately available. You can change the font, style, size, alignment, among other possible selections. But let's say you wish to change the indent, which by default in Word is zero. Click on the "Format" button at the bottom-left of the window. Select "Paragraphs" from the list that pops up. A window displaying options for paragraph formatting appears. In the "Indention" section of the "Indents and Spacing" tab, you will see one drop-down box labeled "Special." Click that and select "First line" from the list. If you don't like the default indent given in the box to the immediate right of that box, you can change it, as I would, to your desired indent space. Of which, mine would be 0.25". All the other indents and spacing can be left at zero. If there are numbers in them, manually set them to zero.

Now you can click the "Okay" button to save those changes. To make them effective through the document, click on the "Okay" button on the remaining window. You should see the changes you made to the Normal text reflected in any text you've typed to that point, or will show up automatically as you start typing.

Heading 1, 2, or 3: In both programs, the way to access and modify the styles is the same as for the Default and Normal styles. But there are some additional settings of interest in these styles to mention.

Centered text is best centered across the whole page. When you modify these styles, check in the "Indent and Spacing" tabs of both programs to remove any first line indents or other indents. Set those amounts to zero. However, you will generally notice numbers in the spacing sections, giving a number of pixels usually above and below the paragraph. Use this to give some space between the headings and text above and below rather than manually inserting lines. Removing the first line indent will center the text across the whole page instead of set off to the right of center because it is centering from the indent instead of the page's margin. Usually you will want to set Heading 1 to centered. If you use Heading 2 for chapter headings, people go both ways on centering or left setting. But I would remove the indent even on left setting, but that is just my preference.

Another handy feature we mentioned before is the ability to automatically insert page breaks before chapter headings. In Open Office Writer, modify the Header 2 style (or which ever style you are using for the chapter headings) and select the "Text Flow" tab. Under the "Breaks" section, click the check-box labeled "Insert." That will make the "Type" and "Position" drop-down boxes become active. They will probably already be set correctly, but you want to have the "Type" box select "Page" and the position box select "Before." After you select "Okay," it will automatically insert a page break before each paragraph labeled "Header 2"

To accomplish the same thing in Word, modify the Header 2 style. Click the "Format" button and select "Paragraphs." Then click on the "Line and Page Breaks" tab. Click the "Page break before" check box so it is checked. Click "Okay" and "Okay," and the chapter headings you've associated with this style will insert a page break at each chapter.

When you are ready to prepare the file for the ebooks, you reverse the steps above to remove the page breaks. Now when you need to set the formatting for different versions of your book, you simply edit these styles to make whatever changes you wish. Wanting to send this out to an agent or publisher? Edit to standard format (setting Default or Normal styles to Courier text, 12 pt., double-spaced) and the page settings to 1" margins on 8.5" x 11" paper (we'll get into setting the page size later). Print and ship. Ready to create the print file for the book? Edit the styles to use the font, size, and indents you need. Make the headings look anyway you wish. That's the advantage of using styles. Easy to change the look and formatting for different versions.

Applying the Styles


So, now that they are created, how do you use them? For the Default or Normal text, you simply type. You don't need to do anything special. If you've created a style with a different name, then before you started to type you would want to either select it in the drop-down boxes in the tool bar, or open the style list and click (in MS Word) or double-click (in Writer) and then start typing.

To use the other styles, after typing some text, select it and either select the style from the drop-down list in the toolbar or click on it from the style window list. You should see the selected text change to match the new format.

Let's say I'm starting chapter 2. I would type out, "Chapter 2" and hit return. Then select the text and select "Heading 2" from the drop-down list. The text would change fonts, size, and insert a page break, or whatever I've told the program Heading 2 should look like. Then you click back into the line below the heading, and start writing chapter 2.

Formatting After the Fact

Sometimes you get a book file formatted by someone else, and you want to create an ebook for it. Or you have a book written before you read and understood anything about styles and so it is not formatted to make it easy to change or for ebook conversion programs to pick up chapter headings. What do you do?

First, expect to do some tedious, manual work. For instance, if the chapter headings use the Default or Normal styles like the rest of the story, just changed in size and style to look different (which is the most common situation in formatting a file after the fact), that usually means you are going to have to select each chapter heading and apply the Heading 2 style to it. In MS Word, it is possible under limited circumstances to speed this up. Unfortunately, Open Office Writer can't search on text and apply formatting to it. All it can do is replace one style with another.

But in MS Word, they give you more flexibility. So if you have that program, and the chapter headings are labeled with some type of consistent wording, it is possible to do a search that will catch all of these and apply the Heading 2 style to them.

Let's say each chapter is labeled as "Chapter 1," "Chapter 2," and so on. In MS Word, either push the Ctrl-H button combination, or click on "Edit' in the menu and select "Replace." A window pops open with two fields to fill in. On top is the "Find what" field, and below that is the "Replace with" field. Below that you will see a button labeled "More." Click on that and it will drop the window down and show more options.

Place the cursor in the "Find what" field, then click on the "Use wildcards" Right below the "Find what" field, you'll see text that says "Options: Use wildcards." Now in the "Find what" field, type the following text without the quotation marks, "Chapter ??" and then place your cursor in the "Replace with" field. In that field, type the following text without the quotation marks, "^&". Click on the "Format" button at the bottom. Select "Styles" from the list. A window with a list of styles will appear. Scroll down that list until you see "Heading 2" Select it. Under the "Replace with" field, you should now see the text saying "Style: Heading 2."

Now click the "Replace All" button. It will go through the document and find any text that begins with "Chapter " and is followed by one or two characters, then apply the Heading 2 style. Quick and easy. But unfortunately, many books will have either just numbers, or a full title that is different each time. So this is limited to when something consistent and be searched on that will find all instances of a chapter heading.

To remove tabs: in MS Word, using the "Replace" window, clear any formatting (button on bottom-right of expanded Find-Replace window which says "No Formatting") then enter the following into the "Find what" box without the quotes, "^t" and leave the "Replace with" box empty. Click on "Replace all" and all tabs in the document will be removed. You can then set the indents in the style, or alternately, set the "below" spacing to 3 pixels to create a double-spaced paragraph look.

In Open Office Writer, you use the "Find and Replace" function in the Edit menu, or by pressing Ctrl-F. Click the "More Options" button and click the check box for "Regular expressions." In the "Search for" field, enter without quotes, "\t" and leave the "Replace with" field empty. Click on the "Replace All" button. All tabs go bye-bye.

To remove manual page breaks: In MS Word, enter into the "Find what" field without quotes, "^m" and leave the "Replace with" field empty. Click the "Replace All" button and it is done. In Writer, you do not use the Find-Replace function. Instead, put your cursor in the text. Press "Ctrl-A to select all text in the document. Then click on "Format" in the menu, then select "Paragraph." Click the "Text Flow" tab in the resulting window, then unclick the "Insert" check box in the "Break" section. All page breaks will be removed. Apply automatic page breaks in the Header style used for chapters if needed.

The worst case scenario is when multiple styles are used in the body of the text. You can see what is being used in a document by opening the styles list. In Writer, press F11 in Writer, Then select "Applied Styles" in the bottom drop-down box. It will display all styles being used in the document. If you find multiple body text styles other than Default, you can merge them doing the following. Press Ctrl-F, and then click on the "More Options" button. Click on the "Search for Styles" check box. In the "Search for" field, you will be able to drop down a list of the styles. Select the one you wish to merge with Default. In the "Replace with" field, drop down that box and select the style you wish to merge it with, in most cases, "Default." Click the "Replace All" button and the alternate body style should disappear from Applied Styles, and that text should now conform to the Default style.

In MS Word, open the styles list by clicking "Edit" in the menu and then selecting "Styles and Formatting." Drop down the box at the bottom of the window and select "Available Formatting." A list will show the styles in use in the document. When figuring out how many styles are in use, keep in mind that each style may be listed several times, once for the standard, once with italics, once perhaps with some other settings. Usually you will see the style and a "+" sign with the modifications after that. So if you have one heading 2 in your document that is italicized while the rest are not, you'll see one entry for the root style, "Heading 2," and another entry that would look something like, "Heading 2+italics." However, the only exception is that the Normal style isn't listed before each sub-style. So instead of seeing "Normal+italics," you'll simply see "italics." Any style that doesn't have a name before it is a sub-style of the Normal style.

To get rid of a sub-style and allow the text it goes with to revert back to the main style, you'd hover your cursor over the style in question until the down arrow appeared on the right of the name. Click the down arrow and select "Delete." In our example above, we would want all the chapter headings to look the same, not some italicized and some not. So to rectify that situation, we would delete that sub-style.

But if we have multiple styles that need to be merged, hover your cursor of the style to get rid of until the down arrow appears. Click the arrow and select "Select all xxxx instances." The xxxx will show the actual number of paragraphs using that style. With all of that style selected, click on the "Normal" style. The Normal style will be applied to the selected text. The unwanted style would disappear from the "Available formatting" list.

Sometimes, however, the formatting is so messed up, you literally need to start over. To do this, we use what is called the "nuclear option." This is accomplished by saving the document as plain text with no formatting, then importing it back in. All text will become the default of the document, or easily changed if needed. The downside is you lose all italics, bold, heading, etc. formatting. So you either need to reapply that manually, or use my system of retaining certain formatting through the process. Two downsides to this: one, you have to use Word. So if you don't have that, good luck. Writer will not handle this. And the process is a bit tedious, though not nearly as tedious as going back and reapplying hundreds of italics and hope you don't miss any. For those brave souls, I've included the instructions for that process in the appendix. However, I also have a Word macro that can handle the same thing, link with the article in the appendix.

As you can see, it is best to start out writing the document with these thing in mind. You can save a lot of time doing manual formatting to ebooks and even print from the original file. If all chapters have a heading style applied to it from the get go, and all body text uses the default style of the program, the formatting needed to get files prepared for the next steps is minimal. The following steps will assume that you have a source file correctly formatted, and you are ready to start working on creating the other formats.

No comments:

Post a Comment