HOWTO: Create a usable ePub file for

I’ve been having a lot of problems with getting my latest ebook uploaded to Lulu, and I know other people have had similar problems, so here’s what I’ve learned so far. (Currently I’ve *finally* got to the point where they’ve accepted my ePub file, but then the next screen gets me an ‘unrecoverable error’).

I’m assuming, first of all, that like me you’ve created your book in a WYSIWYG word processor (like Microsoft Office or AbiWord or LibreOffice) rather than having it already in some suitable XML-like format or creating it in LaTeX or something. If you know enough to do those things, you know enough to hand-hack an ePub file anyway.

But if you have your book as an .odt , .pdf , .rtf or .doc file, you’ll want to convert it and preserve most of your formatting. The best software to do this is a Free Software package called Calibre, available for download for Windows, Mac and GNU/Linux here (though if you have GNU/Linux on your machine it’s almost certainly in the repos of your distro, and you should get it from there).

However, Calibre has what seems to me a rather unintuitive interface full of giant blobby teletubby icons. If you have any difficulty using it, you might want to use this site, which is just a web front-end to Calibre. I have no idea what, if anything, they do with your file once it’s uploaded, so the usual caveats about ‘cloud’ services apply, but I can confirm that the ePub files they generate are valid ones, and generated with a recent version of Calibre (0.7.40 – for comparison the version in Debian Squeeze is 0.7.38 while in Sid it’s 0.7.42).

When you have your ePub, you can check that it’s basically valid using this online validator. However, you can still run into several problems.

The first one I found was a Permissions problem. An ePub is just a renamed .zip file, containing lots of other files which make up your book, and Calibre appears not to give anyone else the permission to do stuff with those files.

The second one – and one that a lot of people have complained about – is unmanifested files. This problem, which is not explained properly by Lulu, is a simple one – in the .zip file, there’s a list of all the files that should be there ( this list is called content.opf ). Sometimes there are extra files in there that shouldn’t be – in my case Calibre generated a directory called META-INF but didn’t list it in content.opf .

So here’s what you need to do. Take the ePub file, and extract it (Windows users can do this by renaming yourbook.epub to and using an app like Winzip. GNU/Linux users and users of other unixalikes can use the unzip command).

Next, change the permissions of all the resulting files so that everyone can access them. Here’s how to do that in Windows. In GNU/Linux you just run the command chmod -R 777 * (making sure, of course, that the directory you’re in contains only those files that you wish to alter).

Now, open the file content.opt in a text editor (like Notepad, Gedit or Vim). You should see in there a section like:

<item href=”Pictures/10000000000000CC000000A83F7DB793.jpg” id=”id3″ media-type=”image/jpeg”/>
<item href=”Pictures/100000000000012C000001C881668E50.jpg” id=”id5″ media-type=”image/jpeg”/>
<item href=”Pictures/1000000000000177000001781C2F2F04.jpg” id=”id8″ media-type=”image/jpeg”/>
<item href=”Pictures/10000000000001A2000001837F27C3DA.jpg” id=”id4″ media-type=”image/jpeg”/>
<item href=”Pictures/10000000000002BC000000E20000658C.jpg” id=”id2″ media-type=”image/jpeg”/>
<item href=”Pictures/10000000000003CF000002FA25F145A0.jpg” id=”id7″ media-type=”image/jpeg”/>
<item href=”Pictures/10000000000003F9000001D7FD934D20.jpg” id=”id6″ media-type=”image/jpeg”/>
<item href=”index_split_000.xhtml” id=”id129″ media-type=”application/xhtml+xml”/>
<item href=”index_split_001.xhtml” id=”id128″ media-type=”application/xhtml+xml”/>

This is the list of files that should be in there. Look through that list and compare it to the files you’ve got, and delete any files that aren’t in the list. If you have anything that isn’t in this list, Lulu will (quite rightly) reject it – you could have put anything in there along with your book, after all.

Now, you’ve got your list of files sorted out, and they all have the correct permissions. What you need to do now is create a new zip file with all of these in. But it’s not *quite* that simple – you have to make sure the file called ‘mimetype’ is the *first* file in the zip file, and normally when you create a zip file the files in it are listed either alphabetically or by time added.

So what you need to do is create a new file and *only* add the file ‘mimetype’ to it. In Windows you can create a zip file called using Winzip and add this file. In GNU/Linux, use the command zip -X0 mybook.epub mimetype .

Now, once you have this file, you can add the rest of your files. In Windows, you can use Winzip for this. In GNU/Linux, use the command zip -X9Dr mybook.epub [list of files and directories] .

If you’ve done this in Windows, you must now rename your file from to mybook.epub . Check your file in your favourite ebook reader (if you don’t have one, you can read files in Calibre as well as write them) and make sure it looks more-or-less like you want it to. Then check you’ve got everything right with this online validator and you can upload it to Lulu. If everything’s gone right, then this should be everything you need to do to get your book uploaded – assuming you don’t, like me, then get a server problem on Lulu’s end.

Linkblogging For 30/01/11

Now that my book is out (still having problems with Lulu’s ePub authentication, but I will get that sorted soon) I can move on with my other writing projects again. Later today I’ll be posting my next Beach Boys post, I’ll be restarting my Doctor Who DVD reviews next weekend (I have to re-buy The Aztecs, as I brought it with me to the US to write the review last month, and Air France lost the bag), and some time this week I’m going to start a book-by-book look at Cerebus in detail. I’m also working on a short story to submit to the new Iris Wildthyme collection which has an open submission policy.

So you can expect a lot more Proper Writing from me in the next few weeks, but for now here’s some links.

(BTW I don’t intend to keep promoting the new book here, but I *would* appreciate some feedback on it from those of you who’ve bought it, either in comments here or on your own blogs.)

Via the Mindless Ones, here’s an absolutely amazing Shaky Kane piece, Monster Truck

One thing that’s always worried me is that legally, corporations have to behave like psychopaths. Overcoming Bias reports a step in the right direction in this regard.

A tip to men, though I would *hope* that most readers here wouldn’t need it – if you admire the blog of a scientist, the correct way to show this admiration is to make some comment about her ideas. “Your tits are incredible” is not likely to be appreciated.

Andrew Rilstone is very clearly and methodically demolishing the appaling Melanie Philips (who I thought idiotic when she was writing for the Observer fifteen years ago, let alone when she’s writing for the Mail now, after apparently having undergone a Sim-esque Damascene conversion to the lunatic right). Part 1, 2, 3, 4. I’ve said it before, but if I had to choose only one blog to justify the existence of the internet, it would be Rilstone’s.

In defence of infodumps

Your chocolate is made by enslaved children

Alleternalthings has two Jake Holmes albums for download

Birds can use their eyes to maintain quantum entanglement for longer than the best laboratory systems

And Liberal England has a Youtube clip of Bernard Righton, the politically correct working-men’s club comedian. I remember trying to explain this act to Holly once, as John Thompson was a neighbour of ours at our old house, but it’s an act which really is all in the performance.

URGENT: Contact Home Office To Prevent Brenda Namigadde being deported.

Brenda Namigadde is to be deported to Uganda tomorrow. From Chicken Yoghurt:

The British Foreign Office advises visitors to Uganda that ‘homosexuality is illegal and social tolerance of it is low.’
David Kato could certainly confirm that. If he wasn’t dead.
” A Ugandan gay rights campaigner who last year sued a local newspaper which outed him as homosexual has been beaten to death, activists say.”
There’s no proof that Kato’s death and outing are linked. This must have worried him though…

” Uganda’s Rolling Stone newspaper published the photographs of several people it said were gay next to a headline reading “Hang them”.
Homosexual acts are illegal in Uganda, with punishments of 14 years in prison.”

Anyway, in other news we’re deporting Brenda Namigadde back to Uganda tomorrow.

“A lesbian woman due to be deported from Britain to Uganda has been told by a Ugandan MP that she must “repent or reform” when she returns home.
The politician, David Bahati, intervened in the case of Brenda Namigadde, due to be deported on Friday, saying he would drop a clause making homosexuality punishable by death in a bill he introduced to the Ugandan parliament.”

Very good of him, I’m sure you’ll agree. I bet that will put Brenda’s mind at rest. If you yourself aren’t sure about it, you can try and appeal to the Home Secretary’s better nature and ask her to heed the advice of her Foreign Office colleagues:

Ask her to exercise her discretionary powers to stop the flight, release Brenda Namigadde from detention and to grant her protection in the UK. Please remember to quote Brenda Namigadde’s Home Office Reference number 1166867 in any correspondence.

Rt. Hon Theresa May, MP
Secretary of State for the Home Office,
2 Marsham St
London SW1 4DF

Fax: 020 7035 4745


(Hope Justin doesn’t mind me quoting his blog post in toto, but I thought the signal boost important and am too tired to compose something myself).

My email, which you’re welcome to use as a guide:

Ref: 1166867
Dear Sir/Madam

I am writing to ask that the Home Secretary use her discretionary powers to release Brenda Namigadde from detention and halt her planned deportation to Uganda. As a lesbian Ms Namigadde faces immediate arrest on her return to Uganda, and imprisonment for 14 years. She may well face death, like David Kato, who was beaten to death yesterday because of his homosexuality.
Please do not let this woman, who has done nothing wrong and has already suffered unjustly by being interned in Yarl’s Wood, be punished any more for her sexuality.

Andrew Hickey

Given the pretty appalling climbdown over civil liberties Ms May announced yesterday, I’m not holding out much hope, but we do supposedly have a policy of not deporting homosexuals to countries where they’d face persecution, so we’ll see…
Normal blogging resumes tomorrow

The New Book Is Out!

For my 600th post here, I’m announcing that my new book, Sci-Ence! Justice Leak!, is out. It’s available as a hardback book with a pretty dust-jacket for twenty pounds, a paperback for ten pounds, a PDF for only three pounds, and tomorrow it should be available as an ePub for a fiver, so there’s a version for every taste and wallet.

The book, for those who haven’t read my recent deluge of posts on the subject, is a set of interlinked essays on Grant Morrison, Doctor Who/Faction Paradox, Jack Kirby, DC Comics, the ideas of ‘continuity’ and ‘canon’, quantum physics, black holes, the life trap, entropy, cybernetics, Liberalism, Hypertime and more. It collects all the ‘escapology and eschatology’ and ‘hyperpost’ essays, but does so in a way that makes it more than the sum of its parts – I’ve put a LOT of effort into structuring this, and it will, I hope, repay study. I’ve tried to make it the same sort of dense, fractally structured thing as Who Sent The Sentinels or The Book Of The War (though whether I’ve succeeded or not is hardly for me to say).

Now, this book has a VERY limited audience. I thought it would be limited to just me, but David Allison and Plok both liked it, so there may be as many as five people who would like it. But those people would *REALLY* like it.

I am very proud of this, and want those five people to find it, so could anyone who buys this, or who has a friend who might be interested, PLEASE let as many people as possible know about it? Even if you don’t like it, a link from a blog or a tweet might let someone who *would* like it know about it – and a bad review of this might be as attractive to the tiny number of people who would enjoy it as a good one.

I’m not asking for links to make money on this – there’s no way on earth I’ll ever make a decent hourly wage for the time this took – I’m just genuinely proud of this thing, and think that the few people who like it will like it A LOT, so I want them to find out about it.

Thank you, and thank you to everyone who’s read these 600 posts, without whom I would never have written this or my other book. And now this is out, I can go back to posting about other stuff, starting tomorrow.

Big Finish: Peri And The Piscon Paradox

Big Finish’s output has been very, very variable recently. In the last couple of years, since they started doing ‘trilogies’ rather than stand-alone stories, they’ve become increasingly likely to do complicated continuity-twisting stories – the Sixth Doctor travelling with the Second Doctor’s companion, the Sixth Doctor travelling with the *Eighth* Doctor’s companion, three Celestial Toymaker stories in a year… this month’s story involves the Sixth Doctor and Evelyn teaming up with DI Menzies (a character from the Sixth Doctor’s future who has to pretend she doesn’t know him) against Thomas Brewster (a character from a Fifth Doctor trilogy from a couple of years ago).

But then you get stuff like A Death In The Family, the recent story by Steven Hall (the writer of The Raw Shark Texts), which manages to play with continuity lightly and tell a story about the nature of reality, the nature of fiction, the power of words, and the sacrifices people will make for each other. The gimmick – the Seventh Doctor and Evelyn – and the continuity references (it ties up threads from at least eight different stories going back nearly a decade) don’t matter. A Death In The Family is as good as anything Big Finish have done in the last five years, and was far and away the best thing they put out last year.

It’s only the 23rd of January, but I already know what the best thing they’ll put out this year is.

Peri and the Piscon Paradox is part of the Companion Chronicles range – a range of stories closer to audiobooks than the full-cast dramas Big Finish usually do, where an actor playing one of the Doctor’s companions tells a story over the course of a single CD, with one other actor usually taking part to play a character they’re narrating to or something.

This one, by Nev Fountain, is a little different in that it’s two CDs long, and the second actor is actually Colin Baker as the Sixth Doctor. It’s also the single best multi-Doctor story ever. This post, like all my reviews, may contain spoilers from here on in, but be assured I’m not actually spoiling anything.

The first disc tells a story of Peri and the Fifth Doctor fighting a fish-monster-thing in LA in 2009, with the assistance of Peri’s ‘forty-several’ year old self, an agent for a secret government agency who Peri quickly grows to despise. It ends with Peri vowing never to become like her older self.

The second disc tells the story of Doctor Perpugilliam Brown, presenter of a ‘celebrity relationship counselling’ TV show, and how she gets dragged into a complicated plot by a man claiming to be someone she once met in Lanzarotte, more than twenty years ago, even though he looks nothing like him, and how that plot involves tricking a past self she can’t remember.

Those who remember Nev Fountain’s earlier Big Finish work, especially The Kingmaker, will recognise a number of his regular motifs as the story goes on. Not only are there multiple Doctors interacting without being fully aware of each other’s actions, and time paradoxes, there are many, many jokes set up in the first half that only pay off in the second. The first three-quarters of this story, in fact, is pretty much laugh-out-loud funny throughout. I know it’s hard to believe, given that Fountain also wrote for Dead Ringers, but it is a good piece of comedy.

And Nicola Bryant is excellent. Despite the fact that she’s hampered by having to do the accent and characterisation she lumbered herself with as a much younger actor, she manages to play the two Peris remarkably well, and it’s an astonishingly subtle, nuanced performance. Colin Baker is, of course, as excellent as ever, and is in it more than you might think.

But it’s only at the end, when the full story is revealed, that what Fountain is doing really falls into place and you realise just how good this actually is. In a couple of lines of dialogue, Fountain clears up a continuity problem that avid fans reading this have already spotted. At the same time, he also manages to make the story about things – about growing up, about betraying our youthful ideals, about our youthful ideals betraying us, and about how we harden with age and with compromise. It’s a very sad, very political story, in the end. He gives the story a bittersweet ending that fits in with my own preferred ‘all stories are true’ Doctor Who ‘canon’, and he manages to make the same scene seen from two different angles mean two totally different things. It turns what was already one of the best stories Big Finish have done in a long time into one of the best they’ve ever done.

A Death In The Family is better, but that requires you to have listened to more stories and to have an attachment to the characters. This is a wonderful comedy that suddenly punches you in the gut, and will do so no matter who you are.

All the praise that people have been giving Moffat’s A Christmas Carol should really be going to this story – it does the same things (and indeed some of the same things that this month’s main-range Big Finish story does) so much better that the TV story looks like a sad parody of this one. It’s a story that anyone at all could listen to and get a *lot* out of, and it’s something that could only have been done as Doctor Who. I’ve only listened to it once, but it may be in my all-time favourite Doctor Who stories. It’s certainly in my favourite Big Finishes (along with Davros, The Kingmaker, Jubilee, A Death In The Family, Doctor Who And The Pirates, The Holy Terror and Spare Parts) and is one I would urge anyone to listen to.

Even many Big Finish fans don’t buy the Companion Chronicles, because they’re seen as cheap filler things This one really, really isn’t. It’s as good as anything they’ve done. Buy it, if you like funny, intelligent, thought provoking science fiction, whether or not it’s labelled Doctor Who. It’s only a tenner as a download, and it’s worth every penny.

I do have one proviso though, that I feel obliged to mention even though it may be slightly more of a spoiler than the other things I’ve said

and that is that the ending may be triggering for those who have experienced spousal abuse. It’s dealt with sensitively, and in a way that’s necessary to the plot, but be aware that it’s there.

Sci-Ence! Justice Leak! The first review… and a spot of crowdsourcing

I’ll be doing a proper post tonight, I hope – I apologise to my regular readers for the lack of them while the book’s been being put together. The book should be out very soon now – I’ve heard back from David Allison, Holly and Plok will both be getting their thoughts to me sometime today, and I don’t know if or when my fourth previewer will be able to get back to me (his involvement was conditional on other things, and he’s been extraordinarily busy). It’s days rather than weeks now.

Anyway, David has let me post some of his comments here, to give people an idea of what someone who’s actually read the book thinks:

I found the format a little frustrating for the first few chapters – I wanted more on each of the topics that you were writing about but you just kept pressing on. Still, better to leave people wanting more than to batter them into disinterest, eh? Since you DO return to most of your subjects more than once, this doesn’t end up being a problem, and as you well know the form suits your themes well.

Now I’ve always been a big fan of stories that express their themes in form as well as in content, and you’ve done that brilliantly here – the Best Man Fall/Mister Miracle chapter, which felt fun but slight on your blog, works perfectly as a culmination of what’s gone before. And then, typically, it turned out not to be the end of the book, but…. I genuinely think that if I hadn’t been “in” on this project in a couple of ways, if I was coming to it cold, then I would have probably went straight back to the start of your book and started reading it again when I got to that chapter. Please note: this is a feature, not a bug!

Make no mistake, I will read it again. I know I’m laying on the praise a bit thick here, but it’s well deserved. Like I said on That Twitter, these articles gain something by being collected in this way, which is important! There’s an implicit irony here, in that what they gain is a sense of cohesion, of authority even, but that doesn’t run contrary to what you’re trying to do – this is your story, and maybe it intersects with our own individual stories at points, but even when it doesn’t it’s good to know that it’s still going on without us…

Now, onto the crowdsourcing question. One of the articles in the book is this one, on Liberalism and Cybernetics. Now this is absolutely essential to the themes of my book, but it talks about the Lib Dems and was written pre-Coalition. I’ve attempted to address this with a footnote:

This essay was written before the Liberal Democrats joined a coalition government led by the Conservatives in 2010. This government has slightly less of this micro-managing tendency, though it has more than its fair share of other problems.

but I’m not sure this is enough. Put simply, the Lib Dems have such an image problem right now that two different people have told me (one of my proofreaders plus someone else on Twitter) that they’d had a visceral, gut reaction against seeing mention of the party in this context.

Now, I obviously don’t think that image problem is entirely justified, or I wouldn’t be a member of the party, but I do suspect that this means I might have to do some work on this essay, to separate Liberalism as a philosophy from the Lib Dems as a party from the Lib Dem/Conservative coalition government. As I see it, there are the following options:

1) Leave it as it is. It’s an accurate description of Liberalism and the Lib Dems. It’s not an accurate description of the current government, but it probably does a reasonable job of describing the Lib Dems’ role within that government, and the government is a temporary thing while the book will (hopefully) be permanent. And in some ways giving some readers that stumbling block might make them think more. Plus, the book is aimed at readers worldwide, and the image problems of the third-largest party in a small European country are not relevant to the vast majority of potential readers.

2) Replace it with What I Mean When I Call Myself A Liberal, which is a much more literal piece, and would work less well in the context of the book, but was written post-coalition so takes recent developments into account.

3) Put both the above pieces in. There’s duplication of material, but there’s also two articles about Darkseid, and two on Superman. Plus a longer book makes for better value. But do I really want to hit the readers over the head with my political views?

4) Write an entirely new piece containing elements of both the above, and run the risk of falling between two stools and being worse than either.

5) Other? (Suggestions welcome).

Note that removing the chapter is not an option. It’s not included to make readers sit through a party political broadcast about my own political views, or to win converts, but because it’s a cornerstone of the whole thing. Without that piece, the stuff I have to say about Batman comics, or Doctor Who spin-off novels, or fanfic, makes no sense.

Linkblogging For 20/01/11

Proper posts resume this weekend. In the meantime, some links:

Power Pop Criminals has a compilation of 21 different versions of the Move song Do Ya, including versions by Parthenon Huxley, Matthew Sweet, Linus Of Hollywood, Jason Falkner and more. Look out baby there’s a plane a comin’!

Scientists Grow Human Liver Tissue For Use In Transplantation

Should a dodgy paper on ‘antidepressants’ be retracted?

You’ve clearly had too many dinner parties with other Tories, public tells Baroness Warsi

How “Guido Fawkes” (P. Staines) is enabling rape threats against Laurie Penny

A free textbook on networks, crowds and markets

Millennium Dome on the economics of the cuts

Political Betting on the Lib Dem ‘collapse’ – fact or fiction?
. They also have this great bar-chart

Stuart Douglas on Simon Dupree And The Big Sound – this got me listening to them for most of last night.

A rather sadly beautiful true story about entropy

Calamity Jon Morris looks at the career of the Super-Mouse in Superboy

Stanley Unwin’s epitaph nearly made me cry

Death To The Universe on representations of thought in comics

A simply *extraordinary* Buddhist temple, featuring images of Superman, Batman and Keanu Reeves

Teleportation through time is apparently possible on the quantum scale