The philosophy of logical markup |
Many word processors on personal computers are designed as "what you see is what you get" (WYSIWYG) programs. For example, if you want a word to print in italic (slanted) type, you click a button or make a menu selection, and the characters change their appearance right on the screen. With a markup language like LaTeX or HTML, you instead insert special "control sequences" into your document that encode the instructions to change the type style, but you do not see the result until you run a separate preview program or print the document.
Why is it useful to use the second method instead of the first? There are several reasons.
With a markup language, you are forced into using a consistent
style. For example, if you start each section of a document
with LaTeX's \section
command, you can be sure that all
section headings will have the same font. With a WYSIWYG
program, you might instead end up with section headings in
several different font styles; this would be a particular
problem if you were to merge two WYSIWYG documents written
by different authors.
With a markup language, it is easy to change the style
throughout a document. Suppose you need to change all the
italic words to underlined words. With a WYSIWYG program,
you might have to go through the whole document by hand to
locate and change each occurrence of italic text. With a
program like LaTeX, you could use the global
search-and-replace feature of your editor to change all
occurrences of \emph
to \underline
with a single
command. Even better, you could simply insert one line of code
at the beginning of your LaTeX document to redefine
\emph
to be a synonym for \underline
.
Thus, a markup language is more flexible than a WYSIWYG program if you want to make changes to the style. For this reason, devotees of markup sometimes disdainfully refer to WYSIWYG as "what you see is all you've got."
Perhaps the most important feature of markup languages is that they encourage you to concentrate on the logical structure of your document rather than on its visual appearance. In the past, most documents were printed on paper. In the modern technological world, your documents may instead be read on a computer screen, and you cannot know ahead of time what size the screen is or what fonts are available to the viewer; or maybe your document will be "read" by a blind person using a speech synthesizer. Therefore, you do not want your document to have instructions like "set these characters in 14 point bold Helvetica type"; instead, you should say something like "this is a second level section heading."
Mainstream word processors like Word and WordPerfect do support logical markup through drop-down menus and style sheets, but most users of those programs do not use the available features consistently and effectively--perhaps because the users do not realize the advantages of logical markup.
Documents created using consistent, standardized markup have the potential of being easily upgraded for future software revisions and easily converted into different markup languages. Because LaTeX and HTML both implement the concept of logical markup, the tantalizing possibility arises of translating automatically between the two systems. Various methods that have been proposed for carrying out such a translation are discussed in another section.
The philosophy of logical markup |