Forewords or prefaces (xu 序, also written 敘, rarely 緒) and afterwords or postfaces (ba 跋) accompanied and discussed content and background of texts in traditional China. The two words are still used today, but often replaced by the expressions xulu 序錄, xulüe 序略, xuwen 序文, xuyan 序言, yin 引, yinyan 引言, daoyan 導言, bianyan 弁言, and others. The expression yin 引 might go back to Liu Yuxi's 劉禹錫 (772-842) decision to replace the word xu because it was the tabooed name of his father Liu Xu 劉緒.
The word xu 序 itself means "arrangement, order, sequence" in general, and "beginning" (緒, of a thread) in particular. It was also an ancient expression of court (or village?) schools during the Shang dynasty 商 (17th-11th cent. BCE; see schools). The character is actually denoting part of a building, namely the eastern or western wing. The character 敘 can be used verbally, in the sense of "to expound, to narrate”.
Among the oldest prefaces are the the individual "lesser prefaces" (xiaoxu 小序) that accompany each poem of the Shijing 詩經 "Book of Songs", and the "grand preface" (daxu 大序) attached to the first poem. It is a kind of literary theory and thus an introduction to the whole book.
In early imperial China, xu were usually placed at the end of a text, as can still be seen in Sima Qian's 司馬遷 (145 or 135-86 BCE) "preface" Taishi Gong zixu 太史公自序 that is found at the very end of his history book Shiji 史記. Yet critically spoken, Sima Qian's text is rather a kind of autobiography, and not just a preface to his history book. Other examples of xu as afterwords are the final chapter Tianxia 天下 of the book Zhuangzi 莊子, the chapter Yaolüe 要略 at the end of the book Huainanzi 淮南子, the afterword Ziji 自紀 of the collection Lunheng 論衡, or the explanative afterword Xu 敘 of the dictionary Shuowen jiezi 說文解字.
Prefaces, or rather "accompanying words", might be written by the author himself (zixu 自序), as Liu Xiang 劉向 (79-8 or 77-6 BCE) did for his collection of stories of the Warring States, Zhanguoce 戰國策, or others, like friends or editors. Zuo Si 左思 (c. 250-305) was allegedly the first who asked someone else to write a preface for one of his texts. Some books have several prefaces that are called with the family name of the authors in order to tell them apart, like Wang xu 王序 and Li xu 黎序. Prefaces usually present the reason for the compilation of the book – for example, to fill a lack in scholarship –, explain its contents and arrangement. Wording and style of prefaces depended on the trends of time, for instance, the use of paired prose (pianwen 駢文), or simple prose.
The high literary quality of prefaces made them a literary genre of their own, and many anthologies of literature include prefaces of books, for instance, (Bu) Zixia's 卜子夏 (b. c. 507 BCE) preface to the Maoshi 毛詩 (i.e. the Shijing), and Kong Anguo's 孔安國 (c. 156-c. 74 BCE) preface to the Shangshu 尚書 "Book of Documents" in the anthology Wenxuan 文選. Longer poems also used to be accompanied by introductions, for example, Ban Gu's (32-92 CE; Ban Mengjian 班孟堅) "Rhapsody on the two capital cities, with prefaces" (Liang du fu bing xu 兩都賦并序), also included in the collection Wenxuan.
Examples for high-quality prefaces are Wang Bo's 王勃 (650-676) Tengwangge xu 滕王閣序, Han Yu's 韓愈 (768-824) Jingtan changge shi xu 荊潭唱和詩序, Ouyang Xiu's 歐陽修 (1007-1072) Sushi wenji xu 蘇氏文集序 and Wudaishi lingguan zhuan xu 五代史伶官傳序, Yao Nai's 姚鼐 (1731-1815) Taishan daoli ji xu 泰山道里記序 or Zeng Guofan's 曾國藩 (1811-1872) Ouyang Sheng wenji ji 歐陽生文集序.
Liu Xiang's collection Xinxu 新序 does not consist of prefaces, but of semi-historical stories or biographies, "newly arranged". This is also true for Liu Zongyuan's 柳宗元 (773-819), Xuyin 序飲, and Xuqi 序棋 that are not prefaces, but miscellaneous notes on drinking, and chess playing, respectively.
Another literary genre called xu is a text of parting dedicated to a person who goes travelling. It was presented to the parting person along with a cup of wine (jiansong 餞送) or a souvenir (zengbie 贈别). Famous texts of this genre are Han Yu's Song Li Ying gui Pangu xu 送李愿歸盤谷序 and Song Lian's 宋濂 (1310-1381) Song Dongyang Ma Sheng xu 送東陽馬生序.
During the Tang period 唐 (618-907), xu-type prefaces to prose writings were gradually replaced by tiji 題記, and from the Song period 宋 (960-1279) on, by tiba 題跋, i.e. forewords, and afterwords. Ba-type afterwords (today usually called houxu 後序 or houji 後記, rarely tihou 題後) are usually short and add some thoughts not mentioned in the foreword. The word ba is therefore usually translated as "colophon".
Famous afterwords are Ouyang Xiu's Sui Taipingsi bei ba 隋太平寺碑跋, Su Shi's 蘇軾 (1037-1101) Ba tui zhi song Li Yuan xu 跋退之送李愿序, Wang Anshi's 王安石 (1021-1086) Du Mengchang Jun zhuan 讀孟嘗君傳, Li Qingzhao's 李清照 (1084-1155) Jinshilu houxu 金石錄後序, Lu You's 陸游 (1125-1210) Ba Li Zhuangjiangong jiashu 跋李莊簡公家書, Wen Tianxiang's 文天祥 (1236-1283) Zhinanlu houxu 指南錄後序, Wang Shizhen's 王世貞 (1526-1590) Ti Haitian luozhao tu hou 題海天落照圖後 or Yuan Mei's 袁枚 (1716-1797) Shu lu liang chai 書魯亮儕.