The computer science of TeX and LaTeX