When the best-selling author was asked to have a look at an unfinished final manuscript by the late William McIlvanney, it was the first he had heard of its existence.
Before long he found himself piecing together the strands of a story from 100 pages of notes typed up by McIlvanney’s widow Siobhan.
At her request, he then agreed to try to get inside the head of not only the “godfather of tartan noir”, but the gritty Glasgow detective who would famously inspire Rankin’s own long-running creation by turning McIlvanney’s notes into a final novel from the Ayrshire-born writer.
On Monday, Rankin will launch The Dark Remains at the Edinburgh International Book Festival – the event where he first met McIlvanney shortly after starting work on what would become the first Rebus novel, which he had told the writer was planned to be “like Laidlaw, but set in Edinburgh”.
Recalling the initial approach, Rankin said: “Canongate told me that they had a manuscript that Siobhan had put together by typing up his handwritten notes and that she wanted to know if I thought there was enough there to make a novel. I said I’d take a look at it.
"It was all a surprise to me – I hadn’t heard anything at all about. My first job was really archaeology, going through 100 sheets of paper and trying to work out what it all meant.
“I told Canongate that I thought they could get a novel out of it if they did X, Y and Z. They then came back to me and said that Siobhan wanted me to do it.
"I don’t think I would have tried it with any other writer, but because I’m such a huge fan of Willie and he was such an influence on me I thought I’d give it a go.
"But I did say to them ‘no promises, if I can’t capture his style I’m not going to do it’.
“It was very important to me that this book was a McIlvanney – his voice, his world and his characters.”
Confined to his home in Edinburgh, Rankin set about immersing himself in Laidlaw’s world of early 1970s Glasgow, as well as trying to learn McIlvanney’s style.
Rankin relied on the archives of the National Library of Scotland, old photographs and maps of the city, and McIlvanney’s own words to help bring the writer’s final story to life.
He said: “I re-read all the Laidlaw novels three or four times and tried to learn his writing style so I could mimic it.
"I’ve built in as much of Willie’s Glasgow as I possibly could. Hopefully it is his Glasgow. He painted a picture of the city and I just stuck to that. He’d written some nice descriptive stuff in his notes that I was able to use.
“Luckily, the National Library of Scotland opened up in time for me to go in and look at the Glasgow Herald. I pulled out a year’s worth of them out for 1972 – I only knew that the book was set then as the notes had referenced The Godfather, which was released that year.
“For me, writing about Glasgow in 1972 was lovely and an escape from the pandemic. It was a much simpler world.
"Although it was a world of criminals, there were no mobile phones and drugs were not quite yet the scourge they would become.
"It absolutely helped me last year. I was writing all the time during the pandemic. I could live in this fictional world that made sense in a way that the real world wasn’t making sense.
"It did feel like going back in time. I had to remind myself that nobody had a mobile phone or a computer at home. Pubs closed a lot earlier than they do now and you couldn’t get a drink on a Sunday unless you were in a hotel.
"That’s why I tend to set my books in the present – they’re much easier to write.”
The success of new editions of the Laidlaw trilogy, instigated by publisher Canongate after it discovered the novels had fallen out of print, is thought to have inspired McIlvanney to return to the character.
Rankin said: “There were no dates on any of the notes, but I would guess that after the reception for the reissued Laidlaw books, when he was talking to big audiences and getting invited to festivals, that it probably dawned on him that this character was much more important to people than he had realised.
“It was a glorious third act in his life. Suddenly he was talking to big audiences and getting invited to festivals. He realised that people hadn’t forgotten about him – he thought they had.
"He didn’t write two books that were the same. He was very restless.
"He’d write poetry, literary fiction and essays for newspapers. He felt he had things to say that couldn’t be contained in a crime novel. He’d done what he wanted to do with Laidlaw. He wanted to move on and tell other kinds of stories.
"It was an absolutely fascinating process going through his notes because I was inside his head. Sometimes he was a bit vague. Because he knew some things, he didn’t need to write them down.
"I just wanted to do him justice, I wanted to celebrate him in some way.
"I wanted new readers to find him and I wanted old readers to rediscover him. Hopefully if people come to this book they will seek out the other Laidlaw novels and then his other books.
“The best scenario I can think of is that a whole new generation of readers find his work.”
Rankin is speaking at the Edinburgh International Book Festival on Monday. The Dark Remains is released on September 2.