[Tex/LaTex] the difference between a typesetting language and a markup language

markuptex-coretypography

I remember, I read some article in a technical journal where the author drew the attention on the reader on a lot of people confusing typesetting languages and markup languages.

How can I surely tell if a language is a typesetting language or a markup language?

As far as I understand TeX is a typesetting language and LaTeX implements a markup language atop TeX. Is this a correct way to put things?

Best Answer

As far as I understand TeX is a typesetting language and LaTeX implements a markup language atop TeX. Is this a correct way to put things?

yes, this is accurate, as well as concise.

a typesetting language provides the tools to convert an input stream into what is output on a surface. among the tools are

  • access to fonts, and commands to select and/or switch between them
  • commands to move along the surface in various directions
  • a mechanism to break an input stream into lines or paragraphs, and the result into pages
  • commands to apply the "basic" commands in a more efficient manner

as an example of the last point, one very valuable feature in tex is the concept of grouping. this is not present in other typesetting software i've used. for example, in one such system, there was a command to raise a superscript to the proper height, and a "reverse" command to step back out of it by the same distance. (it didn't always put one back at exactly the original baseline.) tex, on the other hand, stores the original values when a new group starts, applies the local values for the group, then forgets the local values and restores the saved values.

a markup system, on the other hand, identifies material according to its function or structure, not how it should look on a surface. thus there are identifiers for "title", "author", "chapter", "section", "theorem", etc., and these are converted at processing time to use appropriate typesetting commands. this structural markup permits easy switching of output format, provided a common vocabulary and syntax are used. latex and xml are two examples of markup systems. neither can be used without "back end" support. in latex, this support is integral, while xml requires separate tools; however, what is identified in both cases are the structural elements, not the final appearance, hence "markup".