Can Everton Jones find out how his father stole Emperor Bokassa’s diamonds and, more importantly, where he hid them; before the world and his brother get there first?
Click on the picture link in the sidebar to read an extract of my first novel, which was published by Paradise Press in August 2012.

Saturday, 31 May 2014

How to understand the syntax of CSS

After several posts on CSS, I thought it best to have a post which goes into the syntax of CSS in detail.

I’ve already covered this in an earlier post but, for reference, the CSS stylesheet needs to be linked to EACH chapter in your e-book by including the following line in the <head> section in the chapter:

<link href="../Styles/MyStylesheet.css" rel="stylesheet" type="text/css" />

Once you have linked the stylesheet in the first chapter, splitting that chapter using Sigil will copy the stylesheet link to the new chapter.

The stylesheet is just a text file, although the extension should be ‘.css’. It needs no header and should contain no html. It should just contain a single line for each style, as indicated below. First consider the style for a paragraph (enclosed in the html file by <p> and </p> tags). The syntax is just this in the CSS stylesheet:

p {style definition}

style definition will be discussed later. What this line in the CSS stylesheet achieves is to apply the style definition by default to every paragraph tag in your e-book. By way of illustration the following definition in the CSS stylesheet makes ALL paragraphs in the document indented by 1 em:

Wednesday, 21 May 2014

How to style an ebook so it works with the limited CSS styling available to Kindle e-readers.

The kindle e-reader only allows a subset of html tags and has limited CSS styling available. Whilst the Amazon Kindle Publishing Guidelines looks like a comprehensive reference, it contains a number of untruths and can be confusing at best and misleading at worst. Experience has taught me that:

  • Kindle ignores the margin-top property, even though the Amazon Kindle Publishing Guidelines state the exact opposite.
  • Kindle also ignores the margin-right property.
  • Kindle cannot accept a display property with a value of ‘none’.
  • Kindle ignores any @font rule, and so trying to embed fonts is futile.
  • Kindle will not display .png images properly, use .jpg instead.
  • In common with nearly all e-readers, the Kindle won’t do small caps accurately.
As a consequence I have developed the following work-arounds:

Thursday, 15 May 2014

How to replace the markup with CSS styles in your ebook using Sigil

Once you have your ebook text imported into your epub as a single chapter of unformatted text containing the markup codes you created, the next step is to replace this markup with the necessary CSS styling. This post deals with the mechanics of replacing the markup. Future posts deal with the syntax of CSS and also which styles work with Kindle and, more importantly, which do not.

Let’s first consider how to apply the styling for a chapter heading. The paragraph in the original MS Word file would have been marked up* by inserting ‘/ch/’ (or something like that) at the beginning of the line (*see my post on this):

/ch/Chapter Heading

Once the file has been converted to unformatted text and imported into your epub file using Sigil, the chapter heading will look like this:

<p>/ch/My Chapter Heading</p>

You need to use Find and Replace to change: ‘<p>/ch/’ to: ‘<p class="chapterHeading">’ throughout the ebook file. The outcome should be:

Sunday, 11 May 2014

A Phoenix can rekindle a flame?

Yesterday a man with a beard put on a dress and won the Eurovision Song Contest. I’m being deliberately provocative here, as a Drag Queen is far from ‘a man in a dress’: a Drag Queen is larger than life, a Drag Queen is outrageous, a Drag Queen is in-your-face, a Drag Queen is definitley someone you don’t want to get on the wrong side of and, above all, a Drag Queen is dangerous.

I must say I have always regarded the Eurovision Song Contest as something of a joke, although I know many gay men who watch it avidly every year. It might in some way be considered one of the great camp classics. Yet UK performers with reputations to defend seem no longer to consider it worthy of their attention.

However in the homophobic backwaters of Europe several pieces of the former Soviet Union have taken the contest enthusiastically to heart and each year team up to vote each other’s acts into the top places. Until that is, The Russian Federation began helping itself to pieces of Ukraine, which rather took the gloss off their chummy legs-up to their neighbour this year. Well, at least we are spared the outdated spactacle of whirling sword-swashing Cossaks or balalaika bands or the Song of the Volga Boatmen.

But what we were NOT spared was the visible expression of intolerance in Russia, Beloruss and Armenia where online petitions have apparently been organised callling for Miss Wurst’s act to be edited out of the TV coverage.

Quite how they would do that now she has won I would be interested to see. A bit like when the Sex Pistols had a number one hit with ‘God Save the Queen’ and the BBC wouldn’t screen it. Or more recently when ‘Ding Dong the Witch is Dead’ pulled off the same trick, this time after an online surge of downloads following the death of Margaret Thatcher propelled it to number two.

Not an unreasonable link to make, as the Thatcher government’s ‘Section 28’ of the Local Government act banning the ‘promotion of homosexuality as a pretended family relationship’ eerily foreshadowed the new Russian law. Which I guess is where I’m going with this.

Anti-Clause 28 Demonstration, 1988 (source)
You see we thought we had won the big battles, back in the ’80s when that hated legislation was introduced. Gay sex had, finally, been decriminalised, albeit with an unequal age of consent, and we were working on that. Gay clubs and bars were everywhere in big cities at least and Gay Pride kept getting bigger and bigger every year. Section 28 was a huge wake-up call and brought together gay men and lesbians in a way we hadn’t seen since the seventies. And many valuable grass-roots LGBT initiatives were begun which are still serving our community today.

In this year’s Eurovision Song Contest the Russian contestants were loudly booed by the audience in cosmopolitan Copenhagen whenever they received favourable votes. No doubt the same people who were booing had voted for Miss Wurst. And not only because she had a wonderful song, but most likely also in response to the current Russian government’s hostility to the human rights of gay men and lesbians. And it is no co-incidence that the focus of that protest was a Drag Queen.

love the slogan on the poster in this snap taken at the Stonewall Riots (source)
Wind the clock back to the sixties in New York and a routine police raid on a bar on Christopher Street in the Gay Village in New York’s Soho district. That’s right, I’m talking about the Stonewall Inn. Drag Queens played a prominent part in the series of riots which followed over the weekend and the rest is, as they say, history (see the link at the end of this post).

An apposite image of Trade Unionists at World Pride 2012 in London (source)
Or is it? We all thought it was history and minced down Oxford Street in Pride every year to celebrate our newfound emancipation. And then Section 28 happened. We now have Gay Marriage in the UK, and many think there is nothing left to compaign for in this country. Never mind the arguments about whether as Queers we should be aping conventions of non-queer society – some among us would even question whether monogamy is normal – or even whether the previous arrangement (civil partnerships) were a perfectly acceptable alternative. (Actually it’s not often voiced but a UK civil partnership can’t be anulled on the basis of infidelity, and so this argument is false and betrays an inherrently homophobic bias in the legislation which isn’t widely recognised.)

Come back to today’s news for a moment and another victory can be claimed in the US as an openly gay American Football player signs for the St. Louis Rams. I say openly gay, as there must be many more gay footballers fearing discrimination and cowering in their closet. (And he had to wait until the last round of the ‘draft pick’, even though before he came out he was tipped to be selected sooner, so chalk this up as only a partial victory.)

Which reminds me that not so many years ago Justin Fashanu, a gay black soccer player in the UK committed suicide eight years after he came out.

And whilst I can walk down Old Compton Street (or pretty much anywhere in Central London for that matter) and do whatever I like and express myself without a concern, the situation is far from being so friendly in Doncaster or Bradford or any other small town you care to mention.

Homophopbia is still widespread and we need to continue the fight. The rights we have and the legal protection we have won is on the backs of Drag Queens and campaigners of all kinds bravely claiming their right to be who they are in the face of a hostile society, quite as hostile as Russian society today. And even though we have these rights we need to exercise them and claim them as our own.

Conchita Wurst’s slap in the face for Vladimir Putin should remind us all who we are, where we have come from and why the fight is important. Truly a phoenix rising again.

The First Gay Pride March in 1970, on the first anniversary of the Stonewall Riots. (source: pinkmafia, which has a wonderful account of the Stonewall Riots.)

TinyURL for this post:

Wednesday, 7 May 2014

How to create and link a CSS stylesheet in an e-book using Sigil

Once your book text is imported into an epub file, you will need to style it using CSS. To do this you could use ‘inline’ styles, but that is inefficient and difficult to update. The most elegant, and efficient, way to apply CSS styles is using a CSS stylesheet. This post covers how to create and then link a CSS stylesheet in your e-book. Subsequent posts will cover how to define the CSS styles and more importantly which CSS styles will work with Kindle and which will not.

To create a new stylesheet in your e-book using Sigil, first right-click on the ‘Styles’ folder in the book browser. Then select ‘Add Blank Stylesheet’ from the pop-up menu:

Sigil creates a blank stylesheet called by default: ‘Style0001.css’ for you. You will probably want to rename it, so right-click on the filename in the book browser and select ‘Rename…’ from the pop-up menu:

Thursday, 1 May 2014

How to import your marked-up MS Word file into your ebook using Sigil

Sigil is set up to import an MS Word file in its entirety, including all the styles and formatting. This might sound like a good idea until you actually do it and look at the file in code view. You will see literally hundreds of lines of code: the entire MS Word stylesheet, in fact, re-coded in html and CSS. Probably, for an epub, this might render properly, but there is so very much that could go wrong that something probably will. And if even just one tiny bit of it it does go wrong, mending it would involve unpicking the entire MS Word stylesheet. A task well beyond my limited skills and one which would depend also on how logically the original MS Word document styles were constructed in the first place. And as for Kindle, it supports so few html tags and even fewer CSS styles that the chances this will work on a kindle are in my opinion negligible.

So my preferred strategy is to keep the e-book as simple as possible, and that way eliminate any possible problems from the beginning and ensure I know exactly what is happening. This means importing your document as plain text (marked up to indicate where your formats go) and then re-applying the formats using CSS and html which you know will work on a Kindle and an e-pub. (See my post about which CSS works with Kindle and which does not.) Persuading Sigil NOT to import the MS Word stylesheet is not as straightforward as it might at first sound. Even then a little bit of tidying up of the file is necessary, but this can be done in a matter of minutes using find and replace. This post outlines how I go about it.

Once you have marked up your book text in MS Word, remove any comments you might have in it. And then, when it is ready, save it as unformatted text in a .txt file. To do this, click the ‘Office’ button (top left) and select ‘Save As…/Other Formats’:
Twitter Bird Gadget