19

I've been using LaTeX now for roughly about 20 years. Only within the past 3 years or so have I tried understanding the internal workings of TeX. There are not a few posts here for which the OP is using LuaTeX or ConTeXt. I thought it might be a good project to try to understand what's going on there. But I'm a bit overwhelmed by the material I find.

Most of the material I can find (such as calling texdoc luatex from the command line) seems to target an audience already familiar with the concepts. (In fact texdoc context is even worse in terms of helpfulness.)

So where do I get started?

I would hope some sort of introduction would address the following points:

  • What does LuaTeX/ConTeXt do for you?
  • Why would I want to use LuaTeX/ConTeXt?
  • How do I incorporate the facilities I'm already familiar with (such as pstricks and TikZ) in a LuaTeX/ConTeXT document?

It would also be nice if I could be pointed to some show-case pieces that demonstrate the power of using these .... (I don't know what to call them) engines?

15

I'm not an expert on any of this but this is what I've been able to figure out.

ConTeXt is a macro package, a peer of LaTeX. It happens to run only on the LuaTeX engine. LaTeX supports several engines, so you get LuaLaTeX and XeLaTeX, and I think (but may be mistaken) that "vanilla" LaTeX runs on PDFTeX or "original" TeX.

The differences between the engines from my perspective as a user is basically this:

  • "classic" TeX makes those ugly DVI files and depends on ugly METAFONT fonts (the prime offender being Computer Modern).
  • PDFTeX is just like "classic" except it produces PDFs without you having to go through dvipdf or dvips | ps2pdf.
  • XeTeX uses your system fonts (TTF or OTF), and is therefore inherently superior to the previous two.
  • LuaTeX is TeX with the programming language Lua baked-in. It seems to support OTF and TTF fonts as well as XeTeX.

So, to answer your questions:

  1. What does LuaTeX do for you? It gives you better font handling and a sane extension language. You can also access Lua libraries directly from TeX if you wanted to do esoterica like connect to databases from your typesetting process.
  2. What does ConTeXt do for you? It does the same things LaTeX does. I find it a lot easier to understand and read, and it seems to take a lot less effort and produce much more beautiful documents. The main problem (IMO) is that it changes so rapidly the documentation often seems to be out of date, which leads me to the helpful folks on the mailing list and here on SE.
  3. Why would I want to use LuaTeX? Apart from the improved font handling and ease of extensibility, the main argument would be that it is where all the action is currently. If you're not swayed by those aspects I'm not sure there's anything really for you here.
  4. Why would I want to use ConTeXt? Because you want to do things that are complex to do in LaTeX more easily and you want a typesetting workflow that is more modular and repeatable. Your threshhold for document beauty has increased. You're tired of the ol' package hunt and subsequent trying to find the incompatibility when something doesn't work. You've noticed that LaTeX fights back hard when you try to use plain TeX facilities and you want to try a macro package that plays nicer.
  5. How do I incorporate the facilities I'm already familiar with? ConTeXt actually has TikZ baked in, so you can just continue using that. PStricks is unsupported in things that do not take a PostScript route to get to the finished product, so you won't be able to use it. ConTeXt has fairly tight integration with METAPOST though, for doing lower-level graphics. You may find that approachable. Random LaTeX packages are, for the most part, completely inaccessible to ConTeXt users.

I hope this helps. I'm a fairly enthusiastic (if ill-informed) user of ConTeXt and am getting more into plain TeX. I find that solutions to problems in ConTeXt almost never rely on third-party modules, but it's not all that uncommon that I'm unable to find the answer in the wiki. Responsiveness of the community on here and the mailing list is very high. But I am starting to wonder if I'd be happier using plain TeX, since I'm a fairly capable programmer and lately feel like I'd be happier with my own faulty abstractions that I understand fully than someone else's, especially if that someone else is such a wizard I can't really read the code.

If you want to really go outside the box though there are other typesetting systems; Heirloom Troff in particular is interesting if you want to try something much faster and weaker than TeX, and it is also able to access system fonts.

I realize we're all bound by blood to recommend The TeXBook but I've actually gotten much more out of TeX by Topic (available on Lulu for $15) and TeX for Beginners. I really hate Knuth's writing style.

  • Can one compile context file to html using tex4ht? – Nasser Jun 5 '15 at 6:32
  • @Nasser I would be surprised, but I don't know. ConTeXt can process XML though, so maybe it's easier to go the other way around. One disappointing process ConTeXt users go through is discovering how much stuff with "TeX" on the label is really LaTeX-only. – Daniel Lyons Jun 5 '15 at 6:44
  • 1
    @Nasser: no, you can't use tex4ht. But ConTeXt has a xml-export which may be useful. – user2478 Jun 5 '15 at 6:50
  • @Herbert Well, I am looking at Context web page now and I see a very blurry text/image in the middle of the page right there: welcome to the context garden. If this page was generated by context->xml->html, then it does not look good. I am surprised that such text that is hard to read and is clearly a bad image (low resolution), is there at a web page about publication and good quality layout. Someone should fix that page. – Nasser Jun 5 '15 at 7:52
  • 1
    +1 But this is not entirely true “XeTeX uses your system fonts (TTF or OTF), and is therefore inherently superior to the previous two.”, it's not inherently superior: there are things available in pdfTeX that are not in XeTeX. – Manuel Jun 5 '15 at 9:58
7

ConTeXt and LaTeX are both based on TeX but have a different philosophy and syntax. Both can use one of the three different engines: pdftex, xetex, and luatex. The current version of ConTeXt, called MkIV, works only with luatex, the former version MkII can also run with pdftex and xetex. ConTeXt has a build-in MetaPost support, but also works with TikZ and PSTricks. Both are loaded as modules. PSTricks images are converted in the background with xetex from MkII.

With lualatex you can use any existing LaTeX document if you change input and font encoding. For LuaTeX input encoding is always utf8 and fonts can be OTF, TTF, or Type1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.