This is an excerpt of the book “Better Books with LaTeX.” The book comes with a LaTeX template you can use to easily create your own books.

While Amazon KDP is the current market leader, it might be worthwhile to also publish a book on other platforms. One alternative is Google Play where people can buy books directly from their pre-installed “Books” application on their Android smartphone (or online on their computers). The advantage of Google over other competitors is that many people already have a Google account and have added their payment information, so that shopping online becomes less of a barrier to purchase. Another point for Google is that fewer competitors offer their books there (compared to Amazon). This is partly due to the more complex initial setup and upload process which we will be discussing in this chapter step by step.

To publish your e-book on Google Play, you need to have your EPUB file ready, have or register a Google account on https://www.google.com, and then register yourself as a publisher. Registering a Google account is straightforward, so we can move on to creating an EPUB file.

If you already have the e-book on Amazon KDP, make sure it is not (or no longer) in the “KDP Select Program” which prohibits the release of the e-book (or large parts of it) on other platforms.

  Creating EPUB Files for Google Play

To prepare for the epub conversion, the LaTeX code might need some cleaning up. Go through this checklist to make sure those issues are met. There might be issues beyond that; if you encounter any, let us know at mail@lode.de. If all else fails, you can also use the PDF output—with the downside that it is optimized for print (two-page view, fixed trim size, etc.) while the EPUB output can be adapted to the specific size, resolution, and page orientation of the reader’s device. You can also refer to Google’s checklist of how to make a book available online:https://support.google.com/books/partner/checklist/4489282.

  • Do not use special characters (like colons) as the ID of entries in the bibliography.
  • Do not use the \url{} command for emails or other non-URLs.

Calibre   Calibre is a HTML to EPUB converter tool (see https://calibre-e-book.com/download) that also allows you to edit the metadata of the EPUB, add a cover image, and set the parameters of the conversion.

There are many free software tools to convert your HTML file into EPUB for Google Play. I recommend using calibre. After download and installation, start the “E-book management” program which shows your current library. To add a book, click on “Add books,” browse to your directory where you have extracted the zip file you downloaded from Overleaf , and select the HTML file. On the right side, you will see a default picture for the cover (we have not assigned any yet), as well as a list of “Formats.” As we have not converted the file to EPUB yet, ZIP is the only format we have.

Next, left-click on your book entry, and click on “Convert books.” On the top left, you will see the input file format (ZIP), and on the top right, you will see the output format (EPUB). If another output format is shown on the top right corner, click on it and select EPUB. All that is left to do is to fill the meta data and adapt the page setup—all other items are good at their default setting.

On the right hand side, you need to enter the title, author(s), publisher, series name, and series number. You can skip the large text field below—the book’s description can be filled out on the particular platform where you release the EPUB file and might need several revisions there.

Then, add the cover file you have created previously in Chapter 11 (Google Play does not have an inbuilt cover creator).

Next, click on “Page setup” on the left, and select “Tablet” from the “Output profile” list. This disables image scaling for the conversion, and the images will instead later be scaled according to the device the reader is using to read your book. While this increases the size of the EPUB file, it allows your e-book to be read on any device.

Then, click on “Search & replace.” This looks a bit cryptic, but we need to fix how tex4ht builds its links in the file. Insert the following string into “Search regular expression”:

 
 
<a id="\w[0-9]-[0-9]+doc"></a>
 

Leave Replacement text empty, and click “Add.” Clear the “Search regular expression” field and now enter:

 
 
<a id="chapter\*\.[0-9]+"></a>
 

and click “Add” again. These two rules will remove faulty links that will otherwise show up as errors by Google Play.

Finally, press OK, wait for the conversion to be completed, and click on EPUB to open the e-book reader and check if the conversion was successful. Now you have an EPUB file we can later use to upload to Google Play’s e-book platform and release it.

After you have added your book the first time, you can simply copy the meta data and the cover image from your previous versions. For this, simply right-click on an existing entry, select “Edit metadata,” “Copy metadata,” and then right click on the new entry, selecting “Edit metadata,” and “Paste metadata.” You will probably import your book several times while learning how to work with Overleaf and LaTeX, so this feature can be helpful.

  Troubleshooting

Instead of waiting for Google Play to process and check your EPUB file, you can also use an EPUB validator like http://validator.idpf.org/. The downside is that it is more strict than the Google Play validator—the output of Calibri will show a number of issues accepted by Google Play:

  • Error while parsing file ‘value of attribute “id” is invalid’ The id of one of your bibliography entries contains a special character.
  • Referenced resource could not be found in the EPUB. This issue shows up if your \url commands are malformed (the URL does not start with “http”).
  • CSS selector specifies absolute position. This is an issue of Calibri and cannot be fixed but has no effect on the actual e-book read by your readers.

For reasons of optimization, Calibri splits the HTML file into parts. Thus, the line numbers shown both by Google Play as well as the EPUB validator relate to those split files, not your original HTML file. To access those split files, go to the Calibri output directory, right click on the EPUB file, and unzip it with WinZip (or another similar unzip program).

  Registering at Google Play

Google sets some limits on people registering as a publisher (or a self-publishing author). The first step is to fill out the form at https://play.google.com/books/publish.

This is generally also the address you can return to if you get lost during the publishing process.

Click on “GET STARTED NOW” which leads you to a login page (if you are not already logged in Google) and then to the entry page (“Find new fans. Sell more books.”). Click on “online interest form” (https://support.google.com/books/partner/contact/playbooks_partner_program_interest_form) and fill out the “Google Play Books Partner Program interest form.” The fields are all straightforward, fill in your info, and then press “SUBMIT.” This submits a request to Google which will put you into a queue.

Please note that because publishing on Google Play is still in development, the links could change. If you encounter a broken link, let us know and we will get you on the right page.

After a week or so (that is how long it took for me, it might vary depending on when you sign up), you can enter your publishing company’s name and country. Once your details are entered, the terms of use are displayed. Read carefully about your rights and when payments are made. If you agree with the contract, check the boxes and continue. Next, fill out the form with the payment address, and continue again.

Note that it now takes additional time for Google to confirm the data you have entered. You can set up your book(s), but you cannot publish any until then. This activation took, for me, about a week.

  Managing Your Book Library

Finally, you come to the overview window. Click on “Book library” and then on “Add book.”

I recommend to simply use the automatically generated one from Google (GGKEY, a unique key like the ASIN on Amazon) which you can get for free. For the other settings, leave the defaults and select “Digital” (e-book) as the medium.


Did you know?


If you are releasing multiple editions of your book (for example due to updates) on multiple platforms, you might want to think about acquiring ISBNs and assigning one ISBN for each edition. This helps you to keep track what edition you have released where and makes it easier for authors to cite, or for readers to review, your work. -→ Read more in Writing Better Books, the Agile Way


Next comes a series of forms that are similar to the ones to set up your book on Amazon KDP. If you have already entered your book on KDP, you can simply copy and paste most of the information (title, description, about the author, series, etc.). Once the meta data is entered, you can move on to the next item and upload your EPUB file. After the upload is finished, the file is automatically scanned for issues (this might take an hour or two). If you encounter any error messages, read again Chapter 12.1 or let us know at mail@lode.de. But if you have not made any major changes to the template, your file should be ready to be released. If you have just set up your account, you might still have to wait a while.

Before releasing the book, you might want to add yourself (or your editor) as a quality control inspector at the bottom of the “Contents” screen using your Google mail address.

The book will show up at https://play.google.com/books of your Google account (or in the books application on your smartphone).

Once released, you can find your book by going to https://play.google.com/store/books and search for the title of your book. That is it!


Did you know?


While marketing a book on Google Play takes somewhat more effort than on Amazon, Google also offers prominent display of your book on the Google search results page (see Figure 12.1). -→ Read more in Writing Better Books, the Agile Way 

Figure 12.1:Google Play books are displayed prominently on the Google search results page.