For some reason, a lot of articles about LaTeX focus, like this one, on typographic features such as ligatures and line breaking. For me, where TeX earns its keep is the macro capability. While primitive as a programming language, the ability to define your own commands is a powerful tool for enforcing consistency and reducing effort.
Two examples from work. For a proposal, we had to produce two documents, a short and a long one, with common titles and introductory paragraphs and cross-references and such. With LaTeX, we actually wrote just one proposal, with the contents embedded in TeX macros. Changing the macro definitions let us produce what became two "views" of the same material.
Second, for a paper on sorption modeling, we used macros for all the physical variables, to make sure all the equations "read" correctly (e.g., writing "\cSorbBulk" rather than, say, "C_b"). Halfway through the paper, we decided on a new notation for distinguishing between gas- and sorbed-phase concentrations. It took maybe five minutes to update the pertinent definitions and re-set the paper.
This is an excellent point. For me, the word change on your first line is what really demonstrates it: many people conflate TeX and LaTeX, because LaTeX is TeX; or, to put it less controversially, LaTeX is written in TeX (rather than other (wonderful) extensions, like PDFTeX, XeTeX, or LuaTeX, all of which require source-level changes). LaTeX 3 (http://www.latex-project.org/latex3.html) takes this even further—and all this drives home the point (which I hope I may safely assert here as fact) that it's often much better to start with a simple programming language and customise it to your need, than to have a high-level programming language painstakingly customised and tuned for an application that turns out to be two millimetres to the left of the one that you actually want.
>it's often much better to start with a simple programming language and customise it to your need, than to have a high-level programming language painstakingly customised and tuned for an application that turns out to be two millimetres to the left of the one that you actually want.
I am interested to know if you had other examples in mind when you said this. Disclaimer: not trying to start a discussion on languages, or lang war.
> I am interested to know if you had other examples in mind when you said this. Disclaimer: not trying to start a discussion on languages, or lang war.
I'm not sure why you'd want to disclaim trying to start a discussion on languages; it seems like a good thing.
The sentence I wrote was originally intended just to describe TeX, but it seemed to me in retrospect that it applied almost as well to Lisp. Although the design philosophies of the two languages are completely different, both are intended to be the foundations for lots of little languages; Knuth has said that he was always surprised that people were happy to settle so quickly on TeX and LaTeX, rather than creating and selecting among many more specialised dialects. (Of course, a quick glance at CTAN shows that it is folly to think that everyone who uses TeX or LaTeX does the same thing with it!)
That's why I use TeX. I understand it fairly well, have a lot of macros that work well, and can write more macros easily. So I have own macros for table of contents, cross references, numbering figures, tables, chapters, sections, theorems, etc., bibliographic entries, verbatim, putting text from TeX on figures, putting a frame around foils, lists, etc.
With LaTeX, (1) I would have to learn more and (2) to write macros, I might have to understand and then fight what LaTeX assumes. Also the LaTeX documentation is much larger than 'The TeXBook'! So, I just stay with TeX.
Also for me a big, HUGE, point is that input to TeX (or LaTeX) is just a simple 'flat ASCII' text file, and for those I use my favorite, programmable text editor, the same one I use for writing software, e-mail, and much more. E.g., when I need to do some special thing to a TeX file, I can write an editor macro to do it.
Net, in my general purpose, long lasting collections, I have about 150 macros for TeX, about 150 for my programmable editor, and about 100 for command line scripts. So, that's 400 names to remember? No, from my editor, I can quickly see all the names of all the macros and, of course, for each macro its source. Searching for macros? My editor is great at searching! Lacking anything else, I can quickly pull all the macros of one collection into one temporary file and just search that. I have no difficulty finding macros! Works well.
Not to be missed, I run TeX from a scripting language which is 'smart' enough to do the converstion to PDF, etc. So, I minimize clicking. It's easy: I just have a little text window, and to see the results of a change in my TeX input I just hit the retrieve key in that window and then Enter. It's FAST.
Broadly I like 'windows', lots of windows, even for just one piece of work. So, for TeX I will have at least three, one for each of my text editor, the TeX DVI preview output, and the command line scripts. For my current software project, putting a Web site in front of some of my other software, I have about 15 windows with a mixture of Web browser windows and my editor windows. To open all those windows at the start of work, I have a simple script. To arrange the windows, I have a simple script. When the windows on the screen get to be a mess, I have a simple script that will arrange them and can be executed with an icon on the UL corner of my screen.
Lesson: One 'application' that has just one window and tries to do everything within just that one window is less good than just using the ability of the operating system to display many windows. So, right, "Look, Ma, no IDE!". And no Word, either.
End of my contrarian view of graphical user interface!
I agree. While I enjoy that it just makes everything look OK (since I don't care about most of the details), the best parts are the super easy macro definitions and being able to write equations (almost) as fast as I could by hand since it's all text -- I took notes for my physics and math classes in latex. Awesome packages like PGF/tikz, beamer(!) and listings are icing on the cake. Then again, the error messages are abysmal and placing tables is a huge chore.
Can I access this in LaTeX in any friendly way? What I want to do is replicate the namespace features of modern dynamic languages, so I can "import" macro names into files, and then collate this collection of files somehow to produce the whole document, in a way that doesn't lead to name conflicts.
TeX starts with a collection of macros called Plain.TeX that get written out in 'binary' so that they load quickly. 'The TeXBook' essentially assumes Plain.TeX.
As I recall, for LaTeX, there were some tweaks to Plain.TeX, and I don't understand the tweaks. There is a chance from the tweaks that some of the scope of names in TeX and LaTeX are different.
But, for scope of names, essentially as in a 'namespace', or as in name scoping in, say, PL/I or Algol or OOP languages, TeX has that done nicely at least for just one macro at a time. So, if bring in a macro, then need not worry about names within the macro conflicting with names outside the macro. Among the macros I wrote are some for dynamic allocation of storage of the various types within a macro.
For more, long names are permitted so that could use those to identify a 'package' or 'namespace' of many macros that call each other.
For more, I'd have to get out 'The TeXBook' and read again! The bad news for me is, I wrote the macros a long time ago so do not remember all the details. Indeed, what I wrote for verbatim was darned tricky, and I'd need two hours just to understand the crucial points in those.
But 'The TeXBook' is plenty readable. For some questions, can write some little tracing and printing macros (I did) and use the TIFO method, try it and find out.
Broadly, though, it does appear to me that Knuth was mostly thinking about one author with mostly their own macros and was not thinking about some world wide 'distributed' document and software development with a world wide name 'registration hierarchy', etc. In particular, if I were to send you some of my work with TeX, what could I send? My TeX input file? Darn, that assumes my full macro collection, and I wouldn't want to bother you with that. So, send you a DVI file? That assumes that you have the same font collection I do, and just what that is is not always so clear. So, net, the easiest thing to send is just a PDF file that has the font definitions inside the file. Broadly, then 'group' work was not a big design priority.
I have a friend, a good mathematician, who won't touch TeX and keeps running it down. Some of his criticisms are valid. E.g., look at 'The TeXBook': Essentially just one color. On each page, usually just one column. No page to page cross references. Not much in graphics except where the pictures are on their own pages, e.g., at the beginnings of the chapters. Positioning pictures to be close to corresponding text is a pain (unless there are some fancy macros I don't know about). Just how to get running headers and footers more than just simple single lines a bit tricky to understand. Something of a pain unless just use the Computer Modern fonts and the AMS symbols and a few more, e.g., the Euler fonts good for more math symbols.
The glory, then, is in what TeX does with mathematical expressions, and there it's just terrific: Just type in stuff, and immediately or soon it looks great. And surprisingly complicated expressions still look great just 'in line' instead of in 'display mode'. I do wish there were more sizes of brackets, etc.!
In my career in math, by far, I mean FAR, FAR^10, the most difficult problem, WAY more difficult than anything else, was JUST getting the math typing done. The math itself, for my Ph.D. dissertation, my published papers, my technical papers, was always MUCH easier than just the typing. The typing for the math was HELL. TeX solved that problem -- now I can do some math, type it in, and have something looks good right away. My main complaint is just that the Computer Modern fonts look WAY too light in PDF.
If someone wants to do another TeX, fine with me. In the meanwhile, for me, TeX makes high quality word whacking a solved problem so that I get to concentrated on other things.
This needs to be updated to compare against Word 2010. It's not there yet (and will probably always do line-by-line breaking, because who wants their text to jump around while editing?), but it can also do things that are not easy in LaTeX (where any custom thing requires somewhat deep knowledge).
This. It's not like it doesn't already do some heart-stopping repagination every time you drag borders or type into a table that crosses a page boundary, or when you drag around any object that is being word-wrapped.
Alternatively, for those who want good-looking text but prefer the WYSIWIG approach: just use a half-decent DTP program like InDesign, which will get you everything mentioned in the article except for the per-character transparency.
Another advantage of LaTeX over WYSIWIG alternatives is its simple plaintext representation. If we can still open any documents from our time period in 200 years, we'll be able to open that old LaTeX document of yours, because it's just ASCII (or Unicode in the case of XeLaTeX). And given the portability and simple requirements of the open source, exceptionally well documented TeX code base, it isn't far fetched to imagine someone could even run your documents through the actual LaTeX typesetter, if they really wanted to, 200 years or so from today.
Do you think anyone will still be able to open your documents in Adobe InDesign 200 years from now? This may not matter to everyone, but if it matters for your purposes, LaTeX has a clear advantage here.
EDIT: I'm not affiliated with the author of this article.
While longevity may be important, I think there are other more interesting advantages of plaintext, namely that I can edit in my editor of choice, I can use a host of existing tools, such as sed, grep, etc, to process it, and it plays well with standard source code management systems.
If you ever wrote a paper with another person, you will absolutely hate Word (and other binary formats). It makes working on the paper a pain, since only one person can work on it at the same time.
The ability to split a document in multiple source files and having SVN/git/etc makes it really easy to work on the document at the same time.
InDesign is an absolutely awesome program, my favorite from Adobe next to Lightroom.
Mac OS X’s font palette (while sucky in general and in dire need for a makeover to improve its UI — it’s like vintage 2000 or so) also offers you many of the mentioned features: 1 and 3 are on by default everywhere (type ‘shuffle’ into the Spotlight searchbox, ‘ffl’ will be turned into the appropriate ligature), 2, 4 and 5 are accessible through the palette but I don’t think OS X is clever about line-breaks (at least there are no settings to fine-tune). Don’t know about transparency. It is available to you in every program which uses OS X’s standard method of text input (like Pages or Safari).
OS X's text system does have per character transparency. It's not exposed by TextEdit but it is exposed by Pages's color picker.
You could retrofit smart justification onto the text system, but it would require some non-trivial code (namely an NSTypesetter subclass). It's not easy, but it's possible.
It annoys me that Latex is compared to Word, when they are bit different systems. Word is a word processor, and Latex is typesetting system. Much fairer comparison would be against Quark or InDesign, which are designed for typesetting.
You are correct, of course, but Latex and Word are the two main tools to write essays and such. In other words while they may be different systems, they are used in place of each other.
I've never seen someone editing an essay in InDesign (though I am sure there are such people).
One problem is that Quark and InDesign are expensive, bloated pieces of software whereas LaTeX and Word are free and easy to obtain (okay, Word isn't free, but it's ubiquitous).
Definitely. Those who write for the web don't need TeX. Those who write for print must not do the job of their editor. Manuscript standards are technically minimalist. They must look like they were written on a typewriter. LaTeX is for self-published authors and scientific papers (only because TeX was the first solution with a decent way to write equations).
CM is a very light font. I used to set things in Palatino and AMS-Euler, which cooperate surprisingly well; CM and Euler do not get along very well. If you decide you want to use that, the following magic will set it up in normal LaTeX.
If you've got a bunch of math, I'd say stick with CM, unless you want to reconfigure a bunch of stuff. For mostly text, set with sturdy fonts, you can use the "Serif" and "Sans" in Ubuntu with \usepackage{bera}, which stands for B[itstream] [V]era, but without the Bitstream(R) Vera(TM) name. Larger x-height, greater stroke-width, a solid look all around.
My understanding is that the problem with the CM fonts in PDF is actually not the CM fonts as in Metafont but in the conversion of the CM fonts to what PDF wants. So, that conversion was essentially by hand by starting with magnified TeX output and taking 'outlines', in part because what Metafont assumes for 'pens' conflicts with what PS does with 'pens'. So, from the last time I looked, it seemed that what I needed was just some new conversions of CM to what PDF wants.
Actually with the TeX distribution I have, there are some nice fonts for just text, maybe Century Schoolbook, etc. But, again, I never want to give up on math or the AMS symbols.
For most intents and purposes, I'd recommend using pdfTeX instead of TeX: your general output format is LCD, not paper, and Metafont renders pixel fonts, not vector fonts (because TeX's output format after all is paper, not screen).
Also, I found that using the LaTeX macros simplified my life a lot, instead of trying to reinvent the same formats over and over again. Why do you use just TeX instead of LaTeX?
Two examples from work. For a proposal, we had to produce two documents, a short and a long one, with common titles and introductory paragraphs and cross-references and such. With LaTeX, we actually wrote just one proposal, with the contents embedded in TeX macros. Changing the macro definitions let us produce what became two "views" of the same material.
Second, for a paper on sorption modeling, we used macros for all the physical variables, to make sure all the equations "read" correctly (e.g., writing "\cSorbBulk" rather than, say, "C_b"). Halfway through the paper, we decided on a new notation for distinguishing between gas- and sorbed-phase concentrations. It took maybe five minutes to update the pertinent definitions and re-set the paper.