A man followed his ex-girlfriend onto a train despite a court order banning him from being near her.
Richard Martin, 35, was made subject to an indefinite restraining order in September 2009.
The order, which bans him from having any contact with Lauren Stables, was made by magistrates after he harassed her through persistent phone calls.
Martin, who until recently had been living in Primrose Hill in Huddersfield, had initially pleaded not guilty to breaching his restraining order.
However, he was convicted of the offence following a trial at Kirklees Magistrates’ Court in July. He was back in court yesterday for sentencing.
Prosecutor Ben Crosland said that the incident happened on a train on October 8 last year.
On the day Martin was at Barnsley Railway Station having just arrived on a train from Huddersfield when he spotted his former girlfriend.
Mr Crosland said: “She was about to board a train from Barnsley to Huddersfield.
“He realised it was her and made the decision to get back on the train.”
District Judge Marie Mallon heard that Martin proceeded to sit in the same carriage as Ms Stables.
He sat near her and then stood behind her before settling on a seat right opposite her.
Mr Crosland said: “She’s got her headphones on and was reading some files, avoiding eye contact with him.
“At one point the defendant raised his arm to try and attract her attention.”
At Barnsley Magistrates’ Court where the original order was made, magistrates heard that the former music student bombarded Ms Stables with a number of calls and text messages after they split up.
Yesterday jobless Martin, who was not represented, told Judge Mallon that he had smoked cannabis since the age of 14 and this had made him feel paranoid from time to time.
He said of his latest conviction: “I need to get on with my life (but) I’ve learnt a lot from this experience.
“A lot of my problems are not having things to do and it’s not good for me to stay at home all the time.”
The judge sentenced him to a 12-month community order with 80 hours of unpaid work.
Judge Mallon also ordered him to pay £200 towards prosecution costs and £60 victim surcharge.