This is making assumptions on whitespaces in the latex, which are often optional. (We generate the latex, but this is not very robust.)