Edinburgh has a strong claim to be one of Europe’s most significant literary cities.

Designated UNESCO’s first City of Literature in 2004, Edinburgh has been the raw material that forged many of the world’s best-loved literary characters. Sherlock Holmes, for example, was dreamt up not in the smog of Victorian London but in Edinburgh University, where Sir Arthur Conan Doyle was a student. Robert Louis Stevenson took his inspiration for Dr Jekyll and Mr Hyde from real-life Edinburgh figure Deacon Brodie, a respectable tradesman who had a secret life as a burglar.

J M Barrie, the creator of Peter Pan, was educated at the University of Edinburgh, as was David Hume, one of the greatest philosophers of all time. And who could forget the boy wizard himself, Harry Potter, who was first created in the cafes of Edinburgh by J.K Rowling.

All this Edinburgh literary history can feel overwhelming, which is why we have collaborated with renowned critic and writer Stuart Kelly to give you a firsthand account of the city’s literary legacy, past and present.

Edinburgh, the literary city by Stuart Kelly

Edinburgh, wrote Hugh MacDiarmid, Scotland’s greatest twentieth century poet, is “a mad god’s dream”. It has certainly inspired many unsettling literary works. Perhaps this is because Edinburgh really is two cities: there is the Old Town, the medieval part of the city, which was built vertiginously, a muddled middle ages version of skyscrapers. Then there is the New Town, built in the 18th century and exemplifying a vision of a rational, planned society – those “draughty parallelograms” as Robert Louis Stevenson memorably put it.

Although Stevenson’s most famous story, The Strange Case Of Dr Jekyll And Mr Hyde is actually set in London, its inspiration was Edinburgh. The city’s architecture can be seen as a version of the id and the ego in stone; and Stevenson drew on the story of Deacon Brodie – by day a respectable councillor and by night a notorious burglar. A great many of Edinburgh’s literary figures have mined this seam of schizophrenia. It is present in Ian Rankin’s Inspector Rebus novels and in Muriel Spark’s evocation of outward respectability and inner malice, The Prime Of Miss Jean Brodie.

Sir Walter Scott

Almost exactly between the Old Town and the New stands the Scott Monument, the largest and most elaborate commemoration to a novelist in the world. Sir Walter Scott too reflects the dichotomy of Edinburgh. The Heart Of Midlothian is his greatest representation of Edinburgh. Set in 1736, it involves an infamous riot when the citizens of Edinburgh took the law into their own hands after the unfair pardoning of Captain Porteous, who had ordered the killing of innocent civilians. It is a novel full of doubles – the heroine, Jeanie Deans, is both innocent and wily; the anti-hero, Staunton, is a gentleman who can pass himself off as a gypsy. It is a novel that pits the law against justice, and lies against truth. Although Scott is profoundly linked with Scottish history, he wrote as many books set outwith Scotland; from Ivanhoe in England, to The Talisman in Palestine to The Surgeon’s Daughter in India.

Scott describes an Edinburgh on the cusp of its most famous period, when it became known as “the Athens of the North” and where the King’s chemist could state “Here I stand at what is called the Cross of Edinburgh, and can, in a few minutes, take fifty men of genius and learning by the hand”. Amongst the most significant figures of the Enlightenment were the philosopher David Hume, the economist Adam Smith, the literary critic Hugh Blair and the geologist James Hutton. All of them were characterised by a commitment to free thought and scepticism. Hume in particular was known to be an atheist – and when he moved into the new houses being constructed in the New Town, one student wag chalked “St David’s Street” outside: it became the official name of the street. Both Smith and Hume are commemorated with statues by Sir Sandy Stoddart; Hume in a Roman toga outside the High Court and Smith looking down from St Giles’ Cathedral to the Port of Leith.

Robert Fergusson

It was to Hugh Blair, as the first Professor of Rhetoric and Belles-Lettres at Edinburgh University, that Robert Burns wrote, thanking him for his advice in publishing his Poems, Chiefly In The Scottish Dialect. Burns’ stay in Edinburgh was eventful – he met the young Walter Scott and the novelist Henry Mackenzie, who coined the phrase “heaven-taught ploughman”; he organised for a gravestone for his “elder brother in the Muse”, the poet Robert Fergusson who had died in an insane asylum at the age of 24 (a statue to him now strides out down the Royal Mile, near to the Canongate Wall that features quotations from many Scottish writers). Burns being Burns he was also engaged in a dalliance with “Clarinda” – Agnes Maclehose – who inspired one of his finest poems, “Ae Fond Kiss”. Though their relationship can seem the ideal of doomed romance, it would be wise to remember that Walter Scott knew Agnes later, and referred to her as “old, charmless and devout”.

Another visitor to Edinburgh in the same period was the novelist Tobias Smollett. Smollett’s The Expedition Of Humphrey Clinker has a good claim to be the first “British” novel. It concerns a Welsh family making a tour of England and Scotland and falling in with an eccentric Irish soldier. Smollett was well aware of having a dual identity – he was a Scot but he was also British, and his novel created the precedent for all the books where Scots find themselves when they are outside of Scotland; from Stevenson’s Kidnapped to John Buchan’s Greenmantle.

In the generation after the Enlightenment, a group of young men founded a journal called The Edinburgh Review. It was the first literary magazine to be outspoken and critical about contemporary literature, founded by Francis Jeffrey, Francis Horner, Henry Brougham and Sydney Smith. All of them knew Walter Scott, and Jeffrey wrote the encomium on the Scott Monument.

Walter Scott’s rival and friend James Hogg wrote the greatest novel about the Scottish split personality, in The Private Memoirs And Confessions Of A Justified Sinner. It did not do well in his lifetime, and it was only when it was championed by the French novelist André Gide as a forerunner of the psychological novel did it come to wider attention. It is a puzzle-box of a novel; beginning with the Editor’s story of finding a manuscript, then giving us the Sinner’s own story, and ending ambiguously. The Sinner, Robert Wringhim, is convinced that he is so holy he can indulge in any sin, and is encouraged in this belief by his mysterious friend Gil-Martin. Whether Gil-Martin is a product of his delusions or the Devil in disguise is left masterfully open. The scene where Wringhim has a vision on Arthur’s Seat in the middle of Edinburgh is wonderfully haunting.

The Jekyll and Hyde theme persists in contemporary literature, and is encapsulated in Alexander McCall Smith and Irvine Welsh. McCall Smith’s 44 Scotland Street novels present Edinburgh at its most genteel and pretentious; they are the epitome of wry humour. The novels do however have a serious side, in that they examine how to be good in a turbulent and difficult world. Irvine Welsh’s Trainspotting shows the seamier underside of Edinburgh, a city with drug problems, random violence and blighted opportunities. It has a savage and satirical humour, and used demotic Scots language to searing effect. As if to deliberately go one better than the Scottish obsession with split personalities and double visions, the late Iain Banks wrote an astonishing novel of triples – The Bridge – where what connects the realistic, fantastic and a science-fiction stories is the dominating presence of the Forth Bridges.

J.K. Rowling's inspiration

Walter Scott is sometimes referred to as the first novelist who became a global celebrity. His only equivalent today is obviously J K Rowling, who wrote the Harry Potter books in Edinburgh – there is even a statue she graffitied in the Balmoral Hotel. How much did Edinburgh inspire the books? Quirinus Quirrel in the first book – who has Voldemort’s face on the back of his head through spiritual possession – is another version of the Jekyll and Hyde doubleness. Many of the Edinburgh private schools (Fettes, George Watson’s and even Donaldson’s School for the Deaf) bear more than a passing resemblance to Hogwarts.

In recent years Edinburgh has had a thriving spoken word poetry community, with events such as Rally + Broad, Neu! Reekie, Loud Poets, the Heretics and Flint and Pitch. In the middle of the 20th century, there was a similarly vibrant situation, with poets such as MacDiarmid, Norman McCaig, Sydney Goodsir Smith and Robert Garioch holding forth in pubs such as Milne’s, the Abbotsford and the Café Royal. While it was a predominantly masculine environment, things have changed. Perhaps the most talented young writer in Edinburgh is Jenni Fagan, who was listed as one of Granta’s Best of Young British Novelists. Although she is a poet as well, her latest novel, The Sunlight Pilgrims, set in an apocalyptic Scotland suffering from environmental catastrophe, has as its protagonist a young woman who was born a man: the Scottish obsession with doubles and twins, being both at the same time and neither at once, can still inspire in new and intriguing ways.