His family, of German origin, moved to Pozsony (today Bratislava) in 1858. There, he learned the Hungarian language. His family then moved to Pest in 1863. Ludwig part completed his studies in Cologne and part in Stuttgart. He was especially interested in Lepidoptera and he founded a popular library. In 1870, he became a freemason. He worked for twelve years on a history of freemasonry. He changed his first name Ludwig to its Hungarian form, Lajos, and he assumed his "nom de plume" Abafi. His enterprise declined during the years 1880 to 1890, when he closed it. From 1890, he was entirely devoted to entomology. He published his observations in the revue of the Budapest museum Természetrajzi Füzetek and participated as editor and author in the Fauna Regni Hungariae. His book, Magyarország lepkéi (butterflies of Hungary) of 1907, was extremely popular and influenced many generations of entomologists of his country.