It was a life-changing moment. Novak Djokovic was in Croatia in the summer of 2010 for a Davis Cup tie and was having a consultation with Dr Igor Cetojevic, a nutritionist and fellow Serb.

Cetojevic told Djokovic to stretch out his right arm while placing his left hand on his stomach. The doctor then pushed down on Djokovic’s right arm and told him to resist the pressure. The strength Djokovic would feel in holding firm, the doctor said, was exactly what he should experience.

Next Cetojevic gave Djokovic a slice of bread. He told the bemused player not to eat it but to hold it against his stomach with his left hand while he again pushed down on his outstretched right arm. To Djokovic’s astonishment, the arm felt appreciably weaker.

It was what Cetojevic had expected. His crude test had been to discover whether Djokovic was sensitive to gluten, a protein found in wheat and other bread grains. Looking back, it was the moment when Djokovic discovered why he had suffered so many mid-match collapses in his career – and the starting point for a lifestyle change which led to his becoming world No 1 just 12 months later.

Until now Djokovic has been reluctant to go into detail about the regime that has turned his life and career around. Today, however, the 26-year-old Serb tells his story in a remarkable book, Serve To Win, which reveals how changing his diet has transformed his health and tennis.

Wimbledon: The greatest pictures from The Championships Show all 50 1 /50 Wimbledon: The greatest pictures from The Championships Wimbledon: The greatest pictures from The Championships Andy Murray walks of court with the trophy past the ball boys and girls on Centre court after beating Milos Raonic in 2016. Colorsport/Andrew Cowie Wimbledon: The greatest pictures from The Championships Serena Williams falls to the ground after winning match point on Centre Court in 2016. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Novak Djokovic with the trophy with Roger Federer on Centre Court, in 2015. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Serena Williams balances the Venus Rosewater Dish on her head with no hands as she walks off Centre Court. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Novak Djokovic shows off the trophy on Centre Court. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Petra Kvitova holds her winners Plate on Centre Court in 2014. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Andy Murray celebrates with the crowd after winning match point in 2013. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Marion Bartoli climbs up into the stand to family and coaches after beating Sabine Lisicki in 2013. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Andy Murray congratulates Roger Federer in 2012. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Serena Williams with the Ladies Plate in 2012. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Novak Djokovic defeats Rafael Nadal in the final of the mens singles on day thirteen at Wimbledon 2011. Ian MacNicol Wimbledon: The greatest pictures from The Championships Petra Kvitova with her trophy after defeating Maria Sharapova in their final match of the womens singles on day twelve at Wimbledon 2011. Ian MacNicol Wimbledon: The greatest pictures from The Championships Rafael Nadal beat Tomas Berdych in the 2010 final. Kieran Galvin / Colorsport Wimbledon: The greatest pictures from The Championships Serena Williams after beating Vera Zvonareva. Kieran Galvin / Colorsport Wimbledon: The greatest pictures from The Championships Roger Federer kisses the trophy after beating Andy Roddick in 2009. COLORSPORT / Cowie Wimbledon: The greatest pictures from The Championships Serena Williams shows off the dish to photographers in 2009. COLORSPORT / Cowie Wimbledon: The greatest pictures from The Championships Venus Williams (USA) walks past the Photographers on Centre Court in 2007. COLORSPORT Wimbledon: The greatest pictures from The Championships Rafael Nadal of Spain drops onto the grass to celebrate winning the title. Colorsport / Imago Wimbledon: The greatest pictures from The Championships Roger Federer with the mens trophy after winning the title for the 5th time in a row. COLORSPORT Wimbledon: The greatest pictures from The Championships Venus holds aloft the Ladies Shield after beating Marion Bartoli in 2007. COLORSPORT Wimbledon: The greatest pictures from The Championships Roger Federer with the Trophy, glances over at Rafael Nadal. COLORSPORT Wimbledon: The greatest pictures from The Championships Amelie Mauresmo celebrates match point. She beat Henin Hardenne in the 2006 final. COLORSPORT Wimbledon: The greatest pictures from The Championships Roger Federer drops to the ground after winning match point in 2005. COLORSPORT Wimbledon: The greatest pictures from The Championships Federer plays a shot in 2005. COLORSPORT Wimbledon: The greatest pictures from The Championships Serena Williams with the Ladies Shield and sister Venus Willams, in 2005. Colorsport Wimbledon: The greatest pictures from The Championships Maria Sharapova stunned Serena Williams in the 2004 final. Wimbledon: The greatest pictures from The Championships Venus Williams hugs the winners plate in 2005. COLORSPORT Wimbledon: The greatest pictures from The Championships Roger Federer holds aloft the Mens Singles Trophy after his straight sets victory over Mark Philippoussis in 2003. COLORSPORT Wimbledon: The greatest pictures from The Championships Serena and Venus Williams smilling after the 2003 Womens Final, won by Serena. COLORSPORT Wimbledon: The greatest pictures from The Championships Lleyton Hewitt celebrates victory in 2002. Colorsport Wimbledon: The greatest pictures from The Championships Goran Ivanisevic celebrates beating Tim Henman in the mens semi-final in 2001. Colorsport Wimbledon: The greatest pictures from The Championships Venus Williams with the Ladies trophy after defeating Justine Henin in 2001. Colorsport Wimbledon: The greatest pictures from The Championships Venus Williams celebrates with the Ladies winners plate after defeating Lindsey Davenport in 2001. Colorsport Wimbledon: The greatest pictures from The Championships Pete Sampras with The Mens singles trophy in 2000. COLORSPORT Wimbledon: The greatest pictures from The Championships Pete Sampras kisses the Mens Wimbledon Trophy after beating Andre Agassi in 1999. COLORSPORT Wimbledon: The greatest pictures from The Championships Ladies winner Lindsay Davenport with the trophy and and runner-up Steffi Graf. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Pete Sampras celebrates. COLORSPORT Wimbledon: The greatest pictures from The Championships Jana Novotna celebrates victory in 1998. COLORSPORT Wimbledon: The greatest pictures from The Championships In 1997 Pete Sampras got the better of Cedric Pioline. COLORSPORT Wimbledon: The greatest pictures from The Championships Martina Hingis holds aloft the Ladies Plate. Colorsport / Andrew Cowie Wimbledon: The greatest pictures from The Championships Richard Krajicek drops to the ground after winning the final on Centre Court. He beat Mal Washington. COLORSPORT Wimbledon: The greatest pictures from The Championships Steffi Graf shows Sanchez Vicario the Shield after the presentation on Centre Court. Colorsport Wimbledon: The greatest pictures from The Championships Pete Sampras shortly after beating Boris Becker in 1995. COLORSPORT Wimbledon: The greatest pictures from The Championships Steffi Graf celebrates after winning match point in 1995. Colorsport/ Stewart Fraser Wimbledon: The greatest pictures from The Championships Pete Sampras reacts after beating Goran Ivanišević 7–6(7–2), 7–6(7–5), 6–0 in the 1994 final. COLORSPORT Wimbledon: The greatest pictures from The Championships Conchita Martinez is the only Spanish player to have won the women's singles title at Wimbledon, where she beat Martina Navratilova to win the 1994 title. Colorsport Wimbledon: The greatest pictures from The Championships Steffi Graff of Germany glances over to Jana Novotna as she breaks down in tears at the presentation after losing the match. Colorsport Wimbledon: The greatest pictures from The Championships Sampras beat Jim Courier 7–6(7–3), 7–6(8–6), 3–6, 6–3 in the 1993 final. Wimbledon: The greatest pictures from The Championships Andre Agassi receives the trophy from the Duchess of Kent in 1992. Wimbledon: The greatest pictures from The Championships Stefi Graf shows off the ladies Plate to the crowd. Colorsport/ Stewart Fraser

From being a player with suspect fitness, Djokovic has become arguably the greatest athlete in world tennis, combining stamina and strength with extraordinary speed and flexibility. He became world No 1 in 2011 and has stayed there ever since, apart from a spell in the second half of last year when Roger Federer relegated him to No 2.

Djokovic’s connection with Cetojevic goes back to the 2010 Australian Open. The doctor, who had no interest in tennis, was at his home in Cyprus, flicking through the television channels, when his wife suggested they watch Djokovic’s quarter-final against Jo-Wilfried Tsonga. Djokovic was two sets to one up against the Frenchman when he suffered another of the physical crises that had bedevilled his career. He had trouble breathing and vomited violently during a toilet break. His strength sapped, he won only four games in the last two sets as Tsonga coasted to victory.

The watching Cetojevic immediately suspected what was wrong. He guessed that Djokovic’s breathing difficulties were the consequence of an imbalance in his digestive system which was triggering an accumulation of toxins in his intestines.

Cetojevic and Djokovic’s father had mutual friends and six months later the doctor was doing the bread test that confirmed his original suspicion. Cetojevic told Djokovic that he suspected food sensitivities were causing his physical problems and affecting his mental state. He told the player he could help him devise a diet that would be right for his body and could transform his health and fitness.

Subsequent blood tests showed that Djokovic was strongly intolerant to wheat and dairy products and mildly sensitive to tomatoes. Being told to stop eating bread and cheese and cut down on tomatoes was not the best news for someone whose parents owned a pizza restaurant, but the open-minded Djokovic was willing to give it a go.

Bread and pasta are staple foods in Serbia, but Cetojevic asked Djokovic to try a new gluten-free diet for two weeks. The effect was immediate. Djokovic felt lighter and more energetic and slept better than he had ever done. When Cetojevic suggested after a week that he should eat a bagel, the negative impact was startling. Djokovic felt sluggish and dizzy, as if he had a hangover.

When he switched permanently to the diet, the benefits quickly followed. Within 12 months Djokovic was 11lb lighter and feeling stronger and healthier. Ever since following the regime, he has felt fresher, more alert, more energetic and mentally sharper.

Djokovic’s early years as a professional were very different. In 2005 he had taken the first set against Guillermo Coria at the French Open but retired in the third because “my legs had turned to rock and I couldn’t breathe”. During a victory over Gaël Monfils at the US Open three months later he took four medical timeouts after running out of breath.

Novak Djokovic prepares for Roland Garros

Djokovic had always worked hard on his fitness and in the search for a solution to his problems – which some put down to asthma – he changed trainers, adopted new training regimes, had nasal surgery and took up meditation and yoga. Although his physical condition improved – he claimed his first Grand Slam title at the 2008 Australian Open – the mid-match collapses did not go away.

When he moved his pre-season training camp to Abu Dhabi at the end of 2009, hoping to acclimatise to heat before heading to Australia, Djokovic thought he might have found the missing piece in the jigsaw, only for the meltdown against Tsonga in Melbourne to revive all his concerns. Thankfully for the Serb, however, Cetojevic was watching.

The key to the diet Djokovic now follows is the absence of both gluten – which is present in most foods – and dairy products. He also cuts out as much sugar as possible. The world No 1’s diet is based on vegetables, beans, white meat, fish, fruit, nuts, seeds, chickpeas, lentils and healthy oils.

He is meticulous about when and how he eats. Djokovic buys organic food wherever possible and cooks almost every meal himself; when on tour he always tries to stay in hotels which will let him use their kitchen. After saying a short prayer before meals – not to any specific god but to remind himself never to take food for granted – Djokovic eats slowly and deliberately. He never watches television or uses his phone or computer while eating.

Djokovic had to changed his diet or risk his career (Getty)

His dedication to his diet is extraordinary. After winning his near six-hour final against Rafael Nadal at the 2012 Australian Open, Djokovic had a craving for chocolate, which he had not eaten for 18 months. His physiotherapist brought him a bar. Djokovic broke off one small square and let it melt in his mouth – but left the rest.

Serve To Win contains passages about Djokovic’s tennis career and his upbringing in war-torn Serbia, but for the most part it is a fascinating insight into his lifestyle. It contains recipes developed by Candice Kumai, a chef and author, and also goes into fine detail about the player’s daily life, including his fitness and training regimes.

Djokovic believes the diet has made him more level-headed and less anxious or prone to anger, though other routines have also helped in that respect. He never skimps on sleep and always tries to go to bed at the same time, between 11pm and midnight, before getting up at 7am. He uses yoga and meditation and believes in “positive thinking”.

The Serb’s training routine away from competition rarely changes. After 20 minutes of yoga or tai chi, followed by breakfast, he hits with a training partner for an hour and a half, does stretching and has a sports massage. After lunch – when he avoids sugar, protein and unsuitable carbohydrates – Djokovic does a one-hour workout using weights or resistance bands, after which he takes a protein drink. Another 90-minute hitting session, followed by stretching and perhaps another massage, concludes his day’s physical work.

If it seems extraordinary that a change of diet could so change an athlete’s life, Djokovic’s example has been followed by plenty of others. Several other tennis players have gone on to similar regimes and many tournaments now offer gluten-free and dairy-free food.

Behind the scenes at Wimbledon: Food and drink at SW19

Dr William Davis, whose 19-year-old daughter Lauren is the world No 70, has written a foreword to Djokovic’s book. A cardiologist, Dr Davis has written extensively about the problems caused by eating modern wheat, which he says is the product of “genetic manipulations by geneticists and agribusiness”.

Among the physical problems Dr Davis says eating wheat can cause are ulcerative colitis, acid reflux, abdominal stress and rheumatoid arthritis. He also says it can contribute to paranoia, schizophrenia and autism. He says that eating wheat “has the potential to cripple performance, cloud mental focus, and bring a champion to his knees”. Djokovic knows exactly what he means.

‘Serve To Win’ by Novak Djokovic, is published by Bantam Press (£12.99)

Fit for a star: The champion’s menu

Day One

Breakfast Water first thing out of bed; two tablespoons of honey; muesli (including organic gluten-free rolled oats, cranberries, raisins, pumpkin or sunflower seeds and almonds)

Mid-morning snack (if needed): Gluten-free bread or crackers with avocado and tuna

Lunch Mixed-greens salad, gluten-free pasta primavera (including rice pasta, summer squash, courgettes, asparagus, sun-dried tomatoes and optional vegan cheese)

Mid-afternoon snack Apple with cashew butter; melon

Dinner Kale caesar salad (kale, fennel, quinoa and pine nuts) plus dressing (including anchovies or sardines); minestrone soup; salmon fillets (skin on) with roasted tomatoes and marinade

Day Two

Breakfast Water first thing out of bed; two tablespoons of honey; banana with cashew butter; fruit

Mid-morning snack (if needed): Gluten-free toast with almond butter and honey

Lunch Mixed-greens salad, spicy soba noodle salad (including gluten-free soba noodles, red bell pepper, rocket, cashews and basil leaves, plus spicy vinaigrette)

Mid-afternoon snack Fruit and nut bar; fruit

Dinner Tuna nicoise salad (green beans, cannellini beans, rocket, tuna, red pepper, tomatoes and canned chickpeas), tomato soup, roasted tomatoes

Day three

Breakfast Water first thing out of bed; two tablespoons of honey; gluten-free oats with cashew butter and bananas; fruit

Mid-morning snack (if needed): Home-made hummus (including chickpeas and gluten-free soy sauce) with apples/crudités

Lunch Mixed-greens salad, gluten-free pasta with power pesto (including rice pasta, walnuts and basil leaves)

Mid-afternoon snack Avocado with gluten-free crackers; fruit