There was extreme pomp and pageantry, miles of tartan, celebratory bonfires and, at the centre of it all, a portly, not particularly well-loved monarch and one of Scotland’s smartest authors.

It was 1822, and over the course of 10 feverish days of celebration, excitement and lavish expense, King George IV – not so resplendent in a kilt that was just a little too short, and with pink-coloured tights covering his podgy legs – had granted Scots a very rare royal visit.

The royal visit, orchestrated by Sir Walter Scott, would go down in history as a day that helped change Scotland, boost the wearing of tartan – fuelling an international fashion trend - and confirm the nation’s place as a modern society with a rich, romantic and vivid history.

The image of Scotland ignited by the royal visit 200 years ago this year of a nation rich in tartan, pageantry, romance and history, would become firmly embedded both at home and abroad: one that continues to attract visitors from all over the globe.

To mark the bicentenary, Edinburgh’s City Art Centre plans to display John Wilson Ewbank’s The Entry of George IV into Edinburgh from the Calton Hill, which depicts the feverish welcome the monarch received from a city gripped by royal fever. It will go on display at the gallery later this year.

However, it can only capture a small slice of the carnival-like celebrations that spanned almost a fortnight and saw the King, the first monarch to set foot in Scotland for 189 years, parade across Edinburgh at a series of carefully orchestrated and extremely lavish events.

At the centre of it all was Sir Walter Scott, a Unionist who pulled off the unlikely feat of managing to unite a country which just a few generations earlier had been in the grip of Jacobite rebellion and at loggerheads with itself, while helping to establish a new national identity.

The August 1822 visit has been credited with setting Scotland on a new course, which Kirsty Archer-Thompson, Collections and Interpretation Manager at the Abbotsford Trust, which safeguards Abbotsford, Sir Walter Scott’s home in Melrose, believes is fair.

“I think the visit was a resounding success for a variety of reasons, not least that it happens in wake of the radical wars of 1820 and there’s a lot of political and economic turmoil, particularly on the west coast and in Renfrewshire.

“The 1822 visit is a kind of catalyst; people flock to Edinburgh to see the king despite having been involved in the case for reform.”

Having found himself in the hot seat as chief organiser, Sir Walter Scott proceeded to create an event which would showcase Scotland in a way never done before.

“Scotland was coming out of a period of upheaval, there was the Jacobite cause and rising, and the bloodshed of that period - wounds were still quite raw,” she adds.

“It was within living memory for some older individuals and Scott was trying to pull off a massive visual representation of healing.

“By having 300 or so Highland clans and chiefs in Edinburgh fully in the garb of the Highlands, brandishing weapons that may have been used in these battle, balance somehow got recalibrated.”

King George IV had given the people of Edinburgh just four weeks’ notice, sparking a flurry of activity.

Author Sara Sheridan, whose recent book, The Fair Botanists, is set against preparations for the visit, describes a delirious time in the capital.

“There was this sudden rush, where every single artisan, every single seamstress was making things or doing something to contribute to events. Everyone was booked up immediately. You can’t just buy a dress, you have to had a dress made. So there was an emormous rush.”

Accommodation for the King posed a particular issue, she adds. “The Palace of Holyroodhouse had fallen into terrible disrepair. There’s this crumbling palace and a debtors’ prison behind it. The people living there are grace and favour tenants, but no-one was maintaining it.

“You have Sir Walter Scott running around arranging upholsters and haberdashers to make the Throne Room ready.

“But the King has no intention of staying and goes to Dalkeith to stay with the Duke of Buccleuch’s house where they have incredible rooms.”

Having arrived a day late due to storms, the King was ushered towards Edinburgh in a parade loaded with pageantry and with an estimated one seventh of the population of Scotland in town to join the celebrations.

Bonfires were lit on Arthur’s Seat and special effects dazzled the crowds: the gasworks in Edinburgh had a gigantic crown that appeared to be suspended in mid-air.

Not everyone was enthusiastic about the visit, however.

“If you look at papers from the time, there was a lot of criticism of what was going on and it being over the top,” says Dr Stuart Allan, Keeper of Scottish History & Archaeology at the Museum of Scotland.

“Political cartoons and satirist in London were all over George IV - he was a figure of fun.

“The London press took the royal visit and made it look as foolish as it was.

“But whatever the controversies, it was a big event, it was what everyone was talking about for weeks beforehand, people turned out in droves, they really went for it.”

The wearing of tartan – banned for some post-1745 – became highly fashionable again, with the visit sparking a revival in London and other European cities.

While Scotland emerged from the visit with a stronger national identity – largely thanks to Sir Walter Scott’s extraordinary eye for marketing the country.

“He understood propaganda, imagery and visual arts,” adds Kirsty.

“He knew most of the key Scottish artists of the day, so a lot are present during the royal visit, sketching and painting the scenes.

“That allowed for these to be exhibited in London and elsewhere.

“He had a cinematographer’s eye for promoting his home city and his home country.”