wrap code into #entities and #paragraph_nums