Category Archives: Writing

Simile and metaphor

I am still reading through The Inklings and King Arthur, and in all probability will be doing so for a few months to come (alongside other book, sof course). It is a very rich and stimulating book which touches on all manner of different topics.

Cover - The Inklings and King Arthur (Amazon)
Cover – The Inklings and King Arthur (Amazon)

For today I want to look at several different ways in which word images are used. The standard textbook definitions of simile and metaphor are that a simile is explicitly introduced with a word – usually “like” or “as” – but a metaphor is just presented directly. So it’s comparatively easy to spot a simile – “he ran like the wind“, “his grip was as hard as bell-metal“. But by the same token, a simile is soon over. Once the link is set up, it is pretty clear… so long as you understand the reference, there’s not a lot to add. It might be strikingly effective in its setting, but it’s soon over.

But a metaphor is usually much more open-ended, and often opens up other dimensions for the reader to explore. “But soft! What light through yonder window breaks? It is the east, and Juliet is the sun.” I wonder what different people take from that metaphor of Romeo’s? That she is bright, warm, life-giving, brings wakefulness after sleep? Or that she is easily hidden behind clouds, and that too much of her tends to burn you?

The Flight of Icarus (Gowy, Wikipedia)
The Flight of Icarus (Gowy, Wikipedia)

We bring our own history into a metaphor as we engage with it. So the person who is at the tail end of a long dark winter will read it differently to the person on a summer beach on holiday. Icarus would certainly have a different opinion!

When an author uses a simile, it is generally low-risk. The likeness is presented in a sentence, or perhaps a paragraph, and then it is gone. About the only thing that can go wrong with it is if people don’t understand the point of reference, or if the comparison is so laughable as to be absurd rather than stimulating. The annual “bad sex scene” writing awards often attract prizes when bizarre similes are used for various body parts.

But a metaphor usually permeates much more of a book. It might shape the whole storyline, or suggest features in the background which the author chooses not to specifically focus on. A common one is to use seasons to suggest emotional content: “Now is the winter of our discontent“. The writer can glide without much effort between the literal meaning of a word or concept, the associations that a reader draws in from experience, and the way that events in the book are playing out. Some authors construct very thorough associations between the two ends of the metaphorical connection.

This can make it what I called high risk – if a reader misses the link (which has never been highlighted explicitly by the author), or does not understand the connection, or finds it implausible, it’s not just an odd paragraph that suffers but potentially the whole plot. Some readers are very concrete, very literal in their approach, and don’t get the point of a metaphor. They want everything to be direct rather than indirect. For such readers, a high metaphorical content is frustrating and pointless. Readers differ, and while some will love a book which constantly points away from itself into other metaphorically connected worlds, others will not.

Cover - The Lion, the Witch and the Wardrobe (Goodreads)
Cover – The Lion, the Witch and the Wardrobe (Goodreads)

Now, the Inklings in their own writing used metaphor on lots of levels (as well as simile). Tolkein and Lewis were both highly trained scholars in academia, and it is natural that their knowledge of old source materials informs what they wrote. So their writing can be read on lots of levels. You can certainly come at them just as stories, and when one encounters them as a child or young person that is just how most of us respond. But on rereading, other dimensions come into play. Both of those authors wanted to create a world which seemed to readers to be real, with a deep and rich history behind the events on the page. Metaphor helped them to create such worlds.

Seasonal metaphors are certainly present – The Lion, the Witch and the Wardrobe would not be the same story if we didn’t recognise and respond to the nature pictures of ice gripping the land and yielding to the sun. Aslan’s title of Son of the Emperor over the Sea pulls on two millennia of Christian imagery, and also the happy accident of the English language that Son and Sun are so alike. Frodo’s journey out from the Shire in The Lord of the Rings would not have been the same if it had happened in spring or early summer, rather than late autumn turning to winter.

It is not my purpose here to list all of the metaphors used by either author – that would be a prodigiously long task – but to highlight that they both, along with many others, used metaphors to liven and enrich their writing.

Text and intertext

I have just started reading a non-fiction book entitled The Inklings and King Arthur: J. R. R. Tolkien, Charles Williams, C. S. Lewis, and Owen Barfield on the Matter of Britain. It’s not a catchy title, but so far I am hugely enjoying the content. As you might expect, it’s academic in tone, consisting of a series of essays by different people all around how the various members of “The Inklings” approached and reworked Arthurian material. And inevitably it has provoked my own thinking in various ways.

The (major) Inklings (PInterest https://www.pinterest.co.uk/pin/369717450630781095/)
The (major) Inklings (PInterest https://www.pinterest.co.uk/pin/369717450630781095/)

The four men mentioned in the book title had very different views on life, religion and indeed most matters, but they were united on a few quite specific areas. One was that modern life as they witnessed it emerging was poor as regards its mythological underpinnings. Another was that the Arthurian legends – the Matter of Britain – were worth keeping alive, and retelling in ways relevant to their society.

Now, one of the fascinating things about Arthurian tales is that they are in constant conflict with one another. There is no original text, no authoritative canon of tales against which some particular version can be compared. Each subsequent reteller selects the pieces they want and rejects other pieces. They put the same characters into new settings, or mix up participants in a venture. The collection of stories is hugely diverse and contradictory. What’s more, as you push back in time to look for some point of origin, the picture becomes more confusing, not less. Some of the early traditions come from England, but others from Wales, France, and Scotland, and in many cases the direction of derivation can no longer be decide with confidence.

Monty Python and the Holy Grail cover (IMDB)
Monty Python and the Holy Grail cover (IMDB)

Authors drawing on the Arthurian tradition over the years since then have carried this habit on. Arthur and his knights have been cast into all kinds of different settings – futuristic, fantastic, or resolutely historical. Tolkein, Lewis and the other Inklings did the same – they borrowed bits and pieces as they saw fit, renamed individuals and recombined them in different settings, and energised the ongoing collection of tales with their own contributions.

Now this recombination of elements of older pieces of writing into newer ones is often called intertextuality. Usually it is a conscious choice on the part of an author, but sometimes it is unconscious, and simply reflects deep familiarity with the sources. That’s from the author’s perspective. Looked at from the reader’s point of view, it means that associations and emotions triggered by the older works are drawn forward into the newer ones.

Christopher Lee as Saruman (http://lotr.wikia.com/wiki/Saruman)
Christopher Lee as Saruman (http://lotr.wikia.com/wiki/Saruman)

A similar process happens in film. If you have seen an actor play in a particularly striking role in one film, it is all but impossible not to see that previous character in the new one. Film-makers are, of course, well aware of this, and it often drives casting decisions. So when Christopher Lee appears as Saruman in the film version of Lord of the Rings, his previous roles in horror films constantly cast shadows around him.

Back with books and the Arthurian tradition, it has been argued that this ability to be reshaped into so many different forms is exactly what has kept it alive for so long, and through so many social changes. A fixed story that allows only one telling will wither and die, as the circumstances that gave birth to it fade into the past. By analogy with biology, successful stories are those which can adapt to new environments and new pressures.

Cover - DC Comics futuristic graphic novel retelling (Barnes and Noble)
Cover – DC Comics futuristic graphic novel retelling (Barnes and Noble)

All of which makes the quest for a historical Arthur, however interesting from a historian’s viewpoint, a rather pointless exercise from the literary one. Of course there are fascinating stories of Arthur and his companions to be told from a historical perspective – say a fifth or sixth century military leader after the Romans have left and before the Saxons consume the land. I have read some of those stories, and enjoyed them. But there are other stories of Arthur which are rooted in fantasy and magic, or where the quest for the Grail takes the questers out of our ordinary world. And stories where the company is located in another place and time. Or science fiction versions where the physical connection with England is at best tenuous. And the magic of intertextuality means that none of these are more or less proper than a conventional historical fiction version.

Variations on history

Last week I spoke about science fiction and fantasy, and the crossover world between them. Today I want to look at another genre which offers a twist on the normal world. Many of my author friends write historical fiction – stories based around real historical contexts or people.

Cover - In a Milk and Honeyed Land
Cover – In a Milk and Honeyed Land

My own series of Late Bronze books, which were my first real foray into writing books at all, fit neatly into that category. Kephrath, the town at the centre of those three books, is a real place, and the wider events fit in with one interpretation of the scanty historical record. The people I describe are credible for their place and time, but they are imaginary. Obviously I’d like Damariel, the village priest and seer, to have really lived in history, but we don’t know, and probably will never know for sure.

Now, by setting those books at the end of the Late Bronze Age – around 1200BC or so – I gave myself a huge advantage. This wasn’t my original motive: I simply liked that part of history and wanted to approach it in fiction. But the unexpected advantage is that our knowledge of that time is very scant.

Ramesses II at the Battle of Qadesh (Wikipedia)
Ramesses II at the Battle of Qadesh (Wikipedia)

Serious academic debates take place over how to understand particular texts, or how to reconcile apparent contradictions. The regnal dates of Egyptian pharaohs are often speculative by years or even decades (despite the seemingly definitive values often written in books or web pages), and that uncertainty multiplies when you look to other nations. Accurate details of anybody lower in rank than the most elite are extremely sparse. So I am writing in a place where fixed facts are scattered very sparsely.

Now many of my friends do not have this luxury. They are writing in places and times where recorded facts hem them in on all sides. Their stories are still fiction, but their characters often have little freedom of action in their densely packed surroundings.

This wouldn’t matter so much – after all, a story is a story, you’d think. But a small number of reviewers are ruthless in their critique of perceived anachronisms, and waste no opportunity to highlight them. Now, don’t get me wrong, I enjoy research along with everyone else – but one feels that such reviewers miss the point that they are, in fact, reading fiction. I am sure that this is a tiny minority of the total readership, but they seem to exert undue influence, certainly over the sensibilities and anxieties of authors.

I have every respect for authors who, despite these difficulties, persevere in writing about places and times that they thoroughly love. And I’m certainly not suggesting that those who write other kinds of books are simply trying to avoid trouble: all of us in the indie world write what we do because that’s what we want to write about! But it is interesting that there are other close relatives of historical fiction which avoid some of the pitfalls.

Cover - Pavane (Goodreads)
Cover – Pavane (Goodreads)

There’s alternate history – at some point in the past, events diverged from what we know. A classic of this kind is Pavane, by Keith Roberts, where the timeline branches with the assassination of Queen Elizabeth I. But there are many others – probably the best known to many readers of this blog will be Alison Morton’s Roma Nova series. History unfolds a bit like our own… but also a bit different, and depending on the intention of the author either the similarities or the differences can be centre stage. So long as the world is internally consistent and convincing – which is no simple job – it doesn’t really matter if the facts get , let us say, jumbled up.

Cover - The Lions of Al-Rassan (Goodreads)
Cover – The Lions of Al-Rassan (Goodreads)

Another option is historical fantasy – a setting from history is chosen, but with a twist. The twist can be to take seriously beliefs and assumptions of a past age – such as the reality of magic, for example. Or it can be a much more radical departure. Guy Gavriel Kay, in The Lions of Al-Rassan, presented what was essentially the complex political and religious situation in Moorish Spain as Christianity started to recover territory. And yet… it also isn’t that. The world isn’t quite true to that portion of our own history, but has its own quirks and direction. (I read it with a book club, and it didn’t quite work for me as a novel, but I have every admiration for the feat of imagination involved.

Science fiction occasionally gets in on the act, as well. Ursula LeGuin used her considerable knowledge of sociology and anthropology to root her alien cultures in a credible past. So one of the cultures in Rocannon’s World is a bit like meeting Medieval Europeans… but again, it’s not quite like meeting them. And fantasy novels of course need a plausible culture to root themselves in, whether that be the familiar territory of elves and orcs, or something from elsewhere in the world.

Meanwhile, of course, there are those brave souls who set their books in this world, in a real part of history, and with their characters surrounded by real historical individuals. For my part, if and when I return to history from the intoxicating world of science fiction, it will probably be back in the ancient past – much longer ago than the comparatively recent times of the Late Bronze Age. We shall see.

Science fiction and fantasy

Over the weekend I came across one of those many internet tropes – a quote from someone, on a pretty background, with no interpretive comment by the poster. I must admit that normally I ignore these and scroll past them to a post which has more engagement with a real person. But this one did actually catch my eye, mainly because it resonated with what I was already thinking about.

Here’s the quote (without the pretty background)

“Science fiction deals with improbable possibilities, fantasy with plausible impossibilities” (Miriam Allen deFord)

Cover image - Xenogenesis (Goodreads)
Cover image – Xenogenesis (Goodreads)

Of course I started worrying at this, like a lively dog chewing at a toy. Leaving aside the rather pleasing symmetry of words, did I actually agree with it? The lady to whom the quote is attributed was an American writer whose main activity was in the mid-twentieth century. She was roughly contemporary with EE (Doc) Smith, a generation down from HG Wells, and rather older than Isaac Asimov. Most of her writing was in the form of short stories for magazines, though she wrote a few novels as well. She straddled the genres of mystery writing, true crime accounts, and science fiction – for the curious who don’t want to shell out real money, several of her works are on the Project Gutenberg site.

Isaac Asimov (Wikipedia)
Isaac Asimov (Wikipedia)

So, did I end up agreeing with the sentiment? Well, not really. Miriam Allen deFord was writing in a time when genres were quite strictly defined, especially by those individuals who ran the magazines of the day. Those people were hugely influential within their sphere, and were instrumental in founding the writing careers of a lot of people. But their personal likes and dislikes shaped what was written. Allegedly, Isaac Asimov almost never wrote about alien life because John Campbell, editor at Astounding Science Fiction (later called Analog), had a personal antipathy to that kind of storyline. In Asimov’s case, the habit was so strong that, so far as I can recall, aliens appear just twice in his writing – in a parallel universe in The Gods Themselves, and in an enormously far ahead future in The End of Infinity.

Cover - The Buried Giant (Goodreads)
Cover – The Buried Giant (Goodreads)

We live today in a different world. Genres do not create such important divisions. This is most true in the indie world, but successful authors in the trad world also experiment with crossing genre boundaries. For example, Kazuo Ishiguro has explored several non-standard plotlines and combinations. But many indie authors positively revel in creating books which don’t fit traditional pigeonholes.

Nowadays, science fiction and fantasy are often bundled together under the joint heading “speculative fiction”, with less perceived importance on whether the particular book fits one side or the other of some imaginary line. To be sure, there is still a spectrum of actual content, from “hard” science fiction in which the science bit seeks to be as credible as possible, through to fantasy which does not even seek a rational justification for actions or attributes. Most of my science fiction writing leans towards the geeky end of that spectrum, with Half Sick of Shadows a striking exception. Anyway, within that spectrum there are enormous areas of mixed colour – plot elements for which either a scientific or fantasy explanation might be found, and about which perhaps different characters in the book might hold different opinions. I think that’s fine, and a sign that the whole field has matured from a kind of binary opposition.

Next time – another crossover category…

Left behind by events, part 2

So, picking up the story where l left off two weeks ago, it’s time today to look at science fiction set in the near future from its author. Last time the focus was mainly on stories set hundreds of years in the future, where the problem is often that the technology seems pitched at too low a level. But there are different pitfalls with telling a tale in the next couple of generations. Here, an author may well assume that all kinds of things will happen quickly, when in fact they take much longer.

Flying car from Bladerunner (PInterest)
Flying car from Bladerunner (PInterest)

Flying cars are a stock image for a lot of stories, including Back to the Future and Bladerunner. Now, cars have changed in lots of ways over the span of my lifetime, but they don’t fly (and we still don’t have hoverboards). Yes, periodically there are optimistic announcements that they’re in development, but they certainly aren’t normal consumer items. The future bits of Back to the Future are set in 2015, and the original Bladerunner in 2019, so both are very contemporary.

Interceptors from moonbase in TV series UFO (PInterest)
Interceptors from moonbase in TV series UFO (PInterest)

Likewise, lots of science fiction authors assumed that we would have a moon base well before now, and that manned space missions would have visited other places in the solar system. One of my favourite books, Encounter with Tiber, written in 1996, thought it credible we would have a lunar base by around 2020.  Space 1999 and the TV series UFO were even more optimistic. The prominence of the ISS, orbiting a mere two or three hundred miles from the Earth, was not often imagined, nor the enormous success of unmanned exploratory probes. Missions like Dawn, to the asteroid belt, or New Horizons, to Pluto and beyond, don’t feature. Still less the Hubble space telescope, or the LIDO gravity wave detector, which spectacularly hit the news this week.

Social change seems profoundly hard to predict. Orwell’s 1984 still has the capacity to grip us with its stark picture of state control, but actually its vision of the future is wrong in all kinds of ways. A great many authors assumed – with good reason – that a third world war would take place in the 20th century. EE (Doc) Smith’s Triplanetary simply had “19–?” as the setting for an atomic missile war, following after “1918” and “1941”. Do Androids Dream of Electric Sheep (the short story behind Bladerunner) presupposes a war and heavy resulting pollution behind the drive to spread to other planets, and the construction of android replicants as labourers.

But all of these stories remain worth reading. We often judge the value of a story more for its human drama, and its ability to convincingly present a human response to crisis, than for the accuracy of its timeline. That is as it should be, I think.

Film Swordfish (IMDB)
Film Swordfish (IMDB)

I sometimes read criticisms of fiction which focus on the correctness or otherwise of minute details in the text, and sometimes they miss the point. Most of us don’t know the exact terminology of the parts of modern American handguns, and most of us wouldn’t know if the wrong word was used – yes, I read a scathing comment from one reviewer on just this subject a while back. But if the story holds up, most of us don’t mind. Then there’s my own area of expertise – programming. I find it hilarious when expert coders are depicted in films as hammering out on a keyboard at lightning rate without looking at either their hands or the screen. We just don’t work like that. A great deal of time is actually spent in copy-and-paste from geeky sites like StackOverflow (followed by a fair amount of careful reconfiguration). But if the story’s good, I’ll happily overlook that.

There’s certainly a place for research, and good research, in any area of fiction, but not pursued, surely, at the cost of the story and all of its other dimensions alongside the factual ones. So yes – science fiction stories set in the near future often do get things wrong, but often that doesn’t really matter.

Can handwriting survive?

I’ve been thinking for a little while now about reading and writing, and decided to convert those thoughts into a blog post. I used to reckon that reading and writing were two sides of the same coin. We teach them at broadly the same time, and it seems natural with a child to talk through the physical process of making a letter shape at the same time as learning to recognise it on a page.

Cartouche of Rameses at Luxor
Cartouche of Rameses at Luxor

But lately, I’ve been reconsidering this. My thinking actually goes back several years to when I was studying ancient Egyptian. It is generally understood that alongside the scribes of Egypt – who had a good command of hieroglyphic and hieratic writing, plus Akkadian cuneiform and a few other written scripts and a whole lot of technical knowledge besides – there was a much ĺarger group of people who could read reasonably well, but not write with fluency or competence. A few particularly common signs, like the cartouche of the current pharaoh, or the major deity names, would be very widely recognised even by people who were generally illiterate. You see this same process happening with tourists today, who start to spot common groups of Egyptian signs long before they could dream of constructing a sentence.

Hieratic Scribal Exercise
Hieratic Scribal Exercise

The ability to write is far more than just knowing letter shapes. You need a wide enough vocabulary to select the right word among several choices, to know how to change each word with past or future tense, or number of people, or gender. You need background knowledge of the subject. You need to understand the conventions of the intended audience so as to convey the right meaning. In short, learning to write is more demanding than learning to read (and I’m talking about the production of writing here, not the quality of the finished product).

Roll forward to the modern day, and we are facing a slightly different kind of question. The ability to read is essential to get and thrive in most jobs. Or to access information, buy various goods, or just navigate from place to place. I’m sure it is possible to live in today’s England without being able to read, but it will be difficult, and all sorts of avenues are closed to that person.

But the ability to write – by which I mean to make handwriting – is, I think, much more in doubt. Right now I’m constructing this blog post in my lunch hour on a mobile phone, tapping little illuminated areas of the screen to generate the letters. In a little while I’ll go back to my desk, and enter characters by pressing down little bits of plastic on a keyboard. Chances are I’ll be writing some computer code (in the C# or NodeJS computer languages, if you’re curious) but if I have to send a message to a colleague I’ll use the same mechanical process.

Amazon Dot - Active
Amazon Dot – Active

Then again, some of my friends use dictation software to “write” emails and letters, and then do a small amount of corrective work at the end. They tell me that dictation technology has advanced to the stage where only minor fix-ups are needed. And, as most blog readers will know, I’m enthusiastic about Alexa for controlling functionality by voice. Although writing text of any great length is not yet feasible on that platform, my guess is that it won’t be long until this becomes real.

All of this means that while the act of reading will most likely remain crucial for a long time to come, maybe this won’t be true of writing in the conventional sense. Speaking personally, hand-writing is already something I do only for hastily scribbled notes or postcards to older relatives. Or occasionally to sign something. The readability of my hand-writing is substantially lower than it used to be, purely because I don’t exercise it much (and by pure chance I heard several of my work colleagues saying the same thing today). Do I need hand-writing in modern life? Not really, not for anything crucial.

Some devices
Some devices

I don’t think it’s just me. On my commuting journeys I see people reading all kinds of things – newspapers, books, magazines, Kindles, phones, tablets and so on. I really cannot remember the last time I saw somebody reading a piece of hand-written material on the tube.

Now, to set against that, I have friends and relatives for whom the act of writing is still important. They would say that the nature of the writing surface and the writing implement – pencil, biro, fountain pen – are important ingredients, and that bodily engagement with the process conveys something extra than simply the production of letters. Emphasis and emotion are easier to impart – they say – when you are personally fashioning the outcome. To me, this seems simply a temporary problem of the tools we are using, but we shall see.

Looking ahead, I cannot imagine a time when reading skills won’t be necessary – there are far too many situations where you have to pore over things in detail, review what was written a few chapters back, compare one thing against another, or just enjoy the artistry with which the text had been put together. Just to recognise which letter to tap or click requires that I be able to read. But hand-writing? I’m not at all sure this will survive much longer.

Perhaps a time will come when teaching institutions will not consider it worth while investing long periods of time in getting children’s hand-writing to an acceptable standard – after all, pieces of quality writing can be generated by several other means.

Quill pen device for tablet
Quill pen device for tablet

Language and pronunciation

Half Sick of Shadows Alexa skill icon
Half Sick of Shadows Alexa skill icon

I’ve been thinking these last few days, once again, about language and pronunciation. This was triggered by working on some more Alexa skills to do with my books. For those who don’t know, I have such things already in place for Half Sick of Shadows, Far from the Spaceports, and Timing. That leaves the Bronze Age series set in Kephrath, in the hill country of Canaan. And here I ran into a problem. Alexa does pretty well with contemporary names – I did have a bit of difficulty with getting her to pronounce “Mitnash” correctly, but solved that simply by changing the spelling of the text I supplied. If instead of Mitnash I wrote Mitt-nash, the text-to-speech engine had enough clues to work out what I meant.

So far so good, but you can only go part of the way down that road. You can’t keep fiddling around with weird spellings just to trick the code into doing what you want. Equally, it’s hardly reasonable to suppose that the Alexa coding team would have considered how to pronounce ancient Canaanite or Egyptian names. Sure enough the difficulties multiplied with the older books. Even “Kephrath” came out rather mangled, and things went downhill from there.
Amazon Dot - Inactive
Amazon Dot – Inactive

So I took a step back, did some investigation, and found that you can define the pronunciation of unusual words by using symbols from the phonetic alphabet. Instead of trying to guess how Alexa might pronounce Giybon, or Makty-Rasut, or Ikaret, I can simply work out what symbols I need for the consonants and vowels, and provide these details in a specific format. Instead of Mitnash, I write mɪt.næʃ. Ikaret becomes ˈIk.æ.ˌɹɛt.

So that solved the immediate problem, and over the next few days my Alexa skills for In a Milk and Honeyed Land, Scenes from a Life, and The Flame Before Us will be going live. Being slightly greedy about such things, of course I now want more! Ideally I want the ability to set up a pronunciation dictionary, so that I can just set up a list of standard pronunciations that Alexa can tap into at need – rather like having a custom list of words for a spelling checker. Basically, I want to be able to teach Alexa how to pronounce new words that aren’t in the out-of-the-box setup. I suspect that such a thing is not too far away, since I can hardly be the only person to come across this. In just about every specialised area of interest there are words which aren’t part of everyday speech.

Amazon Dot - Active
Amazon Dot – Active

But also, this brought me into contact with the perennial issue of UK and US pronunciation. Sure, a particular phonetic symbol means whatever it means, but the examples of typical words vary considerably. As a Brit, I just don’t pronounce some words the same as my American friends, so there has to be a bit of educated guesswork going into deciding what sound I’m hoping for. Of course it’s considerably more complicated than just two nations – within those two there are also large numbers of regional and cultural shifts. And of course there are plenty of countries which use English but sound quite different to either “standard British” or “standard American”.

That’s for some future, yet to be invented, dialect-aware Alexa! Right now it’s enough to code for two variations, and rely on the fact that the standard forms are recognisable enough to get by. But wouldn’t it be cool to be able to insert some extra tags into dialogue in order to get one character’s speech as – say – Cumbrian, and another as from Somerset.

Bugs, faults, and writing

Kindle Cover - Half Sick of Shadows
Kindle Cover – Half Sick of Shadows

Today’s blog looks at bugs – the little things in a system that can go so very wrong. But before that – and entirely unrelated – I should mention that Half Sick of Shadows is now available in paperback form as well as Kindle. You can find the paperback at Amazon UK link, Amazon US link, and every other Amazon worldwide site you favour. So whichever format you prefer, it’s there for you.

So, bugs. In my day job I have to constantly think about what can go wrong with a system, in both small and large ways. No software developer starts out intending to write a bug – they appear, as if by magic, in systems that had been considered thoroughly planned out and implemented. This is just as true of hacking software, viruses and the like, as it is of what you might call positively motivated programs. It’s ironic really – snippets of code designed to take advantage of flaws in regular software are themselves traced and blocked because of their own flaws.

Cover - I, Robot (Goodreads)
Cover – I, Robot (Goodreads)

But back to the practice of QA – finding the problems and faults in a system thought to be correct. You could liken it, without too much of a stretch, to the process of writing. Authors take a situation, or a relationship, or a society, and find the unexpected weak points in it. Isaac Asimov was particularly adept at doing this in his I, Robot series of stories. At the outset he postulated three simple guidelines which all his robots had to follow – guidelines which rapidly caught on with much wider audiences as the “Three Laws of Robotics”. These three laws seemed entirely foolproof, but proved themselves to be a fertile ground for storytelling as he came up with one logical contradiction after another!

But it’s not just in coding software that bugs appear. Wagon wheels used to fall off axles, and I am told that the root cause was that the design was simply not very good. Road layouts change, and end up causing more delays than they resolve. Mugs and jugs spill drink as you try to pour, despite tens of thousands of years of practice making them. And I guess we have all come across “Friday afternoon” cars, tools, cooking pans and so on.

1947 bug found and taped to the engineering logbook (Wikipedia)
1947 bug found and taped to the engineering logbook (Wikipedia)

Bugs can be introduced in lots of places. Somebody thinks they’ve thought up a cool design, but they didn’t consider several important features. Somebody thinks they’ve adequately explained how to turn a design into a real thing, but their explanation is missing a vital step or two – how many of us have foundered upon this while assembling flat-pack furniture? Somebody reads a perfectly clear explanation, but skips over bits which they think they don’t need. Somebody doesn’t quite have the right tool, or the right level of skill, and ploughs on with whatever they have. Somebody realises that a rare combination of factors – what we call an edge case, or corner case – has not been covered in the design, and makes a guess how it should be tackled rather than going back to the designer. Somebody adds a new feature, but in doing so breaks existing functionality which used to work. Somebody makes a commercial decision to release a product before it’s actually ready (as a techie, I find this one particularly frustrating!)

And then you get to actual users. So many systems would work really well if it wasn’t for end-users! People will insist on using the gadget in ways that were never anticipated, or trying out combinations of things that were never thought about. A feature originally intended for use in one way gets pressed into service for something entirely different. People don’t provide input data in the way they’re supposed to, or they don’t stick to the guidelines about how the system is intended to work – and very few of us read the guidelines in the first place!

Timing Kindle cover
Timing Kindle cover

All of which have direct analogies in writing. Some of my books are indeed focused on software, and in particular the murky business of exploiting software for purposes of fraud. That world is full of flaws and failures, of the misuse of systems in both accidental and deliberate ways. But any book – past, present or future – is much the same. A historical novel might explore how a battle is lost because of miscommunication, human failings, or simply bad timing. Poor judgement leads to stories in any age. Friction in human relationships is a perennial field of study. So the two worlds I move in, of working life and leisure, are not really so far apart.

Now, engineering systems, including software engineering – have codes and guidelines intended to identify bugs at an early stage, before they get into the real world of users. The more critical the system, the more stringent the testing. If you write a mobile phone game, the testing threshold is very low! If you write software that controls an aircraft in flight, you have to satisfy all kinds of regulatory tests to show that your product is fit for purpose. But it’s a fair bet that any system at all has bugs in it, just waiting to pop out at an inopportune moment.

As regards writing, you could liken editing to the process of QA. The editor aims to spot slips in the writing – whether simply spelling and grammar, or else more subtle issues of style or viewpoint – and highlight them before the book reaches the general public. We all know that editing varies hugely, whoever carries it out. A friend of mine has recently been disappointed by the poor quality of editing by a professional firm – they didn’t find anywhere near all the bugs that were present, and seem to have introduced a few of their own in the process. But just as no software system can honestly claim to be bug-free, I dare say that no book is entirely without flaw of one kind or another.

Kindle preparation part 5 – formatting and media queries

Flush both sides working well
Flush both sides working well

Last time in this series we looked at some of the difficulties of presenting a book in an electronic medium, where the layout on every page can change according to user settings and from one device to another. In particular, there is the problem of handling the two extremes – small or large font size compared with screen width. At one end of the spectrum you get a lot of words per line, and the tendency for the eye to lose its place in a screen full of text. At the other, with few words per line, word spacing becomes irregular and “rivers” of white space tend to open up.

Flush layout with large gaps
Flush layout with large gaps

On grounds of aesthetic appearance and readability studies, there is broad agreement that left-aligned text is preferable in the limit of few words per line. For many words per line, text which is flush both sides is more familiar and traditional, giving an impression of neatness. The question then arises, is it possible to have the best of both worlds?

Now with traditional print layout, all of this is decided by author or publisher, and the reader has no choice. Once the design is chosen, that’s it. The phenomenal rise of epublishing, with free and easy to use tools enabling indie publishing, has given huge empowerment to authors. But I sometimes think that authors have not caught on to the fact that it has also given huge empowerment to readers, who want to exercise their freedom of choice to change the layout of the book to suit their own preferences.

So what does that mean for Kindle formatting? A Kindle or ebook is basically a long thin web site, conveniently represented in pages by software or hardware. The basic building blocks are HTML files and CSS style sheets, together with some added contextual information to tie the whole lot together. This is hidden from many authors, who may simply upload a Word document to an aggregator site which itself does the difficult work.

New model Kindle with automatic left alignment
New model Kindle with automatic left alignment

But being essentially a web page gives access to another set of options. Ebook devices like Kindle do not usually support everything that a real web site would – for example you cannot use script commands to query the settings in a dynamic way. But there is support for something called a media query, embedded inside the style settings. Media queries are often used to render a page suitable for printing, or for voice readers, or to accommodate a wide range of screen sizes from mobile to wall-mounted TV with the same basic design. So Kindle books can be responsive, but not dynamic in the strict technical sense.

Regular media queries are of limited use here – in terms of pixels or centimetres, the screen is what it is. Happily, there is a fairly straightforward solution. A web device – including an ereader – allows widths to be specified in a unit called em. An em is directly related to the font size, unlike physically derived units like pixels or centimetres. So while the size of the screen stays the same in terms of pixels, it changes in terms of ems as different fonts are selected. Better still, the em width also varies as the user chooses different margin widths. For a standard device font at default size, by convention 1em = 16px. But this can be changed in various ways, including user selection of font size and page margin.

So here is the way to have an ebook layout which is responsive to user choices. It’s not as flexible as what you can do in a real web site, but then the device doesn’t allow you to make so many adjustments. Anyway, it’s a whole lot better than having a one-size-fits-all compromise. Basically you can have a different set of style rules for large fonts than for small ones, and so maintain appearance across a very wide range of settings. Left alignment is easier for the eye to follow with only a few words per line – and avoids the tendency of justified text to leave large rivers of white space in the middle of pages. Justified text is preferred where there are lots of words per line. Newer versions of the Android and iPhone apps make this choice for themselves unless told otherwise, but most actual Kindles do not. With media queries you don’t have to pick one or the other and make do – you can have both, as part of a responsive Kindle design. You can have as many multiple separate queries as you wish, though personally for simplicity I would tend to stick with two – one for large fonts (compared to screen width) and one for small. Similar comments apply to paragraph settings – regular spacing with indent, or a small vertical gap with no indent.

Media Query Definition
Media Query Definition

What are the rules to follow here? Well, firstly you should always have a default set of styles which apply in the absence of more specific choices. And the default ones should always go first, and those governed by a media query afterwards. That’s because of how the style sheet is parsed – the whole file from start to finish, and any later directives which happen to apply are chosen in preference to earlier ones.

Finally, do keep it simple. Media query support, along with style sheet support in general, is patchy on most ereaders. The number of legacy and old-model systems is high, for several reasons. People hang on to their Kindles for a long time, so long as they continue to function. Many software companies producing phone and tablet reader apps don’t bother to code for recent enhancements, reckoning that the extra investment in time is not worth it. So any media queries used in a Kindle or generic epub book must be simple. It would be great to have different styles for whether your reader has chosen normal screen (dark text on pale background) or inverted (pale on dark), or indeed the several colour options available on some devices. But support for the media queries “inverted-colors” and “color-depth” is very erratic and cannot be relied upon. So you should not specify colours in your style which might end up unreadable for the colour scheme chosen by your readers. Better to avoid colours altogether and just let the device choose.

One epub reader options
One epub reader options

As I have said several times, not all Kindle devices, or Kindle software apps on computers, phones and tablets, treat the content the same way. My phone Kindle app (both Android and iPhone) handles changes of font size differently from my various actual Kindles, including the way it decides to justify text. This is something built into the app itself, not a thing I have direct control over. I like some reading preferences that other people don’t, so anything that you as author do by way of styles and media queries should not intrude on personal preference.

I started with some screenshots of how things would be if you had to make do with just one style, and moreover used measurements in fixed units. Here by contrast is the same content, using media queries and a responsive design. Personally I like the flexibility, and the way the presentation adapts to changes in user choices. Not everybody will, and maybe not everybody will want to dig in to the details of how their Kindle or epub book is being constructed. Those who simply hand over a Word document to Smashwords or a similar site may be perplexed by all this.

Authors spend a great deal of time and effort researching the background to their books. They look out for what they consider a good cover. They may pay for the services of an editor. Yet many authors dislike the thought of engaging with the technology that finally delivers their book into the reader’s hands. By way of doing something, many just try to copy the methods they used for print. But ebooks are a different medium to print, and need their own treatment. Happily, it is relatively easy to offer a better reading experience for those who want it. Complete consistency across devices is not possible, but through media queries and the use of ems to measure dimensions we can get a good way towards that.

This is almost the end of this little series, and the last item will be a quick summary of key points.

Some devices
Some devices

Kindle preparation part 3 – navigation

A shorter blog today focusing specifically on navigation. I mentioned before that there were two different ways of navigating through the sections of an ebook, and this little post will focus on how they work. The two methods appear differently in the book – the HTML contents page is part of the regular page flow of the book, and the NCX navigation is outside of the pages, as we’ll see later.

Print Book TOC
Print Book TOC

It’s an area where ebooks behave quite differently to print versions. If you have a table of contents (TOC) in a print book it’s essentially another piece of static text, listing page numbers to turn to. Nonfiction books frequently have other similar lists such as tables or pictures, but I’ll be focusing only on section navigation – usually chapters but potentially other significant divisions. In an ebook this changes from a simple static list into a dynamic means of navigation.

TOC navigation page
TOC navigation page

Let’s take the HTML contents first. It looks essentially the same as the old print TOC, except that the page numbers are omitted (since they have no real meaning) and are replaced by dynamic links. Tap the link and you go to the corresponding location. They look just like links in a web page, for the very good reason that this is exactly what they are!

So the first step is to construct your HTML contents list, for which you need to know both the visible text – “Chapter 1”, perhaps – and the target location. Authors who use Word or a similar tool can usually generate this quite quickly, while those of us who work directly with source files have the easy task of inserting the anchor targets by hand. It’s entirely up to you how you style and structure your contents page – maybe it makes sense to have main parts and subsections, with the latter visually indented. It’s your choice.

Missing NCX navigation
Missing NCX navigation

The NCX navigation is a bit different. It’s a separate file, and the pairing of visible text and target link is done by means of an XML files of a specific structure. Again. some commercial software will be able to generate this for you, using the HTML TOC as a starting point, but it’s as well to know what it is doing for you.  Conventionally the two lists of contents mirror each other, but this doesn’t have to be the case. For example, it might suit you better to have the HTML version with an exhaustive list, and the NCX version with just a subset. It’s up to you. However, the presence of NCX navigation in some form is a requirement of Amazon’s, sufficiently so that they reserve the right to fail validation if it’s not present. And it’s a mandatory part of the epub specifications, and a package will fail epubcheck if NCX is missing. You’ll get an error message like this:

Validating using EPUB version 2.0.1 rules.
ERROR(RSC-005): C:/Users/Richard/Dropbox/Poems/test/Test.epub/Test_epub.opf(39,8): Error while parsing file ‘element “spine” missing required attribute “toc”‘.
ERROR(NCX-002): C:/Users/Richard/Dropbox/Poems/test/Test.epub/Test_epub.opf(-1,-1): toc attribute was not found on the spine element.

Partial NCX file
Partial NCX file

Of course, if you don’t check for validation, or if you just use Kindlegen without being cautious, you will end up with an epub or Kindle mobi file that you can ship… it will just be lacking an important feature.

Interestingly, you don’t get an error if you omit the HTML TOC – so long as everything else is in order, your epub file will pass validation just fine. This is the opposite of what folk who are used to print books might guess, but it reflects the relative importance of NCX and HTML contents tables in an ebook.

NCX navigation included
NCX navigation included

So what exactly do they each do? The main purpose of the HTML version is clear – it sits at the front of the book so that people can jump directly to whatever chapter they want. It would do this even if you just included the file in the spine listing. But if you are careful to specify its role in the OPF file, it also enables a link in the overall Kindle (or epub) navigation. This way the user can jump straight to the TOC from anywhere.

The NCX navigation enables the rest of this “Go To” menu. If it’s missing, or incorrectly hooked up in the OPF file, the navigation will be missing, and you are leaving your readers struggling to work out how to flick easily to and fro. On older Kindles, there were little hardware buttons (either on the side of the casing or marked with little arrows on the front) which would go stepwise forwards and backwards through the NCX entries.

So that’s it for the two kinds of navigation. They’re easy to include, they add considerably to the user experience, and in one way or another are considered essential.

Mappings between items in OPF file
Mappings between items in OPF file