About five years ago I decided to pen a missive to my future teenage daughter – the reasons for which, deserving a post of their own, will come later. I had in mind that the content would potentially benefit others, so I decided I would write it as a book.

The first draft of the book was coming quickly and I had to decide which tools to use to publish the book. I chose self-publishing because I wanted full control of any future changes / corrections /edits that I might wish to apply – the content deals with some sensitive subjects and I might well wish to improve the clarity of some parts at a later date. What seems clear to the author when written may be ambiguous or misleading to some readers. I was very keen that the presentation of the book be to a high standard, and experience with the usual word processors has taught me that they are a poor choice for those wanting detailed control over the final printed page. I had previously used LateX, a free typesetting package suitable for the more technically oriented, and I was confident that LateX (the X is the upper case of the Greek letter χ (Chi), roughly pronounced as a K, so LateK) would allow me to have the control of the final printed results that I desired.

The book was also to contain a small amount of Arabic content and using Linux I found that the installation of the software together with its many accompanying packages, including Arabic support, was a snap. On its own LateX is a command line tool so I needed to select a GUI based program to actually type out my book into. I chose Kile, a LateX editor based on Qt and from the KDE family of applications. I’m a long time user of Linux and KDE, from the very early days in fact, and have generally had a good experience of it.

So, a couple of chapters written, it was time to have a peek at what the final presentation quality would be. In just a few seconds and using the QuickBuild option I had a pdf document to look at. There were lots of very strange warnings in the program log, but the final results looked great – this was going to be easy, I though to myself! Yes, dear reader, if this was TV or radio and not a piece of italicised text then right now you would hear some deep laughter echoing around the distant hills

bellBefore continuing this particular lamentation, allow my superego to interject. I was ultimately able to produce a very nicely presented book and the pdf that LateX created for me was just right for printing the paperback book via the self-publishing route, so to be fair – LateX did a great job. Now, continuing where I left off…

I completed the main body of the book in a couple of months. I really did write it for my daughter, and I needed time to consider if I would actually publish it for others to read. Over the course of the next few years I would occasionally amend or add to the text, and gave some preliminarily printed copies (using Inky Little Fingers, a UK based printer who I can recommend) to friends to look over. I received some great feedback from them, and they encouraged me to go ahead and release the book.

During this extended period of mullation (OK, that’s not a real word) I designed the front cover, using Inkscape. Inkscape works with vectors (lines, rather than pixels) so the designs that you create can be easily scaled to any size. I then saved the graphic design to pdf and fired up Scribus, which is desktop publishing software, to complete the cover (back page etc.).

This is where my natural lethargy kicked in. Tarek, you are right, I never finish anything. Look, I’m not a completer-finisher. I’m an ideas man. However, this time was going to be different. I would finish it, this was important to me.

So, the time came. This was it. I was going to publish. I had printed a few dozen more copies to give to friends etc., and to send in the post to anyone who wanted to buy it. However, how would anyone know about it? Also, I realised very late in the day, if anyone outside of the UK were interested in buying the book then the P&P would in all likelihood put them off any purchase. I needed an international distributor – Amazon suddenly started looking like my only realistic option. This meant going through  CreateSpace , an Amazon company that specialises in self-publishers. I submitted my pdf and cover design, and before long (through a fairly simple process in fact, kudos to the developers of their web site) I had a copy for review in my hands – just after Christmas 2015 in fact. The front cover image was a little offset to the left, but apart from that it was good.

Now, what about the ebook version? I felt at this late stage that the price I would have to charge for the paperback would be off-putting to too many potential readers. I needed an ebook version. It was here that the pain, unexpectedly, really kicked in. I’m a software developer, by profession and for the love of it. I would write a converter program that would take my source document (in LateX) and convert it to the HTML needed to create an EPUB format file. How hard could it be? Now, when developing IT systems, and software in general, you should never assume anything. It’s always in the assumptions that disaster falls. In this case, I assumed that the LateX document format was logical, consistent, even straightforward. After all, I hadn’t noticed anything untoward when using LateX, and I’m a highly experienced software developer. How wrong we can be! I started writing a parser for LateX sources, to analyse the overall structure of it. This is when it really hit me – LateX might look fairly sensibly structured at first glance, but if you are using various extra packages then the structure very quickly becomes, well, kind of unstructured :-). Each developer of each package can invent his own weird syntax for controlling the extra features. Sure enough, weird syntax abounds. My parser program and the algorithms to process the parsed document quickly became a horrendous mess.

The difficulty was further compounded by the fact that the ebook format is really designed for novels, where there are no complex layouts or odd languages. Technical text books are way out of reach for the format, which is why they tend to look so bad – it’s not entirely the publishers fault. In my case I worked around it by converting the hard parts (mainly decorative Arabic for quranic verses) to images, automated using my program.

Now, if this was a process that I was going to repeat then I would have stopped about half-way and re-written my parser from scratch, using the knowledge I had gained so far through the process. But this was a one-off job, I was nearly finished, I reasoned. Just the footnotes and bibliography left to do, I thought. But no, each last part of the LateX that I converted to HTML just made my program worse and worse. Still, I finally got an EPUB file that was a fair reproduction of the real printed book, Arabic content, pictures, footnotes, bibliography and all.

Using an Amazon provided utility I converted the EPUB file to a MOBI document (which is the ebook format that Amazon requires) and could then email it to my Amazon account, so that I could view it in an Amazon reader. Again, it gets funky. It turns out there are a dozen different Amazon devices and applications that readers could be using – it’s not just plain old Kindles. Each device can render things differently. If you want to keep your readers happy, you need to test your MOBI file on every one of them. Fortunately Amazon provide a device emulator, however it doesn’t work too accurately (overlines and dots under letters are just not rendered as they do on a real device) and recent versions don’t emulate the Kindle! Yes, in the end, despite Amazon providing a device emulator, I had to buy a Kindle just to test how the book would finally look on it. Even now I don’t know how the book will look on older Kindle devices, which run older versions of the software.

Finally, one last task – the ISBN number. I invented a new publisher, being me, which I named Westbury Hill Press. In the UK ISBN numbers can only be bought in batches of 10, and I only needed one (the ebook does not need an ISBN number). It is a simple process if a little pricey (around $150). Using some more free software I created a bar code that I added to the back cover, together with a suggested RRP and a publishing categorisation to make life easier for bookstore owners and librarians (as if they will ever see one! – I wish).

Finally then, I can push the Publish button. The softback is available on Amazon via CreateSpace, and the ebook via Kindle Direct Publishing. I don’t expect many sales, just a handful maybe. But that is not why I wrote the book and I don’t mind, I feel that the responsibility is fulfilled and my job is done.  الحمد لله, Thank God!

Oh, a sample of the  book? Head over to Amazon and download the sample, you can view it in the Amazon Kindle app on your tablet.

Learn more about the book at Westbury Hill Press – A Message For Tuqa.

P.S I’m now ready for further punishment – now to write my book about Madhhabs, Maps and Metaphors – I’ll be back in 5 years :-).