THE mystery of how Sherlock Holmes knew so much about poisons has been cracked in the archives of the world-famous Royal Botanic Garden Edinburgh.

Newly-unveiled records show the fictional detective's creator, Sir Arthur Conan Doyle, took a break from studying medicine to take a course in botany.

Class rolls dating back to 1877 prove that a surprisingly green-fingered Doyle attended about 60 classes, seven demonstrations and nine excursions.

The 140-year-old records bear the signature of a teenage Doyle, along with the the fact that he missed two classes through illness.

Doyle's studies went on to play a crucial part in the Sherlock novels as the legendary detective utilised his knowledge of poisonous plants to solve a range of murder mysteries.

The researchers, led by archivist Leonie Paterson, have worked with the National Galleries of Scotland and Edinburgh University Library to piece together the author's time in the capital.

They discovered that as part of his medical degree, Conan Doyle was required to take a summer course on Vegetable Histology and Practical Biology at the gardens.

During his studies he had access to plants such as opium and belladonna - a deadly nightshade.

He did not start writing the infamous Sherlock novels until a decade later, but it appears his studies stuck with him.

There are several references to botany and poisonous plants within the series, with a specific mention by his trusty sidekick Dr Watson.

In A Study in Scarlet, Watson lists Sherlock's strengths and weaknesses.

He proclaims: "Knowledge of Botany: Variable.

"Well up in belladonna, opium, and poisons generally. Knows nothing of practical gardening."

The list is a direct nod to Conan Doyle's own abilities - during his studies he learned about the uses of plants but was not lectured in practical work.

There are a total of five cases of homicidal poisoning out of the 60 Sherlock stories, including in The Sword of Osman where a chief armourer is found dead following abdominal pain, dizziness and sweating.

Sherlock is able to immediately deduce that the man has died after being given Monkshood - a purple plant also known as the "Queen of all poisons".

Other plant references include that of opium in The Man with the Twisted Lip, and a deadly poison in The Adventure of the Devil's Foot.

Dr Elspeth Haston, deputy curator in the Botanics' herbarium, helped pull the research together.

She said: "I think it will surprise a lot of people to know that Conan Doyle studied here.

"It's a different aspect to his history and sheds a whole new light on his attributes.

"I'm a huge fan of the Sherlock series and this was a revelation to me - it's been really interesting to help piece the history together.

"It's really timely as Sherlock has become such a popular television series."

Graham Hardy, a staff member at the Botanic library, was able to shed some light on the day-to-day study life of Conan Doyle.

He said: "We've been able to find out that students at the time were taken on excursions to areas such as Roslin and Penicuik to collect samples.

"They could also study in the garden between 6am and 6pm, and attended demonstrations in the conservatories and hothouses.

"There is still a lot to find out - there are some letters from the time that have yet to be archived and there could potentially be some samples collected by Conan Doyle himself in our collections.

"I'm sure there will be one or two more surprises."