He attained a jinshi degree in the imperial examination in 754, and served in several regional government posts before resigning in 769.
Among his most famous poems is the "Zei Tui Shi Guanli", which describes the state of the countryside following the An Lushan Rebellion, which he experienced first-hand. He also compiled a collection of poetry by his contemporaries, the Qie-zhong Ji, and was noted for his prose compositions. Books 240 and 241 of the Quan Tangshi are devoted to his poetry.
He attained a jinshi degree in the imperial examination in 754,[2][5] and was involved in the putting down of the An Lushan Rebellion.[2] In 763 he was appointed governor of Dao Prefecture,[2][3] and in 768 he moved to Rong Prefecture [zh],[3] but during this time he came to resent the heavy taxes that his position forced him to levy on the peasants,[2] and in 769, following the death of his mother, he resigned his post.[2][3]
There is a ten-volume, Ming-era anthology of his poetry called the Yuan Cishan Ji (Chinese: 元次山集; pinyin: Yuán Cìshān-jí; Wade–Giles: Yüan2 Tz'u4shan1 Chi1; lit. 'Yuan Cishan Anthology').[2]
His wuyan gushi [zh] poem "Zei Tui Shi Guanli" (simplified Chinese: 贼退示官吏; traditional Chinese: 賊退示官吏; pinyin: zéi tuì shì guānlì), which he wrote while stationed in Dao Prefecture and which describes the state of society immediately following An Lushan's rebellion, was highly praised by Du Fu, and is seen as a forerunner of the works of Bai Juyi.[2]
He also compiled the Qie-zhong Ji (simplified Chinese: 箧中集; traditional Chinese: 篋中集; pinyin: Qiè-zhōng jí; Wade–Giles: Ch'ieh4-chung1 chi2; lit. 'Out of the Book-Bin'),[7][4] a 760 collection of 24 poems by seven of his contemporaries, whose moral temper he admired but who did not hold official position.[7]