IT'S heartening to discover that best-selling crime writer Ian Rankin is as human as you and me. He might have an expensive house and count JK Rowling as a near-neighbour, but he's as weak-willed as the rest of us when it comes to chocolate.

IT'S heartening to discover that best-selling crime writer Ian Rankin is as human as you and me. He might have an expensive house and count JK Rowling as a near-neighbour, but he's as weak-willed as the rest of us when it comes to chocolate.

When he's toiling away, concocting a devilish plot, confectionery encourages the grey cells in their act of creation.

“A lot of chocolate,” he confesses. “Snickers bars, mostly. My wife thought she was being clever by buying 10-packs, because they're cheaper. But I would eat five a day: five Mars bars or five Snickers bars a day. And I would look at the wrappers and think 'I don't remember eating those!'”

Those Mars bars are a killer for putting on weight, aren't they? “Tell me about it!”

But you're quite thin, aren't you?

“No, I'm not,” he laughs. “Bits of me are skinny, but around the middle . . . work to be done. I take no exercise whatsoever. I keep telling myself I'll go on a diet and take exercise, but I somehow never get round to it. I think maybe at the pub today I'll just drink Diet Coke.”

Honest Injun?

“Maybe the first one.”

Det Insp John Rebus has now featured in near enough 20 full-length novels, collections of short stories and novellas. A gloomy loose cannon who makes Eeyore look like Graham Norton, he's nevertheless found a place in the heart of thousands of readers who appreciate his individualism.

“With a lot of men who read the books, one of the things they like is that he leads this bachelor lifestyle. A lot of us are settled down, with kids, and our lives aren't our own, whereas he can play his music loud without anyone complaining, and he can sit and smoke by the window and have a whisky. There's a little bit of jealousy there, I think, from all of us married lads.”

In common with his creator, Rebus's love of music is obsessive. He's recovered from a nervous breakdown. He's a failed father and husband. Now, his best friend lies in the bottom of a glass. On TV, he's been portrayed by, first, John Hannah (too youthful and unsullied?) and latterly by Ken Stott (appropriately creased and crumpled).

Not so long back, Ian Rankin was named the 10th-bestselling fiction writer in Britain since 1998, and it's been reckoned that 10% of all crime fiction sales in the UK bears his name. The issue of a Rankin paperback can be counted on to sell 500,000 copies, give or take a few, within three months.

Next month, though, the author will start work on what should by rights be the final Rebus story.

The first book, Knots & Crosses, was published in 1987, when Rebus was 40. He'll thus turn 60 in 2007 and can expect his gold watch.

Ian Rankin has teased us in recent months: hinting at times that he might terminally despatch his most successful character; on other occasions denying that's what will happen. So, what's the truth? Is he thinking of bumping off Rebus in a dramatic finale to rival EastEnders or Coronation Street?

“Not killing him off, but the series takes place in real time. If you're in CID in Scotland, you have to retire then, like it or not.”

And is that's what will happen?

“I think so. I'm pretty certain at the moment. But, of course, they might change the law; because telling people they have to retire is now discriminatory, and he can come back. But at the moment he's got to retire.”

That's clear, then.

He's about to sign a deal for three non-Rebus novels, to be delivered every two years, and might be writing the words for a comic book soon, so it looks like a Rebus-free zone is being established.

Is there a chance his up-and-coming detective sergeant, Siobhan Clarke, will assume the mantle and continue the House of Rebus dynasty?

“It's a possibility. A lot of fans have suggested that: Rebus retires, but he's there on the sidelines, helping her out. It really depends on whether I've got new things to say about Rebus himself and what I've got to say about Edinburgh.”

Indeed, part of the reason for writing is to explore the city and show readers things about Edinburgh that they didn't know. “It's only half a million people, yet to me it seems to be endlessly complex.” His 2004 tale, Fleshmarket Close, featured asylum seekers in the city, for instance - and one of his characters has put quite succinctly the duality of Edinburgh's respectable public face and its grubby soles: “all fur coat and nae knickers”.

Rankin denies Rebus is himself in literary form.

“I invented him to be very different from me, so that nobody could see me in the book. My very first book I published (The Flood) was about the time I grew up, and I got in a lot of trouble because the townspeople didn't like what I said about the place, and thought they could see themselves in the book as characters.”

You said at one time that you were an unhappy youth. Rebus is obviously not very content . . .

“Well, I used to say I was a miserable teenager. I used to keep a day-to-day diary, and so I can chart my miserableness! Actually, I grew up in a very happy household - loving parents and a very settled childhood, and all the rest of it - but I was always attracted to the darker side of life.

“The first poem I got published - I was 17 - was when I came second in a competition, and the poem was called Euthanasia. And the music I listened to was kind of dark and gothic, so obviously there is something in my personality that refuses happiness! So Rebus might be the result of all that.”

So there are similarities, then? Ian once admitted he was a loner, didn't he?

“Yeah. I think most writers are. We prefer sitting in a room, in isolation, making up stories. I will go to the pub and stand and natter to people, but I'm actually happiest by myself reading a book, or doing a crossword, or listening to music. That bit of Rebus definitely comes from me.

“I've just never been the most gregarious sort. I can probably count close friends on the fingers of one hand, and most of them I made at either school or university, and precious few since.”

Ian makes frequent quips about imbibing. Does he really drink a lot?

“I don't drink that much. I go out one night a week; usually a Friday. But last night I was out and I've got a hangover today. Yeah, I suppose I do drink quite a lot: more than I should.” Whisky, like Rebus? “It's mostly beer. Whisky's the killer, because my body doesn't like it. I like it when I'm drinking it, and then afterwards I think 'Why did I do that?'

“Last night it was actually far too much red wine. I was at a dinner.”

Wife Miranda was there, too, but doesn't share his hangover. “She goes out two or three times a week. She plays bridge and she belongs to three of these book groups.” Do they ever read his? “Not yet. Whether she's actually banned them from so doing I don't know.”

His wife is, however, the first to read his novels in manuscript form. “She tells me whether it's any good or not and whether I've made any mistakes.”

He's sitting in his office this morning. (The Rankin home in the Merchiston district of Edinburgh is next door but one to Alexander McCall Smith, author of The No. 1 Ladies' Detective Agency series. JK Rowling is round the corner.) It's a room of about 12 feet by 10 feet and contains his whole life: those diaries, his albums and CDs, his laptop.

“If you locked these doors and welded them shut, I could stay in here forever. Just a plate of food being passed through from time to time under the door.”

But you'd need the family to be locked in there as well, wouldn't you?

“Well, I don't know.”

You don't mean it . . .

He laughs in the kind of hee-hee-hee-hee-hee way one normally only sees in a comic.

Speaking of pubs - which we were earlier - his regular haunt is the tatty-looking Oxford Bar in Edinburgh's Young Street. (The owners admit some folk liken it to “a Scout hut for the over 30s”, but insist you shouldn't judge a book by its cover.)

He can watch people, hear snatches of conversation.

The only problem is, it's the bar at which Rebus drinks in the novels, so it's also visited by a lot of fans.

“They're always terribly disappointed when they meet me - because I'm not Rebus. I'm not like him. I'm not as complex as him; I'm not as gruff; I'm not as hard-drinking. And they're not looking for me; they're looking for him.”

Not that he minds. Indeed, one of the pluses of publicity tours is meeting his readers. “They tell you what you're doing right and what you're doing wrong!”

He's giving an evening talk at Bury St Edmunds Corn Exchange, in conjunction with Ottakar's - on Hallowe'en, of all nights.

“I'll be the one wearing the witch's hat.”

For details about ticket availability, call 01284 750877. The Naming of the Dead is published by Orion Books at £17.99. ISBN 9780752868585

THE Naming of the Dead draws on the most eventful week in modern British history.

It's July 2005 and, with the G8 leaders meeting at Gleneagles, protest demonstrations are a staple of life in Scotland. The police are stretched, but Det Insp John Rebus is left on the sidelines. The authorities don't want a maverick on the scene at this tricky time.

Then comes the apparent suicide of an MP, and the sense a serial killer might be on the loose. The bosses are keen to keep everything quiet, but for the detective it's a reason to get involved.

Rankin recognises his books have become more political over time. This one's no different. “I knew that Rebus would be cynical about people marching. I was able to balance that by using Siobhan, who's young enough and more of a liberal. She thinks she can change the world, whereas he's a cynical old duffer who's more right-wing. That was quite fun. My views aren't necessarily his, so I could use him as a way of exploring different ways of looking at that situation.”

Neither Rebus nor Rankin were overnight literary successes. He'd written as a boy, wrote poetry and prose at university in Edinburgh, and then had a succession of jobs. He was 24 before he tried to write a novel, “and the first attempt was no good. So that's still sitting in the bottom drawer somewhere”. The second one was published by a small Edinburgh publisher - 200 hardback copies - but through that he got an agent.

He and Miranda met as undergraduates and married in the mid-1980s. They spent four years in London. He edited a hi-fi magazine and wrote in his spare time; Miranda was a senior civil servant running the private office of trade minister Francis Maude.

Then they moved to France for six years to enjoy a simpler life. “We were living in London, didn't much like it, she had a high-pressure job, and she said 'Look, Ian, if you want to try to be a full-time writer, we're going to have to get out of this city.'

“So she went and found a little ramshackle farmhouse in an unfashionable part of the Périgord (Dordogne) that was going cheap. We had no kids; no encumbrances. No money. We rewired it ourselves - which meant every time I opened the fridge I got an electric shock. And had to re-wire it again.”

So he toiled away, producing four Rebus stories, “relatively short and uncomplicated affairs”, and three thrillers under the pseudonym of Jack Harvey. The family, now with two sons, moved back to Edinburgh in 1996. His books were selling about 30,000 in paperback format: OK but not wonderful. Then Black and Blue proved his commercial breakthrough novel.

Why did Reebus capture readers' imaginations at that stage, and not before?

“I think there was a selection of things that clicked. The books got better! There was a marked increase in quality as I grew in confidence. Then I won a big prize, the Gold Dagger, for the crime novel of the year, and that helped my profile.

“It was a slow process and there were plenty of times when I thought 'I'm never going to be a success.' I'm not qualified to do anything else, so thank god they did eventually take off!”

Facts, not fiction

Ian Rankin was born in April, 1960

Brought up in Cardenden, a former mining town 30 miles north of Edinburgh

The Rankinses' boys, Jack and Kit, are 14 and 12

Kit has a rare genetic disorder called Angelman Syndrome, which causes severely arrested development and means he needs constant care

Ian Rankin received the OBE in 2002

He says: “I don't splash the cash; my money tends to get spent on CDs and booze”