Yan hailed from Wannian 萬年 near the capital Chang'an 長安 (modern Xi'an 西安, Shaanxi) and was a descendant of the famous writer and scholar Yan Shigu 顏師古 (581-645) and father of the calligrapher Yan Zhenqing 顏真卿 (709-785). He began his career as commandant (wei 尉) of Chang'an 長安, became then a secretary (sheren 舍人) of the Heir Apparent, and was then regional inspector (cishi 刺史) of Chuzhou 滁州, Jizhou 沂州 and finally of Haozhou 濠州.
Yan Yuansun's short book is the oldest Chinese character book that was entirely written in "modern" regular script (kaishu 楷書) and did not rely on the seal script (zhuanshu 篆書) form of characters. It was based on an earlier study by Yan Shigu called Ziyang 字樣 "The shapes of characters". In Yan Yuansun's eyes, it was highly important to standardize characters and to use them consistently. Mastering the Chinese script was the most important precondition of any state official or those "seeking official emolument" (ganlu 干祿). The characters in his book are arranged according to 206 characters and four tones (ping 平聲, shang 上聲, qu 去聲, ru 入聲).
He discerns three types of characters, namely "correct" (zheng 正), "universally used" (tong 通) and "vulgar" (su 俗). To the latter category belong characters that are simply wrong, but very popular, like 𠂻 instead of 衷, or 皃 instead of 完. "Universally used" characters are such that are in use since long time, but strictly spoken not correct, often with a wrong radical, like 赱 or 走 instead of 𧺆 (yet 走 became accepted as the standard form) or 阪 and 坂. "Correct" characters are such basing on the chancery script (lishu 隸) and the standard script (kaishu) that developed out of it. Characters of this type are 派 (correct) vs. 泒 (wrong) or correct 第 vs. the commonly used, but wrong, 苐.
In his glossary, Yan Yuansun explains which character belongs to which of the three types, and in case of easy confusion, tells the pronunciation and meaning of a character, for instance tong 彤 "reddish" and rong 肜 "sacrifice on two successive days", or gui 宄 "traitor" and jiu 究 "finally". His general idea was that the "correct" characters were to be used as such, but he does not generally dismiss the others as entirely wrong. Each of these three types could be used in a different enviromment, the "vulgar" characters in letters, drafts, notes, treaties and medical recipes, the "universally used" ones for memorials to the throne, annotations and notes, epistolary writings, law case decisions, but the "correct" characters must be used in litary prose writings (wenzhang 文章) writings on political measures (duice 對策), stone inscriptions, and especially the state examinations.
Yan's categorization is not always quite right, like in the cases 虫 and 蟲, 啚 and 圖, 啇 and 商 or 凍 and 涷, where he says the first was vulgar, the second correct (these are in fact other words, and not simply alternative characters), or his statement that 皂 was a vulgar character for the commonly used 皃 and the correct form 貌, or that 𦮊 and 𦱪 were alternatives for 芻, which are all in fact vulgar forms, but identified as universally used ones by Yan.
The Ganlu zishu is transmitted in two different versions, one produced in 774 by Yan Zhenqing in Huzhou 湖州, the so-called Huzhou version 湖本, and one during the Southern Song period 南宋 (1127-1279) in Chengdu by Yuwen Shizhong 宇文時中 (d. 1139), the so-called Sichuan version 蜀本. The latter includes numerous clerical errors. Based on these two version, Master Gong 龔氏 produced a third version that was printed in 1805.