Until I did the research for yesterday's inscription, it would never have occurred to me that this was a quotation. 'Though lost to sight to memory dear' is so popular on both civilian and military headstones, and it appears so regularly on In Memoriam cards and the In Memoriam columns of newspapers that I had just assumed it was something that you said, no author required. But this appears not to be the case. The words are in fact the first line of a song written by George Linley (1798-1865) who wrote it originally for Augustus Braham (1819-1889). This is the first of its seven verses:

Tho' lost to sight, to memory dear
Thou ever wilt remain;
One only hope my heart can cheer -
The hope to meet again.

Some have argued that Linley didn't compose the first line he just quoted from what was already a popular headstone inscription. It is possible that this was the case. Certainly there's another poem, strictly speaking I suppose it's verse rather than poetry, where it's the final line of both of the two verses - the authorship is disputed but it postdates Linley. This is the second verse.

Sweetheart, good bye! One last embrace!
O cruel fate, two souls to sever!
Yet in the heart's most sacred place
Thou alone shall dwell for ever.
And still shall recollection trace,
In fancy's mirror ever near.
Each smile, each tear, that form, that face,
Though lost to sight to memory dear.

However, I am perfectly prepared to admit that the many hundreds of people who chose this inscription, and it is one of the most popular, had no idea that they were quoting either Linley or anyone else. To them it was just a conventionally popular headstone inscription.
In this instance it belongs to Gunner Robert Samuel Barber, who before the war had been helping his father on his dairy farm in Yandina, Queensland, Australia. Barber enlisted on 23 September 1915, embarked from Australia on 11 May 1916, arrived in Britain on 10 July and embarked for France on 24 November. He was killed by a shell on 3 October 1917.
A witness (Sergeant H. Canfield 18849) who described Barber as "about 5 feet 6 inches high, nuggety build, clean shaven, fair complexion, aged about 25", told the Australian Red Cross Wounded and Missing File what happened:

"Informant states that they both belonged to the 25th Battery, 7th Field Artillery Brigade, Barber being a lumber gunner and under Informant's charge. On or about 3.10.17 the Battery was in front of Ypres in action, firing at different targets. Barber was working with him and left him to go over to his gun, No. 1, and went into a little dugout that he was building alongside the gun. He had only been there about a minute when a stray shell came over and killed him instantly. Informant was only a few yards away at the time and saw his body. He was buried not far from the Battery and informant made a cross for his grave."

The cross survived and after the war it was found with Barber's body at map reference I. 6. b. 8. 1. just as Sergeant H. Canfield had made it, inscribed with the words:

In memory of
No. 18641 Gunner Barber R.S.
C of E
Killed in action 3-10-1917