Hierachy to latex