Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do semantics matter in Latex? If not, why not?

Tags:

latex

When I ask questions about achieving some particular layout LaTeX, I get answers that suggest I should use constructs that don't make sense for their semantics. For example, I wanted to intent a single paragraph, and I was told to make it a list with no bullets. It works, but that isn't the semantic meaning of a list, so why is it acceptable to abuse it like that.

We stopped doing it in HTML over a decade ago. Why are we still doing the equivalent of table layout in supposedly the best typesetting system there is?

Am I not getting it, but isn't this a little inelegant? Everyone says LaTeX is elegant and that you don't need to worry about layout, but then I find myself contorting tables, lists and other semantic markup to put stuff where I want it. Does the emperor have no clothes, or am I not getting it?

like image 924
Bob Bobson Avatar asked Dec 31 '10 14:12

Bob Bobson


1 Answers

When a problem like this comes along, and the answer is to use something that doesn't really make semantic sense, what you should do is create a new environment or command that wraps the functionality in a way that makes semantic sense.

Every layout language has this problem -- somewhere along the line, you need to get down to a physical, non-semantic solution. In HTML, the non-semantic parts of the solution are now pretty-well covered by by CSS and JavaScript (which are different languages from HTML). You create <div>s and <span>s that capture the semantics, and then you use CSS and JavaScript to define the physical layout for those semantics.

In LaTeX, you simply wind up using the exact same language for this purpose: LaTeX (or plain TeX, which is often hard to differentiate from LaTeX).

like image 153
Ken Bloom Avatar answered Nov 15 '22 10:11

Ken Bloom