Dr Kate Stone spent three years in her youth on a 120,000-acre farm in the Australian outback, herding 22,000 sheep who were reluctant to do as they were told. She studied their habits, successfully redesigned the farm's herding system and later, for her PhD in electronics, she applied a similar approach to developing a way to move electrons around.

"Change the environment," she says. "And things will flow." In a 2013 TED talk, Stone demonstrated the practical application of her philosophy, which she now employs in her own company to make paper interactive.

She showed a poster printed with a drum kit which she duly bashed, producing an audible riff. The audience was impressed. The talk has now been watched by more than 600,000 people worldwide.

Five months ago, on New Year's Eve, Stone, aged 44, again found herself in the limelight, thanks to a million-to-one freak accident. On holiday in the Scottish Highlands, she and some friends were walking back from the village pub. It was pitch black. The friends went on ahead into their enclosed garden. Stone walked through the gate alone and a stag that had strayed into the garden ran into her, ramming its antlers into her throat.

With honourable exceptions, such as the BBC, coverage in the British media majored on Stone's transgender status: "Deer spears sex-swap Kate"; "Sex swap scientist in fight for life"; and "Sex-swap scientist gored by stag."

Now, as a result of a landmark negotiation with the Press Complaints Commission (PCC), six national newspapers – the Daily Mail, the Daily Telegraph, the Sun, the Scottish Sun, the Daily Record and the Daily Mirror – have agreed that the "sex swap" headlines and the reference to Stone's transgender status were inappropriate.

They acknowledged that such references constituted a direct breach of the discrimination clause in the PCC editors' code. The code states that details of an individual's transgender status "must be avoided unless genuinely relevant to the story". All such references were subsequently withdrawn from the newspapers' online stories.

Stone has now fully recovered from an accident that came close to taking her life. Speaking to the Observer, she said: "I have no regrets about the accident. I have never for one moment thought, 'Why me?' But some of the reporting was horrendous. The media doorstepped my family, my friends and colleagues. On radio, one 'expert' was asked, 'Was Kate gored by a stag because she was transgender?'

"The media tried to find out when I'd had my sex change. They tried to find out my previous name. All of which was upsetting and irrelevant to what had happened.

"A month before the accident I had been in a newspaper boardroom in a business meeting with senior management who were interested in utilising what my company does to bring paper to life. Transgender was never mentioned. Yet a month later their printing presses were rolling out all these deeply intrusive details about me."

Stone says she sees a connection between sensationalist headlines and the kind of abuse she used to encounter regularly six years ago in Cambridge. "I had just transitioned to a woman and my life was hell. People would shout abuse in the street, attack me in clubs, throw ice cubes at me in pubs. I'd always been scared of getting into trouble, but it came to me."

Eventually Stone wrote to the owners of a chain of clubs about the hostility she was receiving, in particular from its bouncers. "They brought 15 bouncers together and asked me to talk to them about diversity. I told them that I had family, so I had something in common with them; that I was a scientist, so I've got some brains. I was just a person, like them. I never had any more difficulty. People are frightened of difference. Derogatory headlines feed into that objectification and justify dehumanising behaviour."

Stone is charming and funny, and says she was heartened by the significant support she received from many members of the public, who criticised the sensationalist coverage. "I went to the Press Complaints Commission not for money or an apology but because I want a clear line drawn so it doesn't happen to anyone else ever again.

"Many people who are transgender are terrified that if anything happens to them – as it did to me – they will be splashed all over the papers. One accident might mean that they lose their job, their family, their home, their colleagues."

At the time of the accident, Stone had been planning a reunion. She and her sister and brother had drifted apart a number of years earlier. Stone had been reunited with her sister and is very proud of her 15-year-old niece, Charlotte Brimner, a singer-songwriter, who wrote a song for her aunt when she was recovering in hospital. On New Year's Day, Stone had been due to meet her brother for the first time in 20 years. "Instead we met at my hospital bed. He is the nicest, most generous man you could wish to meet. We are a family again."

On the night of the accident, the stag's antlers pierced Stone's oesophagus, just missed her voice box, and drove a hole in her spine . "I was a millimetre away from dying. None of us saw the stag. All I remember was two thuds and then I was on the floor. I thought, 'This is bloody bad.'

"My friend is a doctor and she told me to focus on breathing. So I did. One breath in, another moment of life; another breath out, a second chance of life. The ambulance took 20 minutes to drive from Fort William. After 35 minutes I passed out. I was never in pain."

The stag had shattered Stone's throat. A metal stent was inserted at Fort William's Belford hospital and her punctured left lung was drained. A helicopter then transferred her to Glasgow's Southern General hospital. In a 10-hour operation, surgeons reconstructed the cartilage in her neck; another lengthy operation was needed to clear the damage around her spinal cord. Stone had to learn to speak and write again.

"The NHS and the staff were so dedicated. When I first came to, I was breathing through an oxygen tube in my neck. I just thought, how lucky am I? Everything in life is a bonus."

Three weeks later, however, Stone read the newspaper coverage for the first time. Lord Justice Leveson, in his report in November 2012, had expressed hope for better press representation of trans people in the same way that coverage of gay people had improved.

He wondered whether this change was an example of the press's ability to put its own house in order or whether society had changed and the press had been forced to keep up.

Dr Stone, in going to the PCC, sought help from All About Trans, a project that arranges meetings between transgender people of all ages and members of the media and the entertainment industry. In the past few months, meetings have involved the Observer, script writers on ITV's Emmerdale, Channel 4 News, news website Wales Online, actors from Channel 4's Hollyoaks and others.

"When Kate first made the complaint," says Sarah Lennox, of All About Trans, "some papers said 'sex swap' was a light-hearted term. Very few people actually know a transgender person – they get their information from the media – so it's important that the coverage is fair. Let's hope 'sex swap' headlines will now become a relic of the past. Name-calling and finger-pointing validates the bullies so they believe they are behaving in a socially acceptable way. Thousands of transgender people are living in secret because of the stigma that still exists and they are fearful of the reaction. That has to change."

According to some estimates, there are 500,000 transgender people in the UK. In the couple of years before her accident, Dr Stone says, life had improved. "I had friends, I was back in touch with my children and I had my own business. I went to the gym. I was Kate. Now, after the press coverage, I am a lot more sensitive again as to how people will react. Will they treat me differently? I hope not."

• This article was amended on 11 and 12 May 2014 to amend the main and sub-headings. An earlier version referred to a Press Complaints Commission ruling, rather than a negotiation.