16

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?

asked Sep 23, 2014 at 19:47
7
  • 2
    a typesetting language will provide instructions to do things like explicitly specify fonts, spacing, and similar elements. a markup language will provide the means to identify what is to be composed, e.g. section headings, display math, etc. tex is definitely a typesetting language. latex is rather a hybrid, as it encourages the identification of logical elements, but also provides the ability to drop into the niggly typesetting details, and some users prefer to work at that level. a true markup language doesn't allow that freedom. Commented Sep 23, 2014 at 19:56
  • @barbarabeeton Things like HTML (at least, old, pre-CSS, HTML) tend to blur lines a bit, because they contain a lot of concrete elements (fonts, distances, etc.) Is old HTML something like "an impure markup language"? Commented Sep 23, 2014 at 20:06
  • you're correct about "old" html -- and even the current flavor -- being more-or-less hybrids in the same way as latex. i was thinking of sgml or xml with the requirement of a dtd to "keep them honest" (and cut down on the ability to escape from the strait-jacket). and other (unrelated) markup languages existed and were in use by publishers/composition houses before the internet was available to the masses. Commented Sep 23, 2014 at 20:10
  • 1
    @barbarabeeton I don't quite understand the basis of the distinction. Isn't it a matter of degree? Presumably you could have a language which enabled you to, say, place different size dots and lines on a page. In comparison with that, TeX would look like markup. (After all, TeX allows you to say use such-and-such font in so-and-so size with such-and-such skip and so on. You don't have to tell it to draw a line of so many em with a dot on to make an i.) Obviously this is an exaggeration but is there really a cut-and-dried distinction here? Commented Sep 23, 2014 at 23:47
  • 2
    @cfr -- i'm probably being pedantic here, but my point is that tex natively provides only the typesetting primitives directly. it does also provide the tools that allow you to create your own markup "front end", which i suppose does beg the question; other typesetting languages usually require separate mechanisms to develop a markup wrapper. please don't confuse plain tex with the tex program; in the sense i'm referring to, even plain tex is a front end, albeit quite limited. Commented Sep 24, 2014 at 12:58

2 Answers 2

20

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".

answered Dec 29, 2014 at 18:27
1
  • Thank you a lot for your insightful comments and answer! (Happy new year!) Commented Jan 9, 2015 at 17:18
0

@barbara beeton - Very interesting article and I fully agree and actually I wanted to add the following input as a comment but it was too long and therefore writing it as an answer. I like the term "typesetting language" even I could not find its definition in Wikipedia. Therefore I came up with the following relationship respective analogy:

(Digital) Typography & Manuscript vs Style Sheet Language & Markup Language: Based on the definitions regarding (digital) typography, manuscripts, style sheet language and markup language, a style sheet language is a form of Digital Typography with the aim to make a marked up manuscript respective document written in a markup language legible, readable and appealing when displayed. The Style Sheet Language functionality: "Syntax", "Selectors", "Properties", "Values and units", "Value propagation mechanism" and "Formatting model" contains among other things all formal information required for typesetting: typefaces, point sizes, line lengths, line spacing, letter spacing, and spaces between pairs of letters.

answered Feb 21, 2024 at 11:09
1
  • Welcome to TeX.SE! Commented Feb 21, 2024 at 11:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.