Skip to content

TeX-Talk

That’s “Tex” as in “blecch,” not “Tex” as in “Mex” or so the TeX User Group site says.

I have long been interested in Dr. Knuth’s TeX typesetting system. The idea of being able to do my Math homework electronically has intrigued me ever since I got a home work problem wrong because I added 2 and -2 and got 4. You see, I had erased that part of the problem several times and on the final work through, I did not see the negative sign.

In a later class at George Mason University, I experimented a bit more with this. I did not use TeX, instead opting for the “easier” Open Office. The results were pretty decent, but I had very little control over the actual appearance. It turned out to be a class saver though, because the job I was working at the time ramped up in the November/December time frame requiring a lot of overtime. Because I had already been submitting my homework in PDF format, my instructor bent his own rules and allowed me to both miss most of the remaining classes, and also submit my homework via email.

Armed now with an example of how-not-to, a success story, long standing interest and sudden free time, I decided it was time to dig in and start figuring things out.

Question 1. What is the difference between TeX and LaTeX?

Answer: Wrong question…

Question 2. What ARE TeX and LaTeX?

Answer: blah blah blah TeX blah blah ConTeXt blah blah BibTeX blah blah LuaTeX blah blah XeTeX blah blah blah pdfTeX blah blah….

Question 3. What is the best TeX editor?

Answer: blah blah source blah blah template blah blah LyX blah blah blah TeXnicCenter, TeXMaker fork TeXStudio, blah blah IDE blah Kile blah blah

I had more questions of course, but about this time my head exploded.

Eventually I realized I was not just asking the wrong questions, I was speaking the wrong language. In fact, I would guess almost everyone who wanders into the TeX universe does so as a stranger in a strange land. It doesn’t matter if you speak Programmer, Mathematician, Physicist, Chemist, Screenwriter, Novelist, Philosopher, Business, Academic, Government or most anything else, because you have probably never spoken Typographer.

To be honest, this should have been obvious as the entire purpose of TeX was to give non-Typographers fine grained control over the typography of their work. So top of my list now, is learning the art of Typography, starting with the vocabulary. There are strange words like serif and kerning. Apparently there is a difference between italicized, slanted and emphasized text. As I learn more about typesetting as a discipline, it will become increasingly easier to program TeX.

That’s right, I said program. TeX is a macro and token based programming language, NOT an application like Open Office or Microsoft Word. TeX was designed to give fine grained control over document layout as well as to insure that layout would appear exactly the same on any system. For anyone who has tried to import a Microsoft Word document into Open Office, or even a really old Microsoft Word document into a newer version of Microsoft Word, the results were likely disappointing. Try even transferring between the same version of the application but on two different operating systems. And then, what if your application just doesn’t do what you want it to? This goes back to my earlier example of doing my Math homework in Open Office. My formulas were there, but I had very little ability to coerce it into any display other than the one decided upon by the developers of Open Office. TeX then, is a typographical system.

LaTeX on the other hand is a layer on top of TeX. In fact, LaTeX is mostly a collection of TeX macros. It allows document writers to separate presentation from content. This is similar to the concept of Styles in Word Processors and Cascading Style Sheets in HTML. But like TeX, it is still programming or markup language, not an application like a word processor. To see what the final document looks like, you have to process (compile) it. LaTeX then, is a document preparation system.

So how does one write a document using TeX/LaTeX? Well, since it is just text, you can use any old text editor your system happens to have available. You can write it in VI, Notepad, TextEdit, whatever.

But what if you don’t want your homework to look like this as you write it?

\documentclass{article} % Starts an article
\usepackage{amsmath} % Imports amsmath
\title{\LaTeX} % Title

\begin{document} % Begins a document
\maketitle
\LaTeX{} is a document preparation system for the \TeX{} typesetting program. It offers programmable desktop publishing features and extensive facilities for automating most aspects of typesetting and desktop publishing, including numbering and cross-referencing, tables and figures, page layout, bibliographies, and much more. \LaTeX{} was originally written in 1984 by Leslie Lamport and has become the dominant method for using \TeX; few people write in plain \TeX{} anymore. The current version is \LaTeXe.

% This is a comment, not shown in final output.
% The following shows typesetting power of LaTeX:
\begin{align}
E_0 &= mc^2 \\
E &= \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}}
\end{align}
\end{document}

Wikipedia contributors. (2021, April 4). LaTeX. In Wikipedia, The Free Encyclopedia. Retrieved 03:40, April 13, 2021, from https://en.wikipedia.org/w/index.php?title=LaTeX&oldid=1015882123

Well, you can introduce another layer, the TeX editor. As expected, there are several to choose from, but once again, you can’t just ask “what’s the best editor?” Besides the obligatory holy war, there are actually three distinct concepts when it comes to TeX based editors.

The first is a “source” editor. This is very much like a regular text editor chock full of TeX specific features. You are still writing/editing the source (like the example above), but the editor includes many features to make this easier. Syntax highlighting, code help and completion, preview panes, etc.

The second is only marginally different. It extends the above idea and basically treats TeX just like any other programming environment. The result is a full blown IDE (Integrated Development Environment). Arguably, this would be particularly appealing to Programmers since it would be very similar to any programming IDE they are already using. In fact, one of the most popular programmer IDEs, Eclipse can be extended by a variety of plugins to include TeX based editors right in the same IDE the programmer is already using.

The third concept, as far as I know, has only one contender, LyX. LyX bills itself as a document processor. This makes it sort of a layer on top of LaTeX and is much closer in use and appearance to Word Processors than to Source Code Editors. For the most part, with LyX you do not directly edit the source code. You can enter some short codes and such, but you mostly write your content just as you would in any Word Processor. However, like the Source Code Editors, you still have to process, or compile, the document before you can see exactly what it will look like. Just like LaTeX itself, the working window of LyX focuses on the content and what that content represents. Is it a heading? Is it a title page? Is it an enumerated list?

Would you believe after figuring this all out, I STILL wasn’t ready to write a document? What might have slipped your notice here is downloading LyX or any of the other TeX editors doesn’t allow you to write TeX documents! Remember, TeX is a programming language. Just downloading LyX is like downloading Eclipse, but not downloading any language compilers.

Fast forward the rest, Install Strawberry PERL -> Install Magicsplat Tcl/Tk -> Install TeX Live -> Install LyX -> start writing.

Good thing this is going to make my life easier one day…

Published inTechTalk

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

TeX-Talk

by Robert time to read: 5 min
0