[tex-eplain] LaTeX vs just TeX (or TeX with eplain) vs everything else

terry.s at Safe-mail.net terry.s at Safe-mail.net
Thu Oct 12 05:49:17 CEST 2023


Hello,

I agree with you Laurence. LaTeX and its cornucopia of packages do A LOT out of the box, but they also get in your way. That is part of my motivation to learn "plain" TeX (when I say "plain TeX" I just mean TeX without LaTeX or any of the macro languages).

(A) In general use, here are some examples of issues I've run up against using LaTeX:

* Headers and footers: there's a lot of flexibility in headers and footers if you add "fancy" (Or is it "fancyhdr"? I forget; the original package was supplanted by another some time ago anyway, and I've used both. They're very effective.) However, those packages are extremely confusing, needing to define marks that are named opposite of what you'd think, and needing to be placed in other marks named per a different scheme. Just changing a header to what I wanted the first time took me DAYS.

* Layout assumptions made by the classes: not a problem for "typical" documents.

* Unneccessary abstraction: as Petr Oslak (creator of OpTeX) points out, LaTeX actually rededfines many TeX primitives under new names + syntax. Thus you don't really learn TeX very much.

* Extensive use of '@' as a special character in macros (true of TeX to a point, too). This includes the particularly annoying need to constantly issue \makeatletter and \makeatother to do anything advanced with macros. Mostly I found trying to create anything but simple macros required knowing TeX, too, and I didn't. (Creating macros that both index and typeset a term aren't that hard; actually better ones came in some package. But creating macros that do things different ways based on how many arguments a users passes was too much for me at the time.)

* Trying to install PostScript fonts was impossible for me. After several days following complex instructions for available LaTeX tools, I just could not get it to work. I have so many nice fonts on my computer I cannot use in TeX/LaTeX.

* I think there is some newer package or tool to deal with the font-loading part with some sanity in the last couple of years, which I must investigate. I have no funds to buy expensive books at the moment. "The TeX Book" as you recommended has been on my wish list a while, and so is "The LaTeX Companion, Third Edition" (I at least downloaded the sample chapters). The *eplain* documentation and examples around the Internet are where I'm starting with this.

(B) I tested out OpTeX and I liked much about it:

* It's as easy to define layouts as in OpTeX, including margins and custom paper sizes. Unlike LaTeX, no external packages are needed (for that nor many other things).

* It doesn't duplicate TeX primitives unless there is some real improvement to be had. Petr's judicious in the macros he provides.

* It avoids '@' and even removes several TeX primitives that use them (except 2), replacing with ones that don't use '@'.

* It's very easy to load and switch fonts in a document.

* I mainly tried OpTeX because it lets you rely more on TeX, but also because it was written with multilingual support. (However, the number of languages is limited!)

* You can (theoreically) use any fonts installed on your computer, but there are limitations to that. (I can't type Japanese, for example.) Theoretically it would be possible to type it even without the proper patterns, but it's just not possible. The CJK (Chinese-Japanese-Korean) mappings don't exist, and it doesn't understand the characters. (You can type Asian characters directly in nearly any application using Microsoft IME; a few very old applications will turn them all to "?"s.)


Both OpTeX and LaTeX (now) support Unicode, but there are 2 things I want to do (one is impossilbe in LaTeX, the other in both).

(1.) There's no support for Asian characters and typesetting. This includes:

     a) The characters themselves: LaTeX does *not* support the mapping of 3-byte characters, even though it's UTF-8 by default since 2018.

     b) "Hyphenation" rules, which also means spacing and so forth. (These are very different for Chinese, Japanese and Korean; some rules have no equivalent and must be disabled. There is no inter-word spacing, except between mixed-language text. There is still space between sentences, glue is different around certain punctuation surrounding words in a sentence, and of course, there's NO hyphenation. This all affects calculation of lines. When a layout is *vertical* the INDIVIDUAL CHARCTERS must still be displayed *upright*, and glyphs and mapping must account for this.)

     c) Support is needed for BOTH horizontal, LTR, front-to-back text (Japanese uses all 3 in technical reports produced by computer) PLUS vertical, top-to-bottom, back-to-front typesetting (which also affects headers and footers and page numbering).

Even though OpTeX has always been UTF-8, it only supports a limited set of hypenation patterns (and not Asian). There are only about a dozen packages for OpTeX (none of them Asian-related). OpTeX is of excellent quality and I love its approach, but it's mainly maintained by its creator, hence the lack of languages and packages. As far as I know, it is just NOT capable of vertical typeseting --- I don't mean turning text sideways --- even in boxes, which makes sense (without a package for it). I'm extremely disappointed because I would love to use OpTeX for Japanese if it were possible.

Now, I can hear you thinking, "Why don't you just use pTeX (shift-JIS encoding, etc.) or UpTeX (UTF-8 encoding)?" I took them for a run, but my Japanese is very basic and self-taught, I absolutely cannot understand Japanese documentation. Heck, even before I used LaTeX I was trying to find English-Japanese dictionaries that inlcuded technical and computer concepts because I couldn't even write instructions to a Japanese person who knew a little English, beyond adopted words like pu-ro-gu-ra-mi-n-gu, co-n-pyu-ta, ii-mei-ru, we-bu-sai-to (programming, computer, email, website). I could not and still cannot find such a dictionary, either in stores or online. After several years I found a very old hardback, but written for Japanese people in Japanese-English only, and not covering modern concepts at all. The only thing I can do is randomly preuse it as a kind of thesaurus lottery; I can't understand its definitions or look up English words to find the Japanese (and if I know the Japanese word, then I don't need it). I did find, however, an entire dedicated book on properly writing emails in Japanese, which blows my mind, and I have yet to get to it. I don't even know most commands of the engine in general.

The extremely limited documentation of pTeX (which mostly also applies to UpTeX) pretty much covers installation and a few basic commands. Available packages are very nice with lovely headers, and usable if I want to say, write an entire book in Japanese, and don't need to do my own programming. The documentation covered very litle except *ruby text* (tiny pronunciation keys in phoneteic "hiragana" above or to the right of full-blown kanji words) and a limited number of engine/format commands, and limited examples using couple of packages. I would need to have passages of English and Japanese to do things like practice translation, create learning documents for myself or others, etc. I don't even know how to add (invisible) horizontal boxes in vertical layout (with 1 excdeption), and I absolutely do not know how to switch language hypenation patterns (though there is never a problem typing English) or generated-word labels (like "table", "chapter"...though I guess I don't need to). You CAN "just type English", but in a vertical class, this means the ENTIRE TEXT TURNS SIDEWAYS. The only thing I know how to do in a vertical (or horizontal) class is to use a *shadowbox* (which does temporarily override line-based directionality, solving the sideways-text problem). I think that would look ridiculous used extensively or for any long passages, though it's okay for aside-type information or a maybe a quotation. I have no idea how to customize anything much nor what commands are available in the engine/format.

Now, you're also thinking, "but there are Asian packages for LaTeX"! Indeed there's ONE, OLD package that still works sufficiently, but it's limited. It provides the ability to load a FEW Asian fonts (I like 2 of them for that to be sufficient), and a couple versions of a "CJK" environment which could be used for the entire main text or for switching throughout the document (which is its main purpose). However, it does NOT support advanced features like changing the headers, labeling words, layout or directionality. (I can't recall if you can do *ruby text*...I don't think so, but don't quote me.)

(2.) Custom layouts and paper sizes (mainly to create 12-month calendars and desk calendars with photographs, also book covers):

This is eminently possible in OpTeX and even easy (though the calendars themselves would be complicated).

I found NO LaTeX packages to do this at all, and anyway I have some custom ideas in mind (like loading user-customized lists of photos, user-customized holiday lists, and (particularly advanced) list that adjust per year, for example holidays that move to fall on certain days). Surely I can design a class and template and duplicate the entire thing with hard-coded photos and holidays, which would be fantastic on its own. LaTeX classes already enforce their styles on a document, and classes may add more, all of which require extensive macro programming that I don't know how to do yet, and I already discovered are much complicated when you're overriding stuff you didn't want in the first place. You MUST declare a class in LaTeX; you don't have to do that in OpTeX.

Don't get me wrong, LaTeX is fantastic in many ways, and I actually like it a lot. But it also comes with its own limitations (font-loading, NO support for Asian fonts or directionality, both critical), and imposes extensive, convoluted extra work to significantly change anything.

My thinking WAS:
1) Learn TeX because OpTeX doesn't get in my way, and I can probably do a lot more in OpTeX in terms of custom layout.
2) Learn TeX because what are not provided by UpTeX's own format can probably be done in TeX, and also because I don't even really know about UpTeX and can't find any English documentation.
--- If I can do it in TeX, I can do it anywhere (excepting the need to override extensive macros, as in LaTeX).

So here I am learning TeX by itself (and with eplain). Heck, maybe I can hack my own vertical, front-to-back layout (though that's probably too advanced). My best bet for the Japanese engines is learning enough to NOT NEED all the macros I can't read about in English.

Sincerely, 
Terry S.



More information about the tex-eplain mailing list.