 He eked out a living by being a private tutor for some years before fleeing to Shanghai in 1852 to evade the Taiping Rebellion.There he collaborated with Alexander Wylie, Joseph Edkins and others to translate many Western mathematical works into Chinese, including "Elements of Analytical Geometry and of the Differential and Integral Calculus" by Elias Loomis, Augustus De Morgan's "Elements of Algebra", and the last nine volumes of "Euclid's Elements" (from Henry Billingsley's edition), the first six volumes of which having been rendered into Chinese by Matteo Ricci and Xu Guangqi in 1607.A great number of mathematical terms used in Chinese today were first coined by Li.