Saturday, December 21, 2013

calibre's ebook editor

calibre has been an excellent ebook managing and viewing software for sometime now. But we intend to live up to our slogan, making calibre the "one stop solution to all your ebook needs". To this end we have recently (since calibre 1.15) added ebook editing capabilities for ebooks in EPUB and AZW3 formats. The editor interface was made more user friendly in calibre 1.16. To avail of the features described below you will need calibre 1.16 or a newer version.

To make a few small changes like highlighting, changing font colors, using bold or italics fonts, inserting images and underlining requires almost no knowledge of HTML coding. There are GUI buttons that insert the code for you when you click on them. calibre makes these things as simple as button pushing.

In spite of the top layer of simplicity, the editor is very powerful. Those of you who know HTML coding can do a lot more. This blog post is directed towards rather lay users and will explain how to do a few simple but very useful things in detail.


To edit an EPUB or AZW3 format ebook in calibre just select the ebook in the main calibre window and right click. As you can see in the picture below many options appear:




Click on "Edit book" (the second option from the bottom). A new window opens. It looks like



As it says on the center of the window "Double click on a file on the left to start editing it".

The ebook I am going to use as an example is a recipe book made using the "Recipe Reader" plugin in calibre. For more details about the plugin you can also check out the plugin's mobileread page. With the holidays coming up you may find this category of plugins useful. I like to make notes on recipes I have used for future reference and calibre's ebook editing feature allows me to do just that as I will demonstrate.

If you double click on the first file listed in the left column called titlepage.xhtml.You see the following:




The right column now shows the cover/title page and the middle column shows the HTML code for it. The right column is a live preview. That means that very time you make any changes to the HTML code in the middle column, the effect on the ebook itself will be visible in the right column. Don't be intimidated by the HTML code. calibre makes dealing with it really easy. If you still feeling nervous, note that the very first button in the toolbar in the middle column is an undo button. Also none of the changes you make will be saved till you explicitly tell calibre to save them by clicking the save icon


in the top toolbar.  Still feeling nervous, the first time you use this editor make a copy of the book in calibre and work on the copy.

Now getting down to the action. Let us start with editing some simple text. The following is a picture of the toolbar in the center column.

From left to right the buttons are "Insert image", "Bold", "Italics", "Strike through", "Subscript", "Superscript", "Font color" and "Background color".

Lets start with a demonstration of using the font color button. For this purpose I have selected the third file in the left column:


Now say you want to add a note in red next to "1 egg" in the first line of the ebook on the right. How do you go about finding it in the HTML code. Simple, click on "Search" to the left of "Help" in the topmost toolbar in the window. A number of options show up and I click the first one called "Find/Replace" and you see:


As you can see a "Find" section shows up at the bottom of the middle column. Enter the word "egg" to find the relevant part of the HTML code. If egg happens to appear in few different places in the recipe you could be more specific and enter "1 egg" for example. Now let us will add a little note in red. Put the cursor next to egg and click the font color button and choose the red color. Some additional code appears. Without changing the position of the cursor enter the text you want. This is what it looks like:


The live preview on the right shows what the changes you made will look like in the ebook.
To change the color of already existing text just select the text in the HTML code and click the font color button and choose the color. Similarly to make some text into bold just select it and click the bold button.


On doing so, as you can see from the picture above, the text in the HTML code as well as in the ebook are converted in to bold format. Same for italics.

To highlight a bit of text select the text in the HTML code  and click on the background color button and choose the highlight color. The following picture shows a bit of text highlighted purple. The code as in all previous cases is automatically inserted on clicking the appropriate button.



Now for inserting pictures. To insert a picture click on the insert picture button in the toolbar. The following window opens up:




the window shows the images that are already a part of the ebook. You can reinsert one of those images or you can click "Import image". If you click on "Import image" it lets you choose a picture from your file system. Once you choose an image this is what you see: (This picture is taken from Wikipedia and is not of pancakes that I made :). )




The required HTML code is automatically inserted by calibre. Only there is a little problem here. As you can see the paragraph starting with "Batter" begins right next to the picture and you may prefer that it start on the next line. To fix this just enter
</p> <p>
before the word "Batter" in the HTML code as shown in the picture below.


The calibre ebook editor also allows you do some simple image editing. Double click on an image you want to edit from the list of images in the left column and it will open in the middle column as shown below.


 The image editor lets you do simple things like trim, rotate and resize images. You can also select a small section of the image with your mouse as shown below:


Then you can paste another image into it. Just copy the image from else where and then click on the paste button in the editor toolbar. I have used this procedure to paste two images in to the cover image of this ebook. the result is:


These are some of the simple and most useful things the new ebook editor feature can do. We will be adding more features but if you want to edit ebooks this should help you get started. Dive in and enjoy yourself.

Happy Holidays everyone!